CN113467699A - Method and device for improving available storage capacity - Google Patents

Method and device for improving available storage capacity Download PDF

Info

Publication number
CN113467699A
CN113467699A CN202010239040.7A CN202010239040A CN113467699A CN 113467699 A CN113467699 A CN 113467699A CN 202010239040 A CN202010239040 A CN 202010239040A CN 113467699 A CN113467699 A CN 113467699A
Authority
CN
China
Prior art keywords
data
information
memory
computing device
amount
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010239040.7A
Other languages
Chinese (zh)
Other versions
CN113467699B (en
Inventor
杜阁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010239040.7A priority Critical patent/CN113467699B/en
Publication of CN113467699A publication Critical patent/CN113467699A/en
Application granted granted Critical
Publication of CN113467699B publication Critical patent/CN113467699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for improving available storage capacity, wherein the method comprises the following steps: sending a write command and first data to the memory, wherein the write command is used for instructing the memory to write the first data; receiving first information from a memory; in response to the first information, a virtual disk is created for the memory. By implementing the embodiment of the application, the high data compression rate can be achieved under the condition of not influencing the performance of the storage system, and the unit capacity cost of the storage is reduced, so that the available storage capacity of the system is indirectly improved.

Description

Method and device for improving available storage capacity
Technical Field
The present application relates to the field of computer data storage, and in particular, to a method and an apparatus for increasing available storage capacity.
Background
Compared with a traditional mechanical Hard Disk (Hard Disk Drive), the Solid State Disk (SSD) has the advantages of fast start, strong shock resistance, faster data read/write speed, low power consumption, basically no noise during operation, smaller volume of the Hard Disk with the same capacity, and the like, so that the SSD is much higher than the traditional mechanical Hard Disk in performance and reliability. Although the performance advantage of the SSD is obvious, the cost per unit capacity of the SSD is much higher than that of the mechanical hard disk, and the large-scale application of the SSD is limited due to the small capacity and high price of the SSD. Therefore, in order to improve the cost performance of the SSD and reduce the cost per unit capacity of the SSD, the storage capacity of the SSD of the system is often increased indirectly by a data compression function.
The existing storage system mainly includes four data compression methods, which are Central Processing Unit (CPU) online compression, hardware acceleration engine online compression, CPU offline compression, and SSD internal compression only. The CPU online compression occupies system computing resources and affects the overall performance of the system; although the hardware acceleration engine online compression does not occupy the system computing resources, the integrated compression algorithm cannot be updated to the existing optimal algorithm in time, so that the optimal data compression rate cannot be achieved; the CPU offline compression needs to read and compress the data stored in the storage medium and then store the data again, so that not only is the system computing resource occupied, but also the read/write times of the SSD are increased, and the life cycle of the SSD is reduced; the internal compression of the pure SSD needs to report the virtual storage space in advance, has poor expansibility, and is easy to cause system abnormity or waste of storage space due to the fact that part of the storage space cannot be used.
Therefore, it is an urgent problem to reduce the cost per unit capacity of the SSD while achieving data compression and achieving the best data compression rate while ensuring that system performance is not affected.
Disclosure of Invention
The embodiment of the application discloses a method and a device for improving the available storage capacity of a system, which realize the purposes of achieving high data compression ratio and reducing the unit capacity cost of a memory under the condition of not influencing the performance of the storage system, thereby indirectly improving the available storage capacity of the system.
In a first aspect, an embodiment of the present application provides a method for increasing available storage capacity, which is applied to a computing device, and the method includes: sending a write command and first data to a memory, wherein the write command is used for instructing the memory to write the first data; receiving first information from the memory; and responding to the first information, and creating a virtual disk for the memory.
In this embodiment, the first data may be text, a program, an image, a media video file (e.g., MP3, a high definition movie, etc.), and the like, where the first data may be compressible data, such as: text, characters, images, etc., the first data may also be non-compressible data, such as: MP3, high definition movies, compressed data, etc. If the first data is compressible data, the data volume of the first data is changed before and after the first data is compressed; and if the first data is the non-compressible data, the data volume of the first data before and after the first data is compressed is unchanged.
In the embodiment of the present application, the storage is a generic term including a solid state disk SSD, a mechanical hard disk HDD, a virtual disk, or other disks capable of storing data. The memory has the functions of compression and decompression and information transceiving, and can realize the communication between the memory and the computing device. In the embodiment of the present application, a solid state disk is taken as an example to exemplarily explain a scheme, but the application does not limit the type of the memory to be the solid state disk, and all memories having a compression function and a transceiving function can implement the scheme disclosed in the embodiment of the present application.
In the embodiment of the application, the first information is feedback information sent to the computing device after the memory executes the write command, and the memory has a compression function, so that the first information reflects the data volume change of the first data after the memory writes the first data according to the write command, and indirectly reflects the change of the available storage capacity of the memory after the memory writes the first data according to the write command.
In the embodiment of the application, the write command further carries a logical address of write data, so that the memory establishes a corresponding physical address according to the logical address of the write data after receiving the write command and stores the compressed write data.
In the embodiment of the application, the write command and the first data can be simultaneously sent to the memory together, and the write command and the first data can also be separately developed and sent to the memory according to the sequence.
The virtual disk created by the computing device for the memory is a free, unoccupied virtual disk. Virtual disks created by the computing device are mapped in the physical space of the memory. After the computing device creates the virtual disk for the memory, the available storage capacity of the memory recorded by the computing device is increased, and the increased available storage capacity is the capacity (or called virtual capacity) of the virtual disk.
It can be seen that, after the computing device issues the write command to the memory, the computing device receives the feedback information (i.e., the first information) reported after the memory executes the write command, and creates the virtual disk according to the first information, thereby implementing the capacity expansion operation on the available storage capacity of the memory, indirectly increasing the available storage capacity of the memory, and reducing the unit capacity cost of the memory (e.g., a solid state disk). In addition, the write operation service issued by the computing equipment is decoupled from the compression process of the write data in the memory, so that the performance of a system where the computing equipment is located is not influenced while the high compression rate is achieved.
Based on the first aspect, in a possible embodiment, the first information is used to indicate an amount of difference between a first amount of data before the first data compression and a second amount of data after the first data compression; said creating a virtual disk for said memory in response to said first information, comprising: and creating the virtual disk for the memory according to the difference indicated by the first information.
In the embodiment of the application, the write command instructs the memory to write the first data, and since the memory has a compression function, when the first data is written into the memory, the write refers to that the memory sequentially compresses and stores the first data, and the data amount of the first data may change before and after the write, so that the first information is used to indicate the difference between the first data amount before the first data is compressed and the second data amount after the first data is compressed, in other words, the first information indicates the data amount of the first data reduced after the first data is compressed by the memory. If the first data is compressible data, the first data volume before the first data is compressed is larger than the second data volume after the first data is compressed, namely the difference indicated by the first information is larger than 0; if the first data is the incompressible data, the first data amount is equal to the second data amount, i.e. the difference amount indicated by the first information is 0. Therefore, the first data amount before the first data compression is equal to or larger than the second data amount after the first data compression.
For example, the memory is a solid state disk, and assuming that the original physical space capacity of the solid state disk is 100G, initially, the available storage capacity of the solid state disk recorded by the computing device is recorded as 100G. The computing device sends 10G of write data to the solid state disk to indicate the solid state disk to write, the 10G of write data is compressed into 6G by the solid state disk, after the write data is successfully written into the solid state disk, the computing device records that the available storage capacity of the solid state disk is 90G, meanwhile, the computing device receives first information from the solid state disk, the first information indicates the difference amount of 4G, if the first preset storage capacity set by the computing device is 4G, the computing device creates a virtual disk for the solid state disk, the capacity of the virtual disk is 4G, the available storage capacity of the solid state disk recorded by the computing device becomes 94G, the solid state disk only occupies 6G of storage capacity, the remaining available storage capacity of the solid state disk is also 94G, wherein the available storage capacity of 4G is reported to the computing device so that the computing device creates a virtual disk for the solid state disk.
In the embodiment of the application, the computing device creates a virtual disk for the memory according to the difference indicated by the first information. In one implementation, the computing device receives the first information, and creates a virtual disk with the same capacity for the memory according to the difference indicated by the first information, wherein the capacity of the virtual disk is determined by the difference indicated by the first information each time; in another specific implementation, the creating condition of the virtual disk may also be set, that is, the difference indicated by the first information reaches a certain fixed threshold, and the virtual disk is created only when the difference indicated by the first information reaches the certain fixed threshold, where the capacity of the virtual disk is the fixed threshold; in another embodiment, the virtual disk may be created only when the sum of the accumulated differences indicated by the received multiple times of the first information reaches a certain fixed threshold. In the embodiment of the present application, the creating condition of the virtual disk is not specifically limited.
It can be seen that, after the computing device issues the write command to the memory, the computing device receives the data compression change information (i.e. the first information) reported after the memory executes the write operation, and creates the virtual disk according to the data compression change information, thereby implementing the capacity expansion operation on the available storage capacity of the memory, indirectly improving the available storage capacity of the memory, and reducing the unit capacity cost of the memory.
Based on the first aspect, in a possible embodiment, after the receiving the first information from the memory, the method further comprises: recording the difference amount indicated by the first information to a storage pool; the creating a virtual disk for the memory according to the difference indicated by the first information includes: and when the storage pool reaches the preset storage capacity, creating the virtual disk for the storage.
In this embodiment of the application, after receiving the first information sent by the solid state disk, the computing device records the difference indicated by the first information in the storage pool, which means that the storage pool is established for a virtual capacity equal to the difference (compressed and reduced data size) indicated by the first information, so that the address space corresponding to the free and dispersed virtual capacity becomes a continuous address space. When the difference quantity indicated by the first information is smaller than the preset storage capacity, accumulation can be performed in the storage pool, and when the sum of the difference quantities indicated by the first information accumulated in the storage pool for multiple times reaches the preset storage capacity, the computing device can create a virtual disk. The preset storage capacity may be 8G, 10G, 20G, 25G, 50G or other values, and is not particularly limited in this application.
The storage pool reaching the preset storage capacity may be: recording the difference quantity indicated by the first information at a certain time in the storage pool, wherein the difference quantity is more than or equal to the preset storage capacity; or the cumulative sum of the difference amounts indicated by the first information recorded into the storage pool for a plurality of times is greater than or equal to the preset storage capacity. When the difference indicated by the first information at a certain time or the sum of the difference indicated by the first information at a plurality of times is equal to the preset storage capacity, the capacity of the created virtual disk is the preset storage capacity; the size of the created virtual disk may be the preset storage size when the difference indicated by the first information or the sum of the differences indicated by the first information is larger than the preset storage size, in which case, the part exceeding the preset storage size is used to accumulate the next preset storage size, and of course, in some possible embodiments, the size of the created virtual disk may also be the size of the current storage pool if the size of the current storage pool is larger than the preset storage size after the difference indicated by the first information is recorded to the storage pool. The number of the memories is at least one, and the virtual capacity accumulated in the memory pool may be accumulated by a plurality of write operations to one memory or a plurality of write operations to a plurality of memories. Therefore, the virtual capacity of the created virtual disk may be the sum of the difference reported after multiple write operations of one memory, or the sum of the difference reported after multiple write operations of multiple memories.
The method has the advantages that the computing equipment sets the trigger condition for creating the virtual disk, so that the control signaling overhead of the computing equipment is saved, the computing equipment is prevented from frequently creating the virtual disk for the memory, and a corresponding virtual disk is created when the difference indicated by the first information reported by the memory is accumulated to a certain degree, so that the management pressure of the computing equipment on the created virtual disk is reduced.
Based on the first aspect, in a possible embodiment, after sending the write command and the first data to the memory, the method further includes sending a delete command or a change command to the memory, where the delete command is used to instruct the memory to delete target data, the change command is used to instruct the memory to change the target data, and the target data is part or all of the second data; receiving second information from the memory; and responding to the second information, and deleting the virtual disk.
In the embodiment of the present application, the second data is data written or stored in the memory.
And after the writing command is based, the computing device issues a deleting command to the memory, wherein the deleting command is used for instructing the memory to delete the target data, and the target data is part or all of the second data. In some possible embodiments, the delete command may also be issued to the memory based on the change command.
The available storage capacity that the memory actually increases after executing the delete command is inconsistent with the available storage capacity that the computing device adds to the memory. Since the memory has a compression function, the amount of target data (compressed) deleted by the memory is smaller than the amount of data before the target data is compressed, and therefore the available storage capacity actually increased by the memory after the deletion operation is performed is smaller than the available storage capacity added to the memory by the computing device. Thus, the second information received by the computing device from the memory is feedback after the deletion command is executed on the memory.
After the write command is based, the computing device issues a change command to the memory, wherein the change command is used for instructing the memory to change the target data, and the target data is part or all of the second data, namely the change command is used for instructing the memory to change part or all of the second data. In some possible embodiments, the modification command may be issued to the memory based on the delete command.
It should be noted that, when the solid state disk executes the change command, the data source is changed due to the change command, and the compression rate of the second data after the change is reduced, so that the data size of the second data after the change is increased compared with that before the change, but the actual data size of the second data before and after the change is equal. Therefore, the change command may cause the virtual disk created by the computing device to have a partial virtual capacity false report, and therefore the computing device receives the second information sent by the memory, where the second information is feedback after the memory executes the change command.
The change command also carries a logical address of the second data, so that the memory establishes a physical address corresponding to the second data and stores the data obtained by compressing the changed second data according to the physical address.
It can be seen that, after the write command is based, the computing device issues a delete command and a change command to the memory, receives the dynamic storage information (i.e. the second information) reported after the memory executes the delete command or changes the command, and updates the available storage capacity of the memory recorded at the computing device side by deleting the added virtual disk according to the dynamic storage information, thereby improving the flexibility of disk management, realizing the dynamic management of redundant storage capacity caused by deleting or changing compressed data in the memory, avoiding the waste of virtual capacity in the virtual disk, and improving the utilization rate of the system storable capacity.
Based on the first aspect, in a possible embodiment, the second information is used to indicate a difference amount caused before and after the deletion command or the change command is executed by the memory; after the receiving the second information from the memory, the method further comprises: marking virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable; the responding to the second information, and deleting the virtual disk comprises: and deleting the virtual disk according to the unavailable virtual capacity.
In this embodiment, whether the memory executes the delete command or the change command may cause a part of the virtual capacity in the virtual disk created by the computing device to be unavailable, and the size of the unavailable part of the virtual capacity is the difference amount caused before and after the second information indicates that the memory executes the delete command or the change command.
It should be noted that, after the memory executes the delete command, the virtual capacity of the virtual disk created in the computing device has a partial false report, and therefore, the computing device needs to mark the partial false report as unavailable in the virtual disk according to the second information fed back after the memory executes the delete command. Since the part of the virtual capacity marked as unavailable by the delete command is occupied with no data, only a part of the free virtual capacity in the virtual disk is marked as unavailable. The problem that the available virtual capacity in the virtual disk is reduced due to the fact that the memory executes the deleting command is effectively solved, and data writing failure or system crash caused by the fact that the available storage capacity of the memory is insufficient of the computing equipment is avoided.
It should be noted that, the reason why the computing device marks the virtual capacity of the corresponding portion as unavailable in the virtual disk according to the second information fed back after the memory executes the change command is as follows: the memory occupies a part of the free virtual capacity in the virtual disk after performing the change operation, so that the occupied part of the virtual capacity needs to be marked as unavailable. I.e., the portion of the virtual disk that is marked as unavailable due to the change command has data stored therein. The problem that the available virtual capacity in the virtual disk is reduced due to the fact that the storage executes the change command is effectively solved, and data writing failure or system crash caused by the fact that the available storage capacity of the storage is insufficient of the computing equipment is avoided.
After the computing device marks the virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable, the computing device may delete the virtual disk according to the unavailable virtual capacity. In a specific implementation, after the computing device marks the virtual capacity corresponding to the difference indicated by the second information as unavailable, the computing device may delete the virtual disk with the same capacity according to the unavailable virtual capacity, where the capacity of the deleted virtual disk is determined by the difference indicated by the second information; in another specific implementation, the virtual disk deletion condition may also be set, that is, the unavailable virtual capacity reaches a certain specified threshold, and the virtual disk can only be deleted, where the capacity of the virtual disk is the specified threshold, and the unavailable virtual capacity reaches the specified threshold, which may be that the unavailable virtual capacity marked according to the second information reaches the specified threshold at a certain time, or that the sum of the multiple times of the unavailable virtual capacities marked according to the second information reaches the specified threshold. It should be noted that, the specified threshold is equal to or less than the capacity of the virtual disk to be deleted (that is, the preset storage capacity), and the deletion condition of the virtual disk is not specifically limited in this embodiment of the application.
It can be seen that, according to the received second information, after the virtual capacity equal to the difference indicated by the second information is marked as unavailable in the virtual disk, the available storage capacity externally displayed by the virtual disk is reduced, which is helpful for the computing device to know the remaining available storage capacity of the memory, and effectively avoids the problems of data write failure or system abnormality and the like caused by the fact that the data amount of the data written by the computing device indicating the memory is larger than the available storage capacity of the memory.
Based on the first aspect, in a possible embodiment, the deleting the virtual disk according to the unavailable virtual capacity includes: and when the unavailable virtual capacity reaches a disk deleting threshold, deleting the virtual disk, wherein the disk deleting threshold is less than or equal to the preset storage capacity.
In the embodiment of the application, the computing device may determine whether to delete the virtual disk by determining a relationship between the unavailable virtual capacity and a disk deletion threshold. In some possible embodiments, when the difference indicated by the second information is smaller than the disk deletion threshold, that is, the condition of deleting the virtual disk is not met, the virtual disk is marked as unavailable, and when the sum of the accumulated differences indicated by the second information reaches the disk deletion threshold, the corresponding unavailable virtual capacity also reaches the disk deletion threshold, that is, the virtual disk can be deleted.
In the embodiment of the application, the disk deletion threshold is less than or equal to a preset storage capacity, and the preset storage capacity is the capacity of the virtual disk created by the computing device. In some possible embodiments, the ratio of the delete disk threshold to the preset storage capacity may be 0.45, 0.5, 0.6, 0.8 or other values less than or equal to 1, which is not specifically limited in this application. The setting of the delete disk threshold is to leave room for the available capacity of the created virtual disk, which is beneficial to improving the operating efficiency of the system.
Based on the first aspect, in a possible embodiment, when the deletion command instructs the memory to delete the target data, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; or, when the change command instructs the memory to change the target data, the difference amount indicated by the second information is a difference amount between a fifth data amount obtained by compressing the changed second data and a sixth data amount obtained by compressing the second data.
In this embodiment of the application, the computing device sends a delete command to the memory to enable the memory to delete the target data, where the target data is the data deleted by the memory, and in this case, the second information received by the computing device is used to indicate a difference between a third data amount before compression of the target data and a fourth data amount after compression of the target data.
In this embodiment, the computing device sends a modification command to the memory to cause the memory to modify the target data, where the target data is part or all of the second data, that is, the modification command instructs the memory to modify part or all of the second data, and in this case, the second information received by the computing device is used to indicate a difference between a fifth data amount after compressing the modified second data and a sixth data amount after compressing the second data.
Based on the first aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the memory, where the first physical space is used for storing data of a difference size between the fifth data amount and the sixth data amount; before deleting the virtual disk according to the unavailable virtual capacity, the method further comprises: sending third information to the memory, wherein the third information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
In this embodiment of the application, the virtual disk is mapped to a first physical space of the memory, and in a case that the computing device sends a change command to the memory, the first physical space is used to store data of a difference size between the fifth data amount and the sixth data amount, in other words, the first physical space is used to store a part of data compressed by the second data after being changed by the memory, and the data amount of the part of data is the difference between the fifth data amount and the sixth data amount.
For example, the data size of the second data after compression is 6G, the data size of the second data after compression is 7G after modification, after the modification command is completed, 6G of the modified data after compression is stored in the original location in the memory, and the remaining 1G of the data after compression is stored in the first physical space of the memory, and the remaining 1G of the data can be considered to be stored in the virtual disk due to the mapping between the first physical space and the virtual disk created by the computing device.
In this embodiment of the application, when the virtual capacity marked as unavailable in the virtual disk reaches a disk deletion threshold value as a result of the memory executing the change command, the computing device needs to delete the virtual disk, but since the deleted virtual disk stores data, before the computing device deletes the virtual disk, third information needs to be sent to the memory so that the memory migrates the data in the virtual disk to be deleted, since the virtual disk is mapped in the first physical space of the memory, that is, the computing device instructs the memory to migrate the data in the first physical space to the second physical space of the memory, and after the computing device migrates the data, the computing device can execute deletion of the virtual disk. Therefore, dynamic management of the virtual disk is realized, and the operating efficiency of the system is improved.
It should be noted that, after the computing device deletes a certain created virtual disk, correspondingly, the first physical space in the memory no longer has a corresponding virtual disk and a mapping thereof, and therefore, the first physical space in the memory is restored to the local storage space of the memory.
Based on the first aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the memory, and when third data is stored in the first physical space, the method further includes: receiving fourth information from the memory; and deleting the virtual disk in response to the fourth information.
In some possible embodiments, after the computing device creates the virtual disk for the memory, the computing device sends a write command to the memory again, and after the memory executes the write command, the compressed third data is stored in the first physical space mapped to the virtual disk created by the computing device, that is, the data is stored in the virtual disk, so that the computing device also receives fourth information from the memory, where the fourth information is feedback after the memory executes the write command and stores the data to the virtual disk.
It can be seen that, in the case that the computing device has created the virtual disk, if the memory stores the written data into the first physical space mapped to the virtual disk, the computing device will also be triggered to delete the virtual disk.
Based on the first aspect, in a possible embodiment, the fourth information is used to indicate an amount of data after the third data compression; after the receiving the fourth information from the memory, the method further comprises: marking, in the virtual disk, a virtual capacity equal to the data amount indicated by the fourth information as unavailable; the responding to the fourth information, and deleting the virtual disk comprises: and deleting the virtual disk according to the unavailable virtual capacity.
In some possible embodiments, since the memory stores the third data in the first physical space mapped to the virtual disk after executing the write command, the computing device, after receiving the fourth information, needs to mark the portion of the virtual capacity occupied in the virtual disk as unavailable, i.e., mark the virtual capacity in the virtual disk equal to the amount of data indicated by the fourth information as unavailable.
In some possible embodiments, a condition may be set for deletion of the virtual disk, that is, when the unavailable virtual capacity in the virtual disk marked according to the data amount indicated by the fourth information reaches the disk deletion threshold, reference may be made to the description in the foregoing for the relevant description of the disk deletion threshold, which is not described herein again. The setting of the deleting threshold can leave room for the available capacity of the created virtual disk, and the operating efficiency of the system is improved.
Based on the first aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the memory, and the first physical space stores the third data; before the deleting the virtual disk, the method further comprises: when the unavailable virtual capacity reaches a disk deletion threshold value, sending fifth information to the memory, wherein the fifth information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
In some possible embodiments, if the memory stores data to the virtual disk according to the write command, when a virtual capacity marked as unavailable in the virtual disk reaches a disk deletion threshold due to the write command, the computing device needs to send fifth information to the memory before deleting the corresponding virtual disk because the data is stored in the virtual disk to be deleted, where the fifth information is used to instruct the memory to migrate the data in the first physical space to the second physical space of the memory. It should be noted that the second physical space is different from the first physical space in that: the second physical space has no virtual disk mapped to it.
In a second aspect, an embodiment of the present application provides a method for increasing available storage capacity, where the method includes: receiving a write command and first data from a computing device; compressing and storing the first data; sending first information to the computing device to cause the computing device to create a virtual disk for the memory.
In this embodiment, the first data may be text, a program, an image, a media video file (e.g., MP3, a high definition movie, etc.), and the like, where the first data may be compressible data, such as: text, characters, images, etc., the first data may also be non-compressible data, such as: MP3, high definition movies, compressed data, etc. If the first data is compressible data, the first data volume before the first data is compressed is larger than the second data volume after the first data is compressed; if the first data is compressible data, the data volume of the first data is changed before and after the first data is compressed; and if the first data is the non-compressible data, the data volume of the first data before and after the first data is compressed is unchanged.
The write command instructs the memory to write the first data, and since the memory has a compression function, the writing process of the first data in the memory refers to: the memory compresses the first data by using an internal compression algorithm and stores the compressed first data. In this embodiment of the application, the write command further carries a logical address of the first data, the memory establishes a physical address corresponding to the logical address, and stores the compressed first data in a physical space where the physical address is located. It should be noted that the process of writing the first data by the memory according to the received write-once command may also be called that the memory performs a write-once operation.
According to the embodiment of the application, the compression algorithm integrated in the memory can be Huffman coding, run-length coding or other compression algorithms with higher compression ratios, the compression algorithm in the memory can be updated in time according to the data type and the industry compression algorithm to achieve the optimal data compression ratio, and the available storage capacity of the memory is indirectly improved.
In the embodiment of the present application, the storage is a generic term including a solid state disk SSD, a mechanical hard disk HDD, a virtual disk, or other disks capable of storing data. The memory has the functions of compression and decompression and information transceiving, and can realize the communication between the memory and the computing device. In the embodiment of the present application, a solid state disk is taken as an example to exemplarily explain a scheme, but the application does not limit the type of the memory to be the solid state disk, and all memories having a compression function and a transceiving function can implement the scheme disclosed in the embodiment of the present application.
In the embodiment of the application, the first information is feedback information sent to the computing device after the memory executes the write command, and the memory has a compression function, so that the first information reflects the data volume change of the first data after the memory writes the first data according to the write command, and indirectly reflects the change of the available storage capacity of the memory after the memory writes the first data according to the write command.
Based on the second aspect, in a possible embodiment, the first information is used to indicate an amount of difference between a first amount of data before the first data compression and a second amount of data after the first data compression; the sending, to the computing device, first information for instructing the computing device to create a virtual disk for the memory includes: sending the first information to the computing device, wherein the first information is used for instructing the computing device to create the virtual disk for the memory based on the difference quantity indicated by the first information.
In the embodiment of the present application, since the memory has a compression function, the data amount before and after the first data compression is changed after the memory executes the write command, the first information is used to indicate a difference amount between the first data amount before the first data compression and the second data amount after the first data compression, in other words, the first information indicates a reduced data amount of the first data after the memory compression. If the first data is compressible data, the first data volume before the first data is compressed is larger than the second data volume after the first data is compressed, namely the difference indicated by the first information is larger than 0; if the first data is the incompressible data, the first data amount is equal to the second data amount, i.e. the difference amount indicated by the first information is 0. Therefore, the first data amount before the first data compression is equal to or larger than the second data amount after the first data compression.
It can be seen that, under the write command, the memory does not consume the computing power of the computing device in the data compression process, and the performance of the system is not affected. The compression algorithm adopted by the memory can be updated in time and customized as required, so that the memory achieves the optimal data compression rate, the data volume of the compressed data is reduced as much as possible, and the feedback information (namely the first information) is reported to the computing equipment after the write command is executed, so that the computing equipment creates a virtual disk for the memory, thereby indirectly improving the available storage capacity of the memory and reducing the unit capacity cost of the memory.
Based on the second aspect, in a possible embodiment, after the compressing and storing the first data, the method further comprises: marking the amount of difference caused before and after the first data is compressed as a reduced data amount; the sending of the first information to the computing device includes: sending the first information to the computing device when the reduced data amount reaches a preset threshold.
In the embodiment of the application, a trigger condition may be set for sending the first information, that is, when the reduced data amount reaches a preset threshold, the memory sends the first information to the computing device. The reduced data amount may be a difference amount marked after the write command is executed once, or may be a cumulative sum of difference amounts marked after the write command is executed a plurality of times. The preset threshold may be 2G, 3G, 5G, 6G, 10G or other values, and is less than or equal to the preset storage capacity.
For example, when the data volume of the first data reduced after compression in a single write operation is smaller than a preset threshold, the memory does not send the first information to the computing device, but the difference volume caused by the write operation can be marked first; when the accumulated sum of the difference amounts marked by the multiple writing operations is larger than or equal to a preset threshold value, the memory sends first information to the computing device, wherein the first information is used for indicating the difference amount between a first data amount before the first data compression and a second data amount after the first data compression.
It can be seen that setting the trigger condition for sending the first information can effectively reduce the number of times that the memory sends the first information to the computing device, avoid frequent reporting of the first information, and reduce the overhead of system control signaling.
Based on the second aspect, in a possible embodiment, after the compressing and storing the first data, the method further comprises: receiving a deletion command or a change command sent by the computing equipment; deleting target data according to the deleting command or changing the target data according to the changing command, wherein the target data is part or all of second data; and sending second information to the computing equipment, wherein the second information is used for indicating the computing equipment to delete the virtual disk.
It should be noted that the second data is data that has been written or stored in the memory. The second information is feedback after the memory has executed the delete command or the change command.
And after the writing command is based, receiving a deleting command issued by the computing equipment to delete the target data, wherein the target data is part or all of the second data. The deletion command carries the logical address of the second data, the solid state disk finds the corresponding physical address according to the logical address, and the stored compressed write data can be obtained from the physical space corresponding to the physical address.
Illustratively, when the target data is all the second data, that is, the memory deletes all the second data according to the received deletion command, the stored compressed second data is first found in the physical space corresponding to the physical address, and then the compressed second data is directly deleted.
Illustratively, when the target data is partial data of the second data, the memory deletes the partial data of the second data according to the received deletion command, the memory finds the stored compressed second data in the physical space corresponding to the physical address, decompresses the compressed second data, and then deletes the target data, where it is to be noted that after the target data in the second data is deleted, the memory needs to recompress and store the remaining data in the second data.
And after the write command is based, the memory receives a change command issued by the computing equipment, the memory changes the target data according to the change command, and the target data is part or all of the second data, namely the memory changes the part or all of the second data according to the change command. The change command carries the logical address of the write data, the memory finds the corresponding physical address according to the logical address, and the stored compressed second data can be obtained from the physical space corresponding to the physical address.
It should be noted that, because the data stored in the memory is compressed data, to change the second data, the memory needs to decompress the compressed second data before modifying the compressed second data. No matter part or all of the second data is modified, since the whole second data is decompressed, after the modification of the part or all of the second data is completed, the modified second data needs to be recompressed and stored, that is, the data after the modification of the second data is compressed is stored in the physical space of the memory.
It should be noted that, because the memory has a compression function, after the memory deletes the target data according to the delete command or changes the target data according to the change command, the virtual capacity of the virtual disk created by the computing device has a partial false report, so the memory sends the second information to the computing device, where the second information is feedback information to the computing device after the memory executes the delete command or the change command, so that the computing device deletes the virtual disk. Therefore, the dynamic management of the redundant storage capacity caused by deleting or changing the compressed data in the memory by the computing equipment is facilitated, the waste of the virtual capacity in the virtual disk is avoided, and the utilization rate of the storage capacity of the system is improved.
Based on the second aspect, in a possible embodiment, the second information is further used to indicate a difference amount caused before and after the deletion command or the change command is executed by the memory.
In this embodiment, whether the memory executes the delete command or the change command causes the available storage capacity of the virtual disk to decrease, the memory sends second information to the computing device, where the second information is used to indicate a difference amount caused before and after the memory executes the delete command or the change command, and therefore, the size of the decreased available storage capacity in the virtual disk is the size of the difference amount indicated by the second information.
Based on the second aspect, in a possible embodiment, when the target data is deleted by the memory, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; or, when the target data is changed by the memory, the difference amount indicated by the second information is a difference amount between a fifth data amount obtained by compressing the changed second data and a sixth data amount obtained by compressing the second data.
When the memory deletes the target data according to the deletion command, the difference amount indicated by the second information is the difference amount between the third data amount before the deleted target data is compressed and the fourth data amount after the target data is compressed; when the memory changes the target data according to the change command (i.e. part or all of the second data), the difference amount indicated by the second information is the difference amount between the fifth data amount after the second data is compressed and the sixth data amount after the second data is compressed, which is equal to the difference amount between the data amount after the target data is compressed and the data amount after the target data is compressed. It should be noted that, the data amount is increased by recompressing the modified data, because the data source is changed after the data is modified, which results in a decrease in the compression rate of the modified second data, and therefore, the fifth data amount is larger than the sixth data amount. The changed second data has a larger data volume, which means that the physical space occupied by the changed second data in the memory is increased, that is, more available storage capacity is consumed in the memory, the consumed available storage capacity is the difference between the fifth data volume and the sixth data volume, and the available storage capacity of the memory recorded on the computing device side should be correspondingly reduced after the change operation, so that the memory sends second information indicating the difference between the fifth data volume and the sixth data volume to the computing device, so that the computing device reduces the available storage capacity of the virtual disk according to the second information, the purpose of reducing the available storage capacity of the memory recorded on the computing device side is achieved, and data write failure or system abnormality caused by insufficient available storage capacity of the memory of the computing device is avoided.
Based on the second aspect, the virtual disk is mapped to a first physical space of the memory, where the first physical space is used for storing data with a difference size between the fifth amount of data and the sixth amount of data; after sending the second information to the computing device while the memory is altering the target data, the method further comprises: and receiving third information from the computing equipment, and migrating the data of the first physical space to a second physical space of the memory according to the third information.
In this embodiment of the application, the virtual disk is mapped in a first physical space of the memory, and in a case that the computing device sends a change command to the memory, the first physical space is used to store data of a difference between the fifth data amount and the sixth data amount, in other words, the first physical space is used to store a part of data after the second data compression after the change, and the data amount of the part of data is the difference between the fifth data amount and the sixth data amount.
Illustratively, after the command is written, the memory reports the compressed and reduced data size of the second data to the computing device so as to establish a corresponding virtual disk, and the virtual disk is mapped in the first physical space of the memory. After the memory executes the change command, the memory preferentially stores the redundant compressed second data to the first physical space of the memory, and sends second information to the computing device, wherein the second information is used for indicating the difference between the fifth data volume and the sixth data volume of the compressed second data, so that the computing device marks the corresponding virtual capacity in the virtual disk as unavailable according to the second information. It can be seen that dynamic management of excess storage capacity caused by changing compressed data stored in the memory is achieved, and data write failure or system crash caused by insufficient available storage capacity of the memory of the computing device is avoided.
In the embodiment of the application, the memory receives the third information sent by the computing device, that is, it is described that the computing device deletes the created virtual disk in advance, the memory migrates the data volume of the first physical space to the second physical space of the memory according to the third information, so that the data in the virtual disk to be deleted is migrated to a different physical space of the memory, and the physical space where the data is located after the data migration has no virtual disk and no virtual disk mapping with the physical space.
It should be noted that, after the migration of the data is completed by the memory according to the third information, if the virtual disk is deleted by the computing device, the first physical space in the memory does not have a virtual disk and a mapping thereof any more, and the first physical space is recovered as a local storage space of the memory. Therefore, dynamic management of the virtual disk is realized, and the operating efficiency of the system is improved.
Based on the second aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the solid state disk, and when the memory stores third data to the first physical space according to the write command, the method further includes: and sending fourth information to the computing equipment, wherein the fourth information is used for indicating the computing equipment to delete the virtual disk.
In some possible embodiments, in the case that the computing device has created the virtual disk, after the memory executes the write command, the memory may further store third data (compressed) into the first physical space mapped with the virtual disk, that is, the virtual disk is equivalent to the data stored in the virtual disk, and therefore, the memory needs to send fourth information to the computing device to inform the computing device how much virtual capacity in the virtual disk is occupied by the third data.
Based on the second aspect, in a possible embodiment, the fourth information is used to indicate an amount of data after the third data compression; the sending fourth information to the computing device to enable the computing device to delete the virtual disk includes: and fourth information is sent to the computing equipment, wherein the fourth information is used for indicating the computing equipment to delete the virtual disk according to the data volume indicated by the fourth information.
Based on the second aspect, in a possible embodiment, after sending the fourth information to the computing device, the method further comprises: and receiving fifth information from the computing equipment, and migrating the data of the first physical space to a second physical space of the solid state disk according to the fifth information.
In some possible embodiments, in a case that the virtual disk has been created by the computing device, since the compressed third data is stored in the first physical space mapped to the virtual disk after the memory executes the write command, when the computing device needs to delete the virtual disk, the memory migrates data in the virtual disk to be deleted from the first physical space according to the indication information (i.e., the fifth information) sent by the computing device.
In a third aspect, an embodiment of the present application provides an apparatus, which is applied to a computing device, where the apparatus includes: a sending unit, configured to send a write command and first data to a memory, where the write command is used to instruct the memory to write the first data; a receiving unit for receiving first information from the memory; and the processing unit is used for responding to the first information and creating a virtual disk for the memory.
Based on the third aspect, in a possible implementation, the first information is used to indicate a difference amount between a first data amount before the first data compression and a second data amount after the first data compression; the processing unit is specifically configured to: and creating the virtual disk for the memory according to the difference indicated by the first information.
Based on the third aspect, in a possible implementation, after the receiving the first information from the memory, the processor is further configured to: recording the difference amount indicated by the first information to a storage pool; the processor is specifically configured to: and when the storage pool reaches the preset storage capacity, creating a virtual disk for the storage.
Based on the third aspect, in a possible implementation, the sending unit is further configured to send a delete command or a change command to the memory, where the delete command is used to instruct the memory to delete target data, the change command is used to instruct the memory to change the target data, and the target data is part or all of the second data; the receiving unit is further used for receiving second information from the memory; the processing unit is further configured to respond to the second information and delete the virtual disk.
Based on the third aspect, in a possible implementation, the second information is used to indicate a difference amount caused before and after the deletion command or the change command is executed by the memory; the processing unit is further to: marking virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable; the processing unit is specifically configured to: and deleting the virtual disk according to the unavailable virtual capacity.
Based on the third aspect, in a possible implementation, the processing unit is specifically configured to delete the virtual disk when the unavailable virtual capacity reaches a disk deletion threshold, where the disk deletion threshold is less than or equal to the preset storage capacity.
Based on the third aspect, in a possible implementation, when the deletion command instructs the memory to delete the target data, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; or, when the change command instructs the memory to change the target data, the difference amount indicated by the second information is a difference amount between a fifth data amount obtained by compressing the changed second data and a sixth data amount obtained by compressing the second data.
Based on the third aspect, in a possible implementation, the virtual disk is mapped to a first physical space of the memory, the first physical space being used for storing data of a difference size between the fifth amount of data and the sixth amount of data; the sending unit is further configured to: sending third information to the memory, wherein the third information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
Based on the third aspect, in a possible implementation, the virtual disk is mapped to a first physical space of the memory, and the receiving unit is further configured to receive fourth information from the memory when third data is stored in the first physical space; the processing unit is specifically configured to: and deleting the virtual disk in response to the fourth information.
Based on the third aspect, in a possible implementation, the fourth information is used to indicate an amount of data after the third data compression; after said receiving the fourth information from the memory, the processing unit is further to: marking, in the virtual disk, a virtual capacity equal to the data amount indicated by the fourth information as unavailable; the processing unit is specifically configured to: and deleting the virtual disk according to the unavailable virtual capacity.
Based on the third aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the memory, and the first physical space stores the third data; before the deleting the virtual disk, the sending unit is further configured to: when the unavailable virtual capacity reaches a disk deletion threshold value, sending fifth information to the memory, wherein the fifth information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
In a fourth aspect, an embodiment of the present application provides an apparatus, which is applied to a memory, and the apparatus includes: a receiving unit configured to receive a write command and first data from a computing device; the processing unit is used for compressing and storing the first data; a sending unit, configured to send first information to the computing device, where the first information is used to instruct the computing device to create a virtual disk for the memory.
Based on the fourth aspect, in a possible embodiment, after the compressing and storing the first data, the processing unit is further configured to: marking the amount of difference caused before and after the first data is compressed as a reduced data amount; the processing unit is specifically configured to: and when the reduced data amount reaches a preset threshold value, sending first information to the computing device.
Based on the fourth aspect, in a possible embodiment, the first information is used to indicate an amount of difference between a first amount of data before the first data compression and a second amount of data after the first data compression; the sending unit is specifically configured to: sending the first information to the computing device, wherein the first information is used for instructing the computing device to create the virtual disk for the memory based on the difference quantity indicated by the first information.
Based on the fourth aspect, in a possible embodiment, the receiving unit is further configured to receive a delete command or a change command from the computing device; the processing unit is further configured to delete target data according to the deletion command or change the target data according to the change command, where the target data is part or all of second data; the sending unit is further configured to send second information to the computing device, where the second information is used to instruct the computing device to delete the virtual disk.
Based on the fourth aspect, in a possible embodiment, the second information is further used for indicating a difference amount caused before and after the deletion command or the change command is executed by the memory.
Based on the fourth aspect, in a possible embodiment, when the target data is deleted by the memory, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; or, when the target data is changed by the memory, the difference amount indicated by the second information is a difference amount between a fifth data amount obtained by compressing the changed second data and a sixth data amount obtained by compressing the second data.
Based on the fourth aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the memory, and the first physical space is used for storing data with a difference size between the fifth data amount and the sixth data amount; while the memory is altering the target data, the receiving unit is further to: receiving third information from the computing device; the processing unit is specifically configured to: and migrating the data of the first physical space to a second physical space of the memory according to the third information.
Based on the fourth aspect, in a possible embodiment, the virtual disk is mapped to a first physical space of the solid state disk, and when the memory stores third data in the first physical space according to the write command, the sending unit is further configured to send fourth information to the computing device, where the fourth information is used to instruct the computing device to delete the virtual disk.
Based on the fourth aspect, in a possible embodiment, the fourth information is used to indicate an amount of data after the third data compression; the sending unit is specifically configured to: and fourth information is sent to the computing equipment, wherein the fourth information is used for indicating the computing equipment to delete the virtual disk according to the data volume indicated by the fourth information.
Based on the fourth aspect, in a possible embodiment, the receiving unit is further configured to receive fifth information from the computing device after the fourth information is sent to the computing device; the processing unit is further configured to migrate the data in the first physical space to a second physical space of the solid state disk according to the fifth information.
In a fifth aspect, an embodiment of the present application provides an apparatus, which is applied to a computing device, where the apparatus includes: the device comprises at least one processor, a transmitter and a receiver, wherein the transmitter is used for transmitting a write command and first data to a memory, and the write command is used for instructing the memory to write the first data; the receiver is used for receiving first information from the memory; the processor is configured to create a virtual disk for the memory in response to the first information. The apparatus is configured to implement the method of the first aspect or any possible embodiment of the first aspect.
In a sixth aspect, an embodiment of the present application provides an apparatus, which is applied to a memory, and the apparatus includes: at least one processor, a transmitter, and a receiver, wherein the receiver is to receive a write command and first data from a computing device; the processor is used for compressing and storing the first data; the transmitter is configured to transmit first information to the computing device, where the first information is used to instruct the computing device to create a virtual disk for the memory. The apparatus is adapted to implement the method of the second aspect or any of the possible embodiments of the second aspect.
In a seventh aspect, this application embodiment provides a computer-readable storage medium storing program code for execution by an apparatus, where the program code includes instructions for performing the method in the first aspect or any possible implementation manner of the first aspect.
In an eighth aspect, the present application provides a computer-readable storage medium storing program code for execution by an apparatus, the program code including instructions for performing the method of the second aspect or any possible implementation manner of the second aspect.
In a ninth aspect, the present application provides a computer program software product comprising program instructions, which when executed by an apparatus, performs the method of the first aspect or any possible embodiment of the first aspect. The computer software product may be a software installation package, which, in case it is required to use the method provided by any of the possible designs of the first aspect described above, may be downloaded and executed on a device to implement the method of the first aspect or any of the possible embodiments of the first aspect.
In a tenth aspect, the present application provides a computer program software product comprising program instructions that, when executed by an apparatus, cause the apparatus to perform the method of the second aspect or any of the possible embodiments of the second aspect. The computer software product may be a software installation package which, in case the method provided using any of the possible designs of the second aspect described above is required, may be downloaded and executed on a device to implement the method of the second aspect or any of the possible embodiments of the second aspect.
It can be seen that, by implementing the embodiment of the present application, a memory integrated with a latest compression algorithm is used to execute a write command on data and execute other data operation instructions (e.g., change and delete commands) on the written data, and dynamic storage information caused by executing corresponding operations is reported to a computing device, so that dynamic management on redundant storage capacity caused by executing corresponding operations is realized through creation and deletion of a virtual disk in computing, the flexibility of regulation and control of a storage system is improved, under the condition that the performance of the storage system is not affected, data compression is realized and the highest data compression rate is reached, the available capacity of the system disk is indirectly improved, and thus the overall cost ratio of the storage system is optimized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a system architecture diagram of an application provided by an embodiment of the present application;
FIG. 2 is a flowchart of a method for increasing available storage capacity based on a write command according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a scenario applied to a write command according to an embodiment of the present application;
fig. 4 is a flowchart of a method for increasing available storage capacity based on a delete command according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a scenario applied to a delete command according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a further scenario applied to a delete command according to an embodiment of the present application;
FIG. 7 is a flowchart of a method for increasing available storage capacity based on a change command according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a scenario applied to a change command according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a further scenario applied to a change command according to an embodiment of the present application;
FIG. 10 is a flowchart of a method applied to a read command according to an embodiment of the present application;
FIG. 11 is a schematic diagram of an apparatus according to an embodiment of the present disclosure;
FIG. 12 is a functional block diagram of another apparatus provided in an embodiment of the present application;
FIG. 13 is a schematic diagram of an apparatus according to an embodiment of the present disclosure;
fig. 14 is a functional structure diagram of another apparatus provided in the embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The terms "first", "second", and the like in the description and in the claims in the embodiments of the present application are used for distinguishing different objects, and are not used for describing a particular order. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
For the sake of understanding, the following description will be made about terms and the like that may be referred to in the embodiments of the present application.
(1) Mechanical hard disk
A Hard Disk (HDD) is a conventional general Hard Disk, and a magnetic Disk is used as a storage medium, and generally includes a Disk and a magnetic head, where the magnetic head can move along the radial direction of the Disk, and the Disk rotates at a high speed of several thousand revolutions per minute, and the magnetic head can be positioned at a specific position on the Disk for data reading and writing. When the device works, vibration and sensible noise are generated, the bearable temperature range is small, and the hard disk is easy to damage when the device is used in movement or vibration. However, the mechanical hard disk has a long service life due to high read/write times and is easy to be made into a large capacity.
(2) Solid state disk
Solid State Drive (SSD), a hard disk generally composed of a memory and a controller, has a fast read/write speed, high efficiency, no noise and strong shock resistance during operation, has a low power consumption standby function, and can bear a larger temperature range than a mechanical hard disk. But compared with a mechanical hard disk, the hard disk has small capacity, high unit cost and relatively short service life due to the limitation of reading and writing times.
The Solid State Disk (SSD) may be divided into two types, one type is a Dynamic Random Access Memory (DRAM), a DRAM chip is used as a storage medium for storing temporary data for program operation, the solid state disk based on the DRAM chip can be volume-set and managed by a file system tool of most operating systems, and industry standard PCI and FC interfaces are provided for connecting a host or a server, but an independent power supply is required to protect data security; the other type is a FLASH memory (FLASH), which adopts a FLASH chip as a storage medium, wherein the FLASH chip can be divided into a NOR type and a NAND type, wherein NOR type storage contents are mainly coded, and most functions of the NOR type storage contents are related to operation; the NAND flash memory has a large capacity and a high erasing speed, and is suitable for data storage, for example, data storage. It should be noted that the Flash chip belongs to a nonvolatile memory, that is, data stored after power failure is not lost. The DRAM chip is used for storing temporary data of program operation and belongs to a volatile memory.
Taking NAND-Flash as an example of a storage medium, there are generally a plurality of NAND-Flash in an SSD, each of which contains a plurality of blocks (blocks), and each of which contains a plurality of pages (pages). Due to the nature of NAND, access data must be in pages, i.e., at least one Page per read or write. Typically, each Page is 4K or 8K in size. Another characteristic of NAND is that only a single Page can be read and written, and no overwriting of data is supported, i.e., the write operation can only be performed in free or erased cells.
(3) Storage pool
The storage pool is an efficient storage management mechanism of the application program, and has the advantages of high allocation efficiency, low management overhead, capability of eliminating hidden memory leakage hazards and the like. The allocation and management of the memory space is implemented by the operating system or the compiler. Taking an operating system as an example, the operating system marks out a large area (called a heap) with continuous block addresses in the storage space for the memory allocation function (such as malloc, free, etc.) of the system to use. The traditional malloc/free storage allocation method is easy to cause fragmentation of a heap area, a large number of free spaces may exist in the heap area, and the free spaces are dispersed and discontinuous, so that large allocation blocks cannot be accommodated in a combined mode.
The storage pool is a space for containing variables distributed by the storage pool by taking a Block (Block) as a unit, namely the storage pool is equivalent to an available space table established by a system, scattered idle blocks in the storage space are integrated in a linked list with continuous addresses, each idle Block is a node in the linked list, if the idle blocks need to be distributed, a proper node is found from the linked list for distribution, and the node is deleted after the distribution is successful; if a new idle block appears, the idle block is inserted into the linked list, so that management of the idle storage capacity space is realized, and the problem of space waste caused by idle space dispersion is effectively solved.
At present, compared with a mechanical hard disk, a solid state hard disk is more excellent in read/write speed, power consumption, shock resistance, occupied volume and the like, and therefore, in a storage application scenario with higher requirements on performance and reliability of the hard disk, such as finance, a core database and the like, the solid state hard disk has gradually started to replace a traditional mechanical hard disk to serve as a main memory of data. However, the solid state disk is limited in a wide range of applications due to the defects of small storage capacity, high unit capacity cost and the like of the solid state disk, so that only high-end application scenes use the solid state disk at present. Therefore, the storage space of the data can be reduced by means of data compression, and the effect of increasing the storage capacity of the solid state disk is indirectly achieved, so that the unit capacity cost of the solid state disk is reduced.
The existing storage system mainly includes four data compression methods, which are Central Processing Unit (CPU) online compression, hardware acceleration engine online compression, CPU offline compression, and SSD internal compression only. The difference between the two methods is that the CPU on-line compression and the hardware acceleration engine on-line compression finish the compression and decompression of data by the CPU executing a compression algorithm, which occupies the system computing resources and affects the overall performance of the system, while the hardware acceleration engine on-line compression finish the compression and decompression of data by the hardware acceleration engine (for example, an ASIC chip) executing a compression algorithm, which does not occupy the system computing resources and affect the performance of the system, but cannot achieve the optimal data compression ratio because the compression algorithm integrated in the hardware cannot be updated to the existing optimal algorithm in time due to the long process time of the hardware acceleration engine. The CPU offline compression means that data are stored in a storage medium firstly, then the data compression module reads the data from the storage medium again for compression, and finally the compressed data are stored in the storage medium again, and the data compression module runs on the CPU, so that not only is the computing resource occupied to influence the system performance, but also the read-write times of the SSD are increased, and the service life of the SSD is shortened.
The following pure SSD internal compression is specified here: because the Firmware inside the SSD is newly added with the functions of compression and decompression, the Firmware of the SSD hard disk reports more parts of virtual storage space to the system according to experience during initialization, and compresses the data and stores the compressed data into a storage medium after the data is written into the SSD. In the method, a compression algorithm is executed by Firmware, the performance of a system is not influenced, but because the virtual storage space is reported according to experience and is only reported once during initialization, the expandability is poor and cannot be changed, the multi-reported storage space cannot be used easily, and the system is abnormal or part of the storage space is wasted. For example, assuming that the actual capacity of the SSD is 1T, the compression rate of the SSD may reach 50%, and the SSD reports its own storage capacity to the system according to experience as 2T (i.e. reports more virtual storage space of 1T), so the system considers that the storage capacity of the SSD is 2T, when the write data input by the system is already compressed data (cannot be compressed for the second time) or the write data is data with low compressibility, the data write failure may be caused or the virtual storage space reported by the SSD cannot be used.
In summary, the conventional method for reducing the unit capacity cost of the SSD through the data compression method cannot simultaneously solve the problem that the optimal compression rate of the data is achieved without affecting the performance of the system, and cannot reduce the unit capacity cost of the SSD to the maximum extent without affecting the performance of the system, thereby indirectly increasing the storage capacity of the SSD.
The system architecture applied in the embodiments of the present application is described below, and the system applied in the present application includes a computing device and a memory, where the memory may exist independently of the computing device or may be integrated inside the computing device, and the present application is not limited specifically. The storage is a general term including a solid state disk SSD, a mechanical hard disk HDD, a virtual disk, or other disks capable of storing data. The memory has the functions of compression and decompression and information transceiving, and can realize the communication between the memory and the computing device. The memory is not exemplified by a solid state disk, but the application does not limit the type of the memory in the system architecture to be a solid state disk, and all memories with compression function and transceiving function can be applied to the system disclosed in the embodiment of the application.
Referring to fig. 1, fig. 1 is a block diagram of a system provided in an embodiment of the present application, where the system includes a computing device 10 and a solid state disk 20, where the solid state disk 20 may exist independently of the computing device 10, and the solid state disk 20 may also be integrated in the computing device 10, and the embodiment of the present application is not particularly limited, and the solid state disk 20 is connected to the computing device 10 in a wired or wireless manner for communication. The computing device 10 may issue an operation command, such as a read command, a write command, a change command, or a delete command, to the solid state disk 20, and may also perform data interaction with the solid state disk, such as reading data in the solid state disk, writing data to the solid state disk, receiving available capacity change information from the solid state disk, and the like.
The computing device 20 at least includes storage software, an SSD drive, a compression middleware, and a compression drive, where the storage software, the SSD drive, the compression middleware, and the compression drive are all run on a processor of the computing device 10, the storage software is used to establish a file for a user and control writing, reading, modifying, deleting, and the like of the file, the SSD drive is used to implement communication between the computing device and the solid state disk, the compression middleware is used to manage a storage pool and create and delete a virtual disk, and the compression drive is used as an information transfer interface between the solid state disk and the compression middleware.
In one implementation, the compression middleware may be a software function running on a hardware chip of the computing device processor. In another implementation, the compression middleware may be a hardware chip integrated with the processor of the computing device in the form of a hardware circuit.
The solid state disk 20 at least includes an SSD controller in which a compression Firmware (Firmware) is run, the compression Firmware (Firmware) is used for executing specific data compression and/or decompression operations and reporting related capacity information after compression/decompression, and a storage medium for storing data compressed by the compression Firmware (Firmware). The storage medium may be a plurality of memories, each of which may in turn be referred to as a Flash granule or a NAND Flash or DIE or a LUN or a PU or a NAND memory or a NAND device (NAND device), etc. The SSD controller may implement operations such as command issuing, data storage, reading, changing, and deleting on the storage medium through an Input/Output (IO) channel.
In one implementation, the compressed Firmware (Firmware) may be a software function running on a hardware chip of the SSD controller. In another implementation, the compressed Firmware (Firmware) may be integrated in the form of a hardware circuit on a hardware chip of the SSD controller.
The SSD controller may include, for example, one or more processors, e.g., Central Processing Units (CPUs), which may be integrated on the same hardware chip.
In general, data is stored in flash memory granules according to a fixed address mapping relationship, which refers to a mapping relationship (Map) of logical addresses to physical addresses. And storing the data in the solid state disk according to the physical address. And when the computing equipment indicates the solid state disk to perform writing/reading/changing/deleting operation, the computing equipment sends a writing/reading/changing/deleting command to the solid state disk, wherein the writing/reading/changing/deleting command carries the logic address of corresponding data.
The SSD controller is provided with a Flash Translation Layer (FTL) module, which is used to complete the Translation from the logical address of the computing device to the physical address of the solid state disk. The solid state disk records the mapping relation from the logical address to the physical address of the data every time the data is written into the storage medium, so that after the solid state disk receives a read/change/delete operation command sent by the computing device, the logical address of the data is resolved into the physical address according to the fixed address mapping relation, and then the position of the data is searched in the storage medium.
In one implementation, the FTL module may be a software function running on a hardware chip of the SSD controller. In another implementation, the FTL module may also be integrated in the form of a hardware circuit on a hardware chip of the SSD controller.
For the computing device 20, on one hand, the computing device 20 is configured to execute a system service, that is, the storage software is configured to send a data operation command (e.g., a write command, a read command/change command, a delete command, and the like) and write data or a logical address of corresponding data to the solid state disk 10 through the SSD drive, and the storage software is further configured to receive a result returned after the solid state disk completes the data operation command; on the other hand, the computing device 20 is configured to manage the available storage capacity of the system, that is, the storage software receives the available capacity change information of the solid state disk 20 reported by the compression middleware and manages the available capacity of the system according to the information, where the available capacity change information is reported to the compression driver by the compression Firmware (Firmware) of the solid state disk 20 and is transmitted to the compression middleware via the compression driver.
For the solid state disk 20, a compression algorithm is integrated in the compression Firmware (Firmware), and the main functions of the compression Firmware (Firmware) are to perform data compression and/or decompression operations and to report dynamically stored information to the computing device 10 after compression/decompression. Specifically, the compression Firmware (Firmware) performs corresponding operations according to the data operation commands sent by the computing device 20, counts the changes of the available capacity before and after the operations, and reports the changes to the compression middleware via the compression driver of the computing device 20. The compressed Firmware (Firmware) may also store compressed data in a storage medium. It should be noted that the compression algorithm of the compression Firmware (Firmware) can be updated in time according to the data traffic and industry algorithms to maintain the optimal data compression rate. The storage medium can be a DRAM chip or a FLASH chip. The FLASH chip can be further classified into NOR type and NAND type, and the related description of the storage medium can refer to the related description of the storage medium in the solid state disk, and for brevity of the description, the description is not repeated herein.
In the embodiment of the application, the compression and decompression of the data are completed in the solid state disk, the computing power of computing equipment is not consumed, and the decoupling of the compression and decompression processing and system services (writing, reading, changing, deleting and the like) is realized, so that the performance of the system is not influenced. In addition, the compression algorithm adopted in the solid state disk can be updated in time according to business requirements to achieve the highest compression ratio of data, so that the unit capacity cost of the solid state disk is greatly reduced, and the available storage capacity of the system is indirectly improved. In addition, the solid state disk can report to the system in time when the capacity changes, and dynamic management of the system on the available capacity of the disk is achieved.
Based on the above-described system architecture, the following description of the method for increasing available storage capacity will be given by taking a write command, a delete command, a change command, and a read command as examples.
For the sake of convenience, the method embodiments described below are all expressed as a combination of a series of action steps, but those skilled in the art should understand that the specific implementation of the technical solution of the present application is not limited by the order of the series of action steps described.
It should be noted that, in the following description of the embodiments in fig. 2, fig. 4, fig. 7, and fig. 10, the memory does not take a solid state disk as an example to perform an exemplary description of the scheme, but the present application does not limit the type of the memory to a solid state disk, and all the memories having a compression function and a transceiving function can implement the scheme disclosed in the embodiments of the present application.
First, taking a write command as an example, referring to fig. 2, fig. 2 is a flowchart of a method for increasing available storage capacity according to an embodiment of the present application. The method includes, but is not limited to, the steps of:
s101, the computing equipment sends a write command and first data to the solid state disk.
In the embodiment of the application, the computing device sends a write command and first data to the solid state disk, and the write command indicates the solid state disk to write the first data. The first data may be text, programs, images, media files (e.g., MP3, high definition movies, etc.), and the like.
It should be noted that, the storage of data in the storage medium of the solid state disk is often based on a fixed address mapping relationship, which refers to a mapping relationship between a logical address and a physical address. And storing the data in the solid state disk according to the physical address. Therefore, the write command also carries a logical address of the first data, so that the solid state disk establishes a physical address corresponding to the logical address when the solid state disk stores the first data.
In an embodiment of the application, when the data volume of the data to be written is small, the computing device may send the write command and the first data to the solid state disk only once. In some possible embodiments, if the data volume of the data to be written is large, the data to be written may be divided into multiple groups of first data, and the computing device may send a multiple write command and the first data to the solid state disk.
In one embodiment of the application, when the computing device sends the write command and the first data to the solid state disk for multiple times, each sending of the computing device may include both the write command and the first data. In some possible embodiments, the computing device may further send a write command to the solid state disk first, and then send the first data to the solid state disk multiple times.
It should be noted that the write command and the first data may be sent together and simultaneously, and in some possible embodiments, the write command and the first data may be sent separately, and the embodiments of the present application are not limited specifically.
S102, the solid state disk receives the write command and the first data, compresses the first data, and stores the compressed first data.
In the embodiment of the application, after receiving the write command and the first data from the computing device, the solid state disk writes the first data according to the write command. Because the solid state disk has a compression function, the writing process of the first data in the solid state disk refers to: the solid state disk compresses the first data by using an internal compression algorithm and stores the compressed first data. It is easy to understand that the second data volume of the first data after being compressed by the solid state disk is less than or equal to the first data volume before being compressed by the first data. It should be noted that the write command also carries a logical address corresponding to the first data. The solid state disk completes the process of writing data once according to the write command, which can also be called as the solid state disk executing write operation once.
Specifically, the writing process of the first data in the solid state disk is as follows: the solid state disk firstly puts the received first data into a cache of the solid state disk, compresses the first data by using a compression algorithm, determines a physical address according to the storage capacity of the compressed first data, records the mapping relation between the logical address and the physical address, and finally stores the compressed first data into a physical space corresponding to the physical address, so that the solid state disk completes the compression of the first data.
It should be noted that the first data may be compressible data, such as: text, characters, images, etc., the first data may also be non-compressible data, such as: MP3, high definition movies, compressed data, etc. For compressible data, the data volume (or occupied storage capacity) of the data after compression is reduced, and for incompressible data, the data volume (or occupied storage capacity) of the data before and after compression is not changed, that is, the data volume of the data before compression is equal to the data volume of the data after compression.
The compressed data is non-compressible data, in other words, the compressed data cannot be compressed again. This is because the essence of the compression is an imbalance in the distribution of the specific characters, with optimization in length being achieved by assigning short codes to high frequency characters, while long codes correspond to low frequency characters. After data is compressed once, the distribution of characters is averaged, and further compression is difficult. Therefore, the data that has been compressed is incompressible data.
Data compression is a technical method for reducing the data volume to reduce the storage space and improve the transmission, storage and processing efficiency of the data without losing information. Or reorganize the data according to a certain algorithm, and reduce the redundancy and storage space of the data. The process of representing information in fewer data bits (or other information-related units) than uncoded according to a particular coding scheme. For example, if we encode "compression" as "comp," the "compression" can be represented by fewer data bits. In fact, almost all data (including operating systems, applications, games, etc.) can be compressed to varying degrees, except that data that does not contain distinguishable patterns (e.g., multimedia audio and video files such as MP3, high-definition movies, etc.) cannot be compressed by any compression algorithm.
The compressibility of the data models corresponding to different data is different, for example, for a database application model, the compressibility of the data is 8%, that is, the data can be compressed to 8% of the original volume, that is, 92% cannot be compressed; for the application program model, the compressibility of the data is 46%, that is, the data can be compressed to 46% of the original volume. The greater the compressibility of the data model is, the higher the compressibility of the data is, and for the same data volume, the greater the compressibility of the data is, the smaller the storage capacity of the compressed data is.
Illustratively, the compression algorithm integrated within the solid state disk may be huffman coding, which is applicable to compression of images, text, and characters. The principle of the Huffman coding is that a Huffman binary tree is constructed by using the occurrence times of data, the data with more occurrence times is arranged at the upper layer of the tree, the data with less occurrence times is arranged at the lower layer of the tree, and the coding can be carried out from a root node to each data path to realize the compression. It can be simply understood that the higher the frequency with which a symbol appears, the shorter the length of the binary code after the symbol is replaced.
Illustratively, the compression algorithm integrated in the solid state disk may be run-length encoding (RLE), also called run-length encoding or run-length encoding, which is applicable to compression of images, and has the principle that a symbol value or a string length is used instead of consecutive symbols having the same value, so that the symbol length is smaller than the length of original data. And only when the codes of the data in each row or each column are changed, the codes and the repeated number of the same codes are recorded once, so that the data compression is realized.
It should be noted that the compression algorithm integrated in the solid state disk may also be LZW compression, LZ77 algorithm, or any other compression algorithm with a higher compression rate, and the compression algorithm in the solid state disk may also be updated in time according to the data type and the industry compression algorithm to achieve the optimal data compression rate, which is not limited in this embodiment.
S103, calculating the difference between the first data volume before the first data compression and the second data volume after the first data compression by the solid state disk.
In the embodiment of the application, because the solid state disk has a compression function, after a write operation, the second data volume after the first data compression is less than or equal to the first data volume before the first data compression, that is, the storage capacity occupied by the first data in the solid state disk after the first data compression is reduced, which indirectly indicates that the available storage capacity of the solid state disk is increased, and the difference value between the first data volume and the second data volume is calculated, and the difference value also represents the reduced data volume of the first data after the first data compression.
For example, the computing device writes the first data into the solid state disk, assuming that the current available storage capacity of the solid state disk is 100G, the data size of the first data before compression is 10G, and assuming that the data size of the first data after compression by the solid state disk is reduced to 6G. For the solid state disk, if the solid state disk does not have the compression function, the data written in the solid state disk consumes 10G of storage capacity, but because the solid state disk has the compression function, the data written in the solid state disk only consumes 6G of storage capacity, and the remaining available storage capacity of the solid state disk is 94G, which is equivalent to that after the first data of 10G is compressed by the solid state disk, the available storage capacity of the solid state disk is saved by 4G.
S104, the solid state disk sends first information to the computing equipment.
In this embodiment of the application, after the write operation, a second data amount of the first data after being compressed by the solid state disk is less than or equal to a first data amount before being compressed by the first data, and after the solid state disk obtains a data amount (or saved available storage capacity) reduced after the first data is compressed, the solid state disk sends first information to the computing device, where the first information is used to indicate a difference between the first data amount before being compressed by the first data and the second data amount after being compressed by the first data, and the difference may also represent the data amount reduced after being compressed by the solid state disk.
In an embodiment of the application, each time the solid state disk writes first data, the solid state disk sends first information to the computing device once, where the first information represents a difference between a first data amount of the written first data before compression and a second data amount of the first data after compression by the solid state disk.
In an embodiment of the present application, the solid state disk sends, to the computing device, the first information that needs to meet a set trigger condition, for example, a difference between a first data amount before the first data compression and a second data amount after the first data compression is greater than or equal to a preset threshold, where the preset threshold is, for example, 2G, 5G, 6G, 10G, or another value, which is not specifically limited in the embodiment of the present application. That is, if the data amount of the first data written in the last time, which is reduced after being compressed by the solid state disk, is smaller than the preset threshold, the first data amount is inconsistent with the second data amount after the last write operation, but the solid state disk does not send the first information to the computing device because the solid state disk does not reach the trigger condition, the difference amount caused by the last write operation may be marked as the reduced data amount, when the reduced data amount (i.e., the sum of the difference amounts accumulated by the multiple write operations) is greater than or equal to the preset threshold, the solid state disk sends the first information to the computing device, the first information represents the difference amount between the first data amount of the first data written in the first time before being compressed and the second data amount of the first data written in the first time after being compressed by the solid state disk, and the first data is the sum of the data written in the multiple write operations. In some possible embodiments, the difference between the first data amount before the first data compression and the second data amount after the first data compression, which is characterized by the first information, may be a set fixed value.
For example, in a case that the solid state disk sends the first information to the computing device, the set trigger condition has to be met, an amount of difference between a first data amount before the first data compression and a second data amount after the first data compression, which are characterized in the first information, may be dynamic, for example: the preset threshold value is 10G, and after the write operation is performed for the time, the difference amount is 12G, and the difference amount indicated by the first information is 12G; if the difference amount after the write operation is 15G, the difference amount indicated by the first information is 15G. Of course, the amount of difference indicated by the first information may be a fixed numerical value, for example: the preset threshold is 10G, and the difference amount after the write operation is 12G, the difference amount indicated by the first information may be 10G, and the difference amount caused by the remaining 2G and the subsequent write operation is accumulated, and after 10G, the first information is sent to the computing device to report 10G. In some possible embodiments, the difference in the first information may also be an indication bit representing a specific numerical value, and the indication bit may be a number or a character, for example, a number, that is, an indication bit of "1" represents a difference of 10G.
It should be noted that the trigger condition for the solid-state device to send the first information to the computing device may be set or not, and the embodiment of the present application is not specifically limited.
S105, the computing device records the difference quantity indicated by the first information to the storage pool.
In the embodiment of the application, the computing device receives first information from the solid state disk, the first information indicates a difference between a first data volume before first data compression and a second data volume after the first data compression, and the computing device establishes a management mapping for a storage capacity equal to the difference indicated by the first information. It should be noted that the storage capacity indicated by the first information and having the same difference amount is a free, available virtual capacity, and the virtual capacity is mapped in the solid state disk.
It should be noted that, by managing virtual capacities equal to the difference indicated by the first information in the form of storage pools, it is possible to integrate distributed free storage spaces in the form of address continuation, thereby avoiding space waste caused by the distributed free storage spaces.
It should be noted that after the difference indicated by the first information is recorded in the storage pool, it is determined whether the current storage pool reaches the preset storage capacity, and if the current storage pool does not reach the preset storage capacity, the next time of receiving the first information from the solid state disk is waited to receive, and the difference indicated by the first information is recorded in the storage pool; if the preset storage capacity is reached, S106 is executed. The preset storage capacity is greater than or equal to the preset threshold in S104 (in the case that there is a trigger condition for sending the first information in S104), and the preset storage capacity is, for example, 30G, 50G, 100G or another value, which is not specifically limited in the embodiment of the present application.
In one implementation, in conjunction with the system architecture shown in the embodiment of fig. 1, the compression middleware in the computing device receives first information from a compression Firmware (Firmware) of the solid state disk, and records a disparity amount indicated by the first information into the storage pool. Assuming that the preset storage capacity is set to 50G, the storage pool is accumulated from 0, and every time the first information from the solid state disk is received, the difference amount indicated by the first information is added or recorded to the storage pool, and the step is executed in a loop until the storage pool reaches the preset storage capacity.
For example, the preset storage capacity is set to 50G, after the first write operation, the computing device receives the first information indicating the difference amount of 10G sent by the solid state disk, and records the first information to the storage pool, so that the capacity of the storage pool is 10G, and after the second write operation, the computing device receives the first information indicating the difference amount of 5G, records the first information to the storage pool, so that the capacity of the storage pool becomes 15G, and the process loops until the storage pool reaches the preset storage capacity, and S106 is executed.
And S106, when the storage pool reaches the preset storage capacity, the computing device creates a virtual disk for the solid state disk.
In the embodiment of the application, after receiving first information from a solid state disk, a computing device records a difference indicated by the first information to a storage pool, and when the storage pool reaches a preset storage capacity, a virtual disk is created for the solid state disk. In one embodiment, the capacity of the created virtual disk is a preset storage capacity. The preset storage capacity is, for example, 30G, 50G, 100G or other values, and the embodiment of the present application is not particularly limited.
It should be noted that, when the storage pool reaches the preset storage capacity, creating the virtual disk may be: the initial capacity of the storage pool is 0, the difference indicated by the first information received at a certain time is greater than or equal to the preset storage capacity, and after the difference indicated by the first information is recorded in the storage pool at the certain time, the computing device can create a virtual disk, wherein the capacity of the virtual disk is the preset storage capacity, and the part exceeding the preset storage capacity can be used for accumulating the next preset storage capacity in the storage pool; in some possible embodiments, the first information may indicate that the difference amount is smaller than the preset storage capacity, the first information may be accumulated in the storage pool, and the computing device may create a virtual disk when the sum of the difference amounts indicated by the first information accumulated in the storage pool reaches the preset storage capacity.
For example, assuming that the preset storage capacity is 50G, the computing device records the difference indicated by the first information into the storage pool after receiving the first information, assuming that the capacity of the storage pool after multiple times of recording is 45G, at this time, the computing device receives the first information indicating the difference of 10G sent by the solid state disk, and the computing device records the first information into the storage pool, then the capacity of the storage pool is 55G, the current storage pool has reached the preset storage capacity of 50G, the computing device creates a virtual disk for the solid state disk, and the capacity of the virtual disk becomes 50G, and at the same time, the computing device increases the available storage capacity of the recorded solid state disk by 50G. After the virtual disk is created, the capacity of the storage pool is changed to 5G, and the difference indicated by the first information is waited to be recorded next time. It is simply understood that each time the storage pool reaches the preset storage capacity, the computing device creates a virtual disk, and the capacity of the virtual disk is the preset storage capacity.
Specifically, when the storage pool reaches a preset storage capacity, the computing device creates a virtual disk for the solid state disk, and the capacity (or referred to as virtual capacity) of the created virtual disk is the preset storage capacity. Note that the preset storage capacity is equal to or greater than the preset threshold in S104 (in the case where there is a trigger condition for the transmission of the first information in S104).
It should be noted that the virtual disk is mapped in the first physical space of the solid state disk. After the write operation, the solid state disk obtains a reduced data volume of the first data after compression, first information indicating the reduced data volume is reported to the computing device, and a physical space (namely, a first physical space) in the solid state disk corresponding to the reduced data volume is used as a mapping of a virtual disk created by the computing device.
In a specific implementation, with reference to the system architecture shown in fig. 1, a compression middleware of a computing device receives first information from a solid state disk, records a difference amount indicated by the first information to a storage pool, when the storage pool reaches a preset storage capacity, the compression middleware of the computing device creates a virtual disk, and reports the created virtual disk to storage software of the computing device, where the storage software then adds the capacity of the virtual disk to the recorded available storage capacity of the solid state disk, that is, adds a first preset storage capacity to the recorded available storage capacity of the solid state disk. It should be noted that what the compression middleware reports to the storage software may be a specific numerical value corresponding to the preset storage capacity, for example, "50G," and may also be an indication bit indicating the preset storage capacity, where the indication bit may be a number or a character, and for example, the number is taken as an example, the indication bit is "1," and the representation preset storage capacity is 50G.
In some possible embodiments, the creating condition of the virtual disk may not be limited, for example, each time the computing device receives the first information, and after recording the difference amount indicated by the first information to the storage pool, the computing device creates a virtual disk with a capacity equal to the difference amount indicated by the first information at the time.
In some possible embodiments, after the computing device creates the virtual disk, the computing device issues a write command to the solid state disk, and if the solid state disk stores third data to the virtual disk after executing the write command, the computing device receives fourth information sent by the solid state disk in addition to the first information sent by the solid state disk, where the fourth information indicates a data volume after compression of the third data, and the computing device marks, in the virtual disk, a virtual capacity equal to the data volume indicated by the fourth information as unavailable. Since the virtual disk is mapped in the first physical space of the solid state disk, in this case, the solid state disk stores the compressed third data in the first physical space mapped with the virtual disk, but not in other physical spaces in the solid state disk without virtual disk mapping. When the virtual capacity marked as unavailable due to the write operation in the virtual disk reaches a disk deletion threshold value, the computing device sends fifth information to the solid state disk, the fifth information is used for indicating the solid state disk to migrate data in the first physical space to a second physical space of the solid state disk, the second physical space has no virtual disk mapped with the second physical space, after the data migration is completed, the computing device deletes the created virtual disk, and meanwhile, the computing device reduces the capacity of the virtual disk on the recorded available storage capacity of the solid state disk, namely, reduces the preset storage capacity. It should be noted that the delete disc threshold is less than or equal to the preset storage capacity.
By implementing the embodiment of the application, the solid state disk reports the data compression change information caused by the data compression to the computing device after executing the write operation, so that the computing device can realize the capacity expansion operation of the available storage capacity of the solid state disk by creating the virtual disk, the available storage capacity of the solid state disk is indirectly improved, and the unit capacity cost of the solid state disk is reduced. In addition, the write operation service issued by the computing equipment is decoupled from the compression process of the data in the solid state disk, so that the performance of a system where the computing equipment is located is not influenced while the high compression rate is achieved.
Referring to fig. 3, the method of the embodiment of fig. 2 is described in some specific application scenarios.
As shown in fig. 3, it is assumed that the available storage capacity of the solid state disk B recorded by the computing device a before any operation is not performed is equal to the actual available storage capacity of the solid state disk B, and is 100G. The preset storage capacity set by the computing device a is 8G, the computing device a indicates that the solid state disk B performs a first write operation (label 1), the data volume of first data sent to the solid state disk B by the computing device a is 10G, the solid state disk B stores the compressed first data, the data volume of the compressed first data is 6G, the solid state disk B reports first information indicating a 4G difference to a compression middleware of the computing device, a physical space where the 4G is located is referred to as a first physical space, the computing device records the difference indicated by the first information to a storage pool, and the capacity of the storage pool is changed to be 4G smaller than the preset storage capacity (assuming that the computing device is set to be 8G); assuming that the computing device a instructs the solid state disk B to execute the write operation again, the data volume of the first data is 10G, the solid state disk B stores the compressed first data, the data volume of the compressed first data is 6G, the solid state disk B reports first information indicating a difference of 4G to a compression middleware of the computing device, the storage pool reaches a preset storage capacity of 8G after the difference indicated by the first information is recorded, at this time, the computing device creates a virtual disk with a capacity of 8G for the solid state disk, and the virtual disk is mapped in a first physical space of the solid state disk. As shown in fig. 3, after two write operations, the available storage capacity of the solid state disk B becomes 88G, and the available storage capacity of the solid state disk B recorded by the computing device a is also 88G.
Before the virtual disk is not created in the computing device, after the solid state disk executes the write operation, the compressed first data is stored in a physical space without virtual disk mapping in the solid state disk. After the virtual disk is created by the computing device, the solid state disk executes write operation, and the solid state disk may store the compressed first data in a physical space in the solid state disk, which is not mapped by the virtual disk, or store the compressed first data in a physical space in the solid state disk, which is mapped by the virtual disk.
It should be noted that, when the computing device stores the compressed first data in the physical space mapped to the virtual disk in the solid state disk, the solid state disk further sends fifth information indicating a second amount of compressed first data to the computing device, so that the computing device marks, in the virtual disk, a virtual capacity equal to the amount of data indicated by the fifth information as unavailable.
The following further describes a method for increasing available storage capacity, which is provided by the embodiment of the present application, by taking a delete operation as an example. Referring to fig. 4, fig. 4 is a flowchart of a method for increasing available storage capacity applied to a delete command according to an embodiment of the present application. The embodiment of fig. 4 is complementary to the embodiment of fig. 2. The method includes, but is not limited to, the steps of:
s201, the computing equipment sends a deleting command to the solid state disk.
In the embodiment of the application, the computing device sends a deletion command to the solid state disk, wherein the deletion command is used for instructing the solid state disk to delete target data, and the target data is part or all of the second data. It should be noted that the delete command also carries a logical address corresponding to the write data. The second data is data stored in the solid state disk.
It is easy to understand that if the computing device instructs the solid state disk to delete the target data, the target data must have been written to the solid state disk before. Therefore, the sending of the delete command to the solid state disk by the computing device is that the delete command sent to the solid state disk by the computing device is only valid after the solid state disk executes the write command in the embodiment of fig. 2, that is, after data is written in the solid state disk.
S202, the solid state disk receives the deleting command and deletes the target data.
In the embodiment of the application, the solid state disk receives a deletion command from the computing device, the deletion command instructs the solid state disk to delete target data, the target data is a physical address corresponding to part or all of second data found in a mapping table of the solid state disk according to a logical address carried in the deletion command, and subsequent deletion operation is performed on the second data stored in a storage space corresponding to the physical address.
In an embodiment of the application, the solid state disk deletes all the second data according to the deletion command, and the solid state disk finds the second data (compressed) in the storage medium and directly deletes the second data.
In an embodiment of the application, the solid state disk deletes part of the second data according to the deletion command, and then the solid state disk finds the second data (compressed) in the storage medium, decompresses the compressed second data, and deletes the target data.
It should be noted that, if part of the second data is deleted, after the deletion operation is completed, the solid state disk updates, in its own mapping table, the physical address corresponding to the logical address of the second data, that is, the physical address of the remaining compressed data; if all the data of the second data are deleted, after the deletion operation is completed, the solid state disk deletes the set of mapping relations corresponding to the logical address of the second data from the mapping table.
S203, the solid state disk calculates the difference between the third data volume before the target data compression and the fourth data volume after the target data compression.
In the embodiment of the application, after the solid state disk completes the deletion operation of the target data, the solid state disk calculates and calculates the difference between the third data volume before the target data is compressed and the fourth data volume after the target data is compressed. It should be noted that the fourth data amount after the target data compression is a difference between the data amount after the second data compression and the data amount of the remaining compressed data, and the remaining compressed data is obtained by compressing data remaining after deleting part or all of the second data.
For example, when the target data is written, the data size before the target data is compressed is 10G, and the data size after the target data is compressed is 6G, that is, after the target data is written in the solid state disk, the target data only occupies the storage space of 6G, but the target data represents the data information of 10G. At the moment, the solid state disk deletes the target data, and the difference caused before and after the deletion operation is calculated and is changed to 4G.
And S204, the solid state disk sends second information to the computing equipment.
In this embodiment of the application, after the solid state disk executes the delete command, the solid state disk sends second information to the computing device, and in a case that the delete command is executed, the second information is feedback information sent to the computing device after the delete command is executed on the solid state disk, and the second information indicates a difference amount caused before and after the solid state disk executes the delete command, specifically, the second information is used to indicate a difference amount between a third data amount before target data compression and a fourth data amount after the target data compression, and the third data amount is greater than the fourth data amount.
In one implementation of the application, after the solid state disk executes the deletion command each time, the solid state disk sends second information to the computing device once, where the second information indicates a difference between the third data volume and the fourth data volume under the deletion command.
In one implementation of the present application, the solid state disk sends the second information to the computing device, where the second information needs to meet a set trigger condition, for example: the difference between the third amount of data and the fourth amount of data is greater than or equal to a preset threshold (e.g., 2G, 5G, 6G, 10G, or other value). For example, after the solid state disk executes the deletion command, the difference between the third data volume and the fourth data volume is smaller than a preset threshold, and when the sum of the difference accumulated by the solid state disk after executing the deletion command for multiple times is greater than or equal to the preset threshold, the solid state disk sends the second information to the computing device. In this case, the difference amount indicated in the second information is the sum of the difference amounts obtained after the execution of the multiple deletion commands.
It should be noted that the trigger condition for the solid-state device to send the second information to the computing device may be set or not, and the embodiment of the present application is not specifically limited.
S205, the computing device receives the second information, and marks the virtual capacity which is equal to the difference indicated by the second information as unavailable in the virtual disk.
In this embodiment of the application, after receiving second information sent by the solid state disk, the computing device marks, as unavailable, a virtual capacity that is equal to a difference indicated by the second information, that is, a virtual disk created by the computing device has a partial virtual capacity false report.
It should be noted that, since the solid state disk has a compression function, the data amount of the target data (compressed) deleted by the solid state disk is smaller than the data amount before the target data is compressed, so that the available storage capacity actually increased by the solid state disk after the deletion operation is performed is smaller than the available storage capacity added to the solid state disk by the computing device, and the difference between the available storage capacity and the available storage capacity is the difference between the third data amount before the target data is compressed and the fourth data amount after the target data is compressed. Therefore, after receiving the second information from the solid state disk, the computing device needs to mark the virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable.
It is understood that the deletion command causes no data to be stored in the virtual capacity marked as unavailable in the virtual disk, which essentially marks a portion of the virtual capacity in the virtual disk that is free as unavailable due to the excess storage capacity generated by the solid state disk executing the deletion command.
It should be noted that, after receiving the second information, the computing device marks, in the virtual disk, a virtual capacity equal to the difference indicated by the second information as unavailable, and then determines whether the unavailable virtual capacity in the current virtual disk reaches a disk deletion threshold, and if the unavailable virtual capacity does not reach the disk deletion threshold, waits for receiving the next second information from the solid state disk and marks, in the virtual disk, a virtual capacity equal to the difference indicated by the second information as unavailable; if the threshold value of the disk deletion is reached, S206 is executed. The second preset storage capacity is equal to or less than the preset storage capacity in S105.
In some possible embodiments, the ratio of the delete disk threshold to the preset storage capacity may be 0.45, 0.5, 0.6, 0.8 or other values less than or equal to 1, which is not specifically limited in this application. The setting of the delete disk threshold is to leave room for the available capacity of the created virtual disk, which is beneficial to improving the operating efficiency of the system.
In one implementation, in conjunction with the system architecture shown in the embodiment of fig. 1, the compression middleware of the computing device receives the second information sent by the solid state disk through the compression driver, and the compression middleware marks the virtual capacity equal to the difference indicated by the second information as unavailable. And circularly executing the step until the unavailable virtual capacity in the virtual disk reaches a second preset storage capacity.
Exemplarily, assuming that the capacity of the virtual disk is 50G, the disk deletion threshold is 30G, after a first deletion operation, the compression middleware of the computing device receives second information from the solid state disk, where the second information indicates a difference amount of 10G, and the compression middleware marks, in the virtual disk, a virtual capacity equal to the difference amount indicated by the second information as unavailable, and the unavailable virtual capacity is 5G; after the second deletion operation, the computing device receives second information indicating the difference amount of 5G, marks the virtual capacity in the virtual disk, which is equal to the difference amount of 5G indicated by the second information, as unavailable, and accumulates the unavailable virtual capacity to be 15G, and the process is circulated until the unavailable virtual capacity in the virtual disk reaches the disk deletion threshold value.
And S206, when the unavailable virtual capacity reaches the disk deleting threshold, the computing equipment deletes the virtual disk.
In the embodiment of the application, after the computing device receives the second information from the solid state disk, the computing device marks, in the virtual disk, the virtual capacity equal to the difference indicated by the second information as unavailable, and when the virtual capacity marked as unavailable in the virtual disk reaches a disk deletion threshold, the computing device deletes the corresponding virtual disk. The threshold value of the deleted disk is less than or equal to the preset storage capacity, and the embodiment of the present application is not particularly limited.
The unusable virtual capacity reaching the delete threshold may be the one time the unusable virtual capacity marked by the second information reaches the delete threshold, or the one time the unusable virtual capacity marked by the second information reaches the delete threshold by the cumulative sum of the plurality of times the unusable virtual capacity is marked by the second information.
In specific implementation, the system structure shown in fig. 1 is used for explaining, after receiving the second information from the solid state disk, the compression middleware of the computing device marks, in the virtual disk, a virtual capacity equal to a difference indicated by the second information as unavailable, calculates a virtual capacity whose history is marked as unavailable, deletes, when the unavailable virtual capacity in the virtual disk reaches a disk deletion threshold, the virtual disk, and simultaneously subtracts, by the storage software of the computing device, the capacity of the deleted virtual disk from the recorded available storage capacity of the solid state disk, where the capacity of the deleted virtual disk is a preset storage capacity.
It should be noted that, because the deletion command causes that no data is stored in the virtual capacity marked as unavailable in the virtual disk, when the unavailable virtual capacity in the virtual disk reaches the disk deletion threshold, the computing device directly deletes the corresponding virtual disk.
In some possible embodiments, the computing device has created a virtual disk that maps to a first physical space of the solid state disk before the delete command is due. When the solid state disk executes a write command, third data is stored in a first physical space of the solid state disk mapped with the virtual disk, and fourth information is sent to the computing device, the fourth information indicates the data volume of the compressed third data, the computing device marks a virtual capacity equal to the difference indicated by the fourth information as unavailable in the virtual disk, and when judging whether the unavailable virtual capacity in the virtual disk reaches a disk deletion threshold, the unavailable virtual capacity referred to herein includes the virtual capacity marked as unavailable due to the second information (in the case of executing the delete command), and also includes the virtual capacity marked as unavailable due to the fourth information, and the data is stored in the virtual capacity marked as unavailable due to the fourth information. In this case, when the unavailable virtual capacity reaches the threshold of deleting the disk, the computing device further needs to send fifth information to the solid state disk, where the fifth information is used to instruct the solid state disk to migrate the data in the first physical space to a second physical space of the solid state disk, and the second physical space has no virtual disk mapped thereto. After the solid state disk completes data migration, the computing device deletes the created virtual disk, and meanwhile, the computing device reduces the capacity of the virtual disk on the recorded available storage capacity of the solid state disk, namely, reduces the first preset capacity.
By implementing the embodiment of the application, the dynamic storage information caused by deleting the compressed data is reported to the computing device after the deletion operation is performed by the solid state disk, so that the computing device can dynamically manage the redundant storage capacity caused by deleting the compressed data in the solid state disk by deleting the created virtual disk, the flexibility of disk management is improved, the performance of the system is not affected, the flexibility of adjusting the available storage capacity of the solid state disk is improved, and abnormal writing or crash of the computing device caused by insufficient available storage capacity of the solid state disk by the computing device is avoided.
Referring to fig. 5 and 6, the embodiment of fig. 4 is described below in some specific application scenarios.
Referring to fig. 5, fig. 5 is a schematic diagram of a scene based on a delete command. As shown in fig. 5, the available storage capacity of the solid state disk B initially recorded by the computing device a is the same as the actual available storage capacity of the solid state disk B, and is 100G. The solid state disk B sequentially executes two write commands, the data volume written by each write command before data compression is 10G, and the data volume of the data compressed by the solid state disk is 6G. After the write command is executed twice, the computing device creates a virtual disk with a capacity of 8G, the virtual disk is mapped in the first physical space of the solid state disk B, the available storage capacity of the solid state disk B recorded by the computing device a is 88G, the available storage capacity of the solid state disk B is also 88G, and the process of the solid state disk B executing the write command and the process of creating the virtual disk by the computing device may refer to the description related to the embodiment in fig. 3, which is not described herein again.
Assume that the capacity (i.e., the predetermined storage capacity) of the virtual disk is 8G, and the delete threshold is 4G. The computing device a instructs the solid state disk B to delete the data written for the second time, the solid state disk B deletes the compressed data written for the second time, the data volume is 6G, the available storage capacity of the solid state disk B is 94G, the available storage capacity of the solid state disk B recorded by the computing device a is 98G, after the solid state disk B executes the delete command, the solid state disk B sends second information indicating the difference amount of 4G to the computing device A, the computing device A marks virtual capacity in the virtual disk, which is equal to the difference amount indicated by the second information, as unavailable, since the unavailable virtual capacity of 4G reaches the delete threshold, the computing device pre-deletes the virtual disk, since there is no data stored in the virtual disk at this time, the computing device a deletes the virtual disk directly, and the available storage capacity of the solid state disk B recorded by the computing device a becomes 90G.
Referring to fig. 6, fig. 6 is a schematic diagram of another scenario based on a delete command.
As shown in fig. 6, assuming that the available storage capacity of the solid state disk recorded by the computing device a is (Y +8), where 8G is the capacity of the virtual disk, and 2G of virtual capacity in the virtual disk is marked as unavailable, it can be seen that the 2G of virtual capacity stores data, that is, the unavailable virtual capacity in the virtual disk is 2G. For the solid state disk B, the occupied storage capacity of the inside is 12G, the available storage capacity is X, wherein an 8G first physical space is mapped with the virtual disk on the computing device side, and 2G data is stored in the 8G first physical space.
The solid state disk B deletes the data of 6G (10G before compression) according to the deletion command, after the deletion is completed, the available storage capacity of the solid state disk B is changed to (X +6), and second information indicating the 4G difference is reported to the computing device A; when the solid state disk B executes the delete command, the available storage capacity of the solid state disk B recorded by the computing device a becomes (Y +18), while according to the received second information, marking the virtual capacity equivalent to the difference amount of 4G indicated by the second information as unavailable in the virtual disk, wherein the unavailable virtual capacity in the virtual disk is 6G, a disk deletion threshold (assumed to be 5G) is reached, pre-deleting the virtual disk by the computing device, since there is data in the virtual disk, before deleting the virtual disk, the computing device a sends information (e.g., the fifth information in the above-described embodiment) to the solid state disk B, which instructs the solid state disk to migrate the data in the virtual disk to be deleted, specifically, the information indicates that the solid state disk B migrates the data of the second physical space to the second physical space of the solid state disk, and the second physical space has no virtual disk mapped with the second physical space. After the solid state disk B finishes data migration, the available storage capacity of the solid state disk B is changed from (X +6) to (X +4), the computing device A deletes the virtual disk, the available storage capacity of the solid state disk B recorded by the computing device A is changed from (Y +18) to (Y +10), and the (Y +10) is smaller than or equal to (X + 4).
It should be noted that the 2G data to be migrated in the virtual disk to be deleted in the computing device a may be written by executing a write command, written by executing a change command, or written by executing a write command and a change command together in the virtual disk. For the related description of the modification operation (or the execution of the modification command), reference may be made to the embodiment in fig. 7, and for the sake of brevity of the description, no further description is provided herein.
The method includes the steps that simply understood, after a deletion command is executed by a solid state disk, relevant information is reported to a computing device, when the computing device judges that the unavailable virtual capacity in a certain virtual disk reaches a trigger condition for deleting the virtual disk (namely the unavailable virtual capacity in the virtual disk reaches a disk deletion threshold), whether the computing device instructs the solid state disk to perform data migration operation before deleting the virtual disk depends on whether data exist in the virtual disk to be deleted, if the data exist, the solid state disk executes change operation before executing the deletion command and/or executes write operation after creating the virtual disk and stores write data into the virtual disk, and the solid state disk needs to perform data migration according to the instruction of the computing device; if the data does not exist, the solid state disk does not need to be subjected to data migration, and the computing equipment can delete the virtual disk directly.
The following takes a modification command as an example to further describe the method for increasing the available storage capacity provided by the embodiment of the present application. Referring to fig. 7, fig. 7 is a flowchart of a method for increasing available storage capacity according to an embodiment of the present application. The embodiment of fig. 7 may be independent of the embodiment of fig. 4, or may be a supplement to the embodiments of fig. 2 and 4. The method includes, but is not limited to, the steps of:
s301, the computing equipment sends a change command to the solid state disk.
In the implementation of the application, the computing device sends a change command to the solid state disk, the change command is used for instructing the solid state disk to change the target data, the target data is part or all of the second data, that is, the change command is used for instructing the solid state disk to change part or all of the second data. It should be noted that the change command also carries a logical address corresponding to the write data.
It is readily understood that if the computing device instructs the solid state drive to alter some or all of the second data, then the second data must have been written to the solid state drive before. Therefore, the sending of the change command to the solid state disk by the computing device is that the change command sent to the solid state disk by the computing device is valid only after the solid state disk executes the write command in the embodiment of fig. 2, that is, after data is written into the solid state disk.
S302, the solid state disk receives the change command and changes part or all of the second data.
In this embodiment of the application, after the solid state disk receives the change command from the computing device, because the solid state disk compresses and stores the second data after the second data is written in the solid state disk, that is, the second data stored in the physical space of the solid state disk is the compressed second data, if part or all of the second data needs to be changed, the solid state disk needs to find the compressed second data stored in the corresponding physical space of the solid state disk according to the logical address carried by the change command, then decompress the compressed second data, and then modify part or all of the decompressed second data according to the need.
And S303, the solid state disk compresses and stores the changed second data.
In the embodiment of the application, after the solid state disk changes part or all of the second data, the changed second data needs to be compressed and stored. It is easy to understand that the data stored in the physical space of the solid state disk are all compressed data, and therefore, after part or all of the second data is changed, the solid state disk recompresses the changed second data and stores the second data.
It should be noted that, the amount of data before the compression of the second data after the modification is equal to the amount of first data before the compression of the second data, but the fifth amount of data after the compression of the second data after the modification is larger than the sixth amount of data after the compression of the second data, because the compression ratio is reduced when the second data after the modification is compressed again due to the change of the data source after the modification of the second data, the fifth amount of data after the compression of the second data after the modification is larger than the sixth amount of compressed second data stored in the solid state disk before the modification.
It should be noted that, after the solid state disk recompresses and stores the modified second data, because the fifth data amount after compressing the modified second data is greater than the sixth data amount before modifying, the physical address corresponding to the modified second data is also changed after compressing the modified second data, the solid state disk updates the physical address corresponding to the logical address of the second data in the mapping table, and the logical address of the modified second data is still the logical address of the second data.
It should be noted that, because the data stored in the solid state disk is compressed data, to change the second data, the solid state disk needs to decompress the compressed second data before modifying the compressed second data. No matter part or all of the second data is modified, since the whole write data is decompressed, after the part or all of the second data is modified, the modified second data needs to be recompressed and stored, that is, the data after the modified second data is compressed is stored in the physical space of the solid state disk.
S304, the solid state disk calculates the difference between the fifth data volume after the modified second data is compressed and the sixth data volume after the second data is compressed.
In the embodiment of the present application, the fifth data amount after the modified second data is compressed is greater than the sixth data amount after the second data is compressed, that is, it is described that the storage capacity occupied by the compressed packet obtained after the modified second data is recompressed is increased, accordingly, the available storage capacity of the solid state disk is reduced, and the reduced available storage capacity is the difference between the fifth data amount and the sixth data amount.
For example, suppose that the computing device instructs the solid state disk to write 10G of second data, and after the solid state disk completes the write operation, the storage capacity actually occupied by the 10G of second data in the solid state disk is 6G, which reduces the data volume of 4G, and therefore, after the solid state disk completes the write operation, the solid state disk reports to the computing device first information indicating that the difference is 4G. At this time, if the computing device instructs the solid state disk to change the just written 10G of second data, the solid state disk changes the stored compressed second data (the data volume is 6G), and then recompresses and stores the changed second data, assuming that the data volume of the changed second data after compression is 7G, that is, the second data occupies more storage space than 1G before the change.
S305, the solid state disk sends second information to the computing equipment.
In this embodiment of the application, after the solid state disk executes the change command, the solid state disk sends second information to the computing device, and in a case that the change command is executed, the second information is feedback information sent to the computing device after the change command is executed on the solid state disk, and the second information indicates a difference amount caused before and after the change command is executed on the solid state disk, and specifically, the second information is used for indicating a difference amount between a fifth data amount after the second data is compressed and a sixth data amount after the second data is compressed.
In an embodiment of the application, each time the solid state disk executes the change command, the solid state disk sends second information to the computing device once, where the second information is used to indicate a difference between the fifth data amount and the sixth data amount for the change command.
In an embodiment of the application, a trigger condition may be further set for sending the second information, that is, after the solid state disk executes the multiple change command, and when a difference between a fifth data amount after the second data is compressed and a sixth data amount after the second data is compressed, which is caused by the multiple change command, is greater than or equal to a preset threshold (for example, 2G, 5G, 6G, 10G, or another value), the solid state disk sends the second information to the computing device once, where the second information is used to indicate a difference between the fifth data amount and the sixth data amount under the multiple change command, and the difference is a sum of differences caused after the multiple change command is executed in history. It should be noted that the multiple changes to the second data may be multiple changes to the second data written in the same time, or may also be changes to the second data written in different times, and the embodiment of the present application is not particularly limited.
For example, the preset threshold set by the solid state disk is 3G, the solid state disk performs first change on the second data according to the change command, assuming that the difference between the fifth data amount after the second data is compressed after the change and the sixth data amount occupied in the solid state disk before the second data is changed is 1G, assuming that the subsequent solid state disk performs second change on the second data, if the difference between the data amount after the second change operation (which is recompressed) and the data amount before the change (which is not decompressed) is 2G, the sum of the difference amounts caused by the two change operations is 3G (which reaches the preset threshold), the solid state disk sends the second information to the computing device for the first time, and the second information indicates that the difference amount caused under the change command is 3G; if the difference between the storage capacity after the second change operation and the storage capacity before the change operation is 2.5G, the sum of the difference amounts caused by the two change operations is 3.5G (reaching a preset threshold), the solid state disk sends the second information to the computing device once, the second information indicates that the difference amount caused under the change command is 3.5G, of course, in some possible embodiments, the difference amount indicated by the second information sent by the solid state disk to the computing device may be 3G, and the remaining 0.5G is accumulated until the next preset threshold is met and then reported.
It should be noted that the trigger condition for the solid-state device to send the second information to the computing device may be set or not, and the embodiment of the present application is not specifically limited.
S306, the computing device receives the second information, and marks the virtual capacity which is equal to the difference indicated by the second information as unavailable in the virtual disk.
In this embodiment of the application, after receiving the second information sent by the solid state disk, the computing device marks, in the virtual disk, a virtual capacity equal to the difference indicated by the second information as unavailable, that is, means that a part of capacity in the virtual disk created by the computing device is unavailable.
It should be noted that the reason why the computing device marks the virtual capacity equivalent to the difference indicated by the second information as unavailable is that the solid state disk occupies a part of the free virtual capacity in the virtual disk after executing the change command, the part of the virtual capacity is already used for storing data, and therefore the occupied part of the virtual capacity needs to be marked as unavailable.
It should be noted that, after receiving the second information, the computing device marks, in the virtual disk, a virtual capacity equal to the difference indicated by the second information as unavailable, and then determines whether the unavailable virtual capacity in the current virtual disk reaches a disk deletion threshold, and if the unavailable virtual capacity does not reach the disk deletion threshold, waits for receiving the next second information from the solid state disk and marks, in the virtual disk, a virtual capacity equal to the difference indicated by the second information as unavailable; if the threshold value of the disk deletion is reached, S307 is executed.
In a specific implementation, in combination with the system architecture shown in the embodiment of fig. 1, the compression middleware of the computing device receives the second information sent by the solid state disk through the compression driver, marks, in the virtual disk, a virtual capacity that is equal to the difference indicated by the second information as unavailable, and performs this step in a loop until the unavailable virtual capacity in the virtual disk reaches the disk deletion threshold. And the disk deletion threshold is less than or equal to a preset storage capacity, and the preset storage capacity is the capacity of the virtual disk created by the computing equipment.
S307, the computing device sends third information to the solid state disk.
In the embodiment of the application, when the unavailable virtual capacity in the virtual disk reaches the disk deletion threshold, the condition that the computing device deletes the virtual disk is met, but before the computing device deletes the virtual disk, because the virtual disk to be deleted stores data, the computing device needs to send third information to the computing device first, the third information is used for indicating the solid state disk to migrate the data in the first physical space to a second physical space of the solid state disk, the second physical space does not have the virtual disk mapped with the second physical space, and understanding is simple, that is, the fourth information indicates the solid state disk to migrate the data in the virtual disk to be deleted.
It should be noted that the virtual disk is mapped to a first physical space of the solid state disk, and the first physical space is used to store data with a difference size between a fifth data amount and a sixth data amount, in other words, the first physical space is used to store a part of data after the second data compression after being modified by the solid state disk, and the data amount of the part of data is the difference between the fifth data amount and the sixth data amount.
For example, the data size of the compressed second data is 6G, the data size of the compressed second data after the modification is 7G, after the modification operation is completed, 6G of the data obtained after the compression of the modified second data is stored in the original position in the solid state disk, and the remaining 1G of the data is stored in the first physical space of the solid state disk, which is mapped to the virtual disk, that is, the remaining 1G of the data is stored in the virtual disk. And the computing equipment can delete the virtual disk until the data in the virtual disk to be deleted is migrated.
S308, the solid state disk receives the third information, and the data in the first physical space is migrated to a second physical space of the solid state disk according to the third information.
In the embodiment of the application, after the solid state disk receives the third information from the computing device, it is stated that the computing device deletes the created virtual disk in advance, the solid state disk migrates the data volume of the first physical space to the second physical space of the solid state disk according to the third information, so that the data in the virtual disk to be deleted is migrated to a different physical space of the solid state disk, and the physical space where the data is located after the data migration has no mapping between the virtual disk and the physical space.
It should be noted that, after the solid state disk completes the migration of the data according to the third information, if the computing device deletes the virtual disk, the first physical space in the solid state disk no longer has the virtual disk mapped thereto, and the first physical space is recovered as the local storage space of the solid state disk. Therefore, dynamic management of the virtual disk is realized, and the operating efficiency of the system is improved.
In some possible embodiments, after the computing device adds the virtual disk, the solid state disk executes the write command, and stores the compressed third data in the virtual disk, in which case, the unavailable virtual capacity in the virtual disk includes two parts, wherein one part of the unavailable virtual capacity is marked as unavailable due to the partial write command, and the other part of the unavailable virtual capacity is marked as unavailable due to the change command. In this case, the data in the virtual disk to be deleted, migrated by the solid state disk according to the third information, includes both the partially compressed third data and the modified partially compressed second data.
In some possible embodiments, the virtual capacity that is not available in the virtual disk may further include three portions, the first portion of the virtual capacity that is not available being marked as not available due to a partial write command, the second portion of the virtual capacity that is not available being marked as not available due to a change command, and the third portion of the virtual capacity that is not available being marked as not available due to a delete command. In this case, the data in the virtual disk to be deleted, migrated by the solid state disk according to the third information, includes both the partially compressed third data and the modified partially compressed second data.
S309, when the unavailable virtual capacity reaches the disk deleting threshold, the computing device deletes the virtual disk.
In the embodiment of the application, after the computing device receives the second information from the solid state disk, the computing device marks, in the virtual disk, the virtual capacity equal to the difference indicated by the second information as unavailable, and when the virtual capacity marked as unavailable in the virtual disk reaches a disk deletion threshold, the computing device deletes the corresponding virtual disk. The threshold value of the deleted disk is less than or equal to the preset storage capacity, and the embodiment of the present application is not particularly limited.
In a specific implementation, with reference to the system architecture shown in the embodiment of fig. 1, after receiving the second information from the solid state disk, the compression middleware of the computing device marks, in the virtual disk, a virtual capacity that is equal to a difference indicated by the second information as unavailable, calculates a virtual capacity whose history is marked as unavailable, and deletes the virtual disk when the unavailable virtual capacity in the virtual disk reaches a disk deletion threshold, where the storage software of the computing device subtracts the capacity of the deleted virtual disk from the recorded available storage capacity of the solid state disk, and the capacity of the deleted virtual disk is a preset storage capacity.
It should be noted that, when the unavailable virtual capacity reaches the delete threshold, and before the computing device deletes the created virtual disk in advance, S307-S308 are executed.
By implementing the embodiment of the application, the dynamic storage information caused by changing the compressed data is reported to the computing device after the solid state disk executes the change command, so that the computing device can dynamically manage the redundant storage capacity caused by changing the compressed data in the solid state disk by deleting the created virtual disk, the flexibility of disk management is improved, the performance of the system is not affected, the flexibility of adjusting the available storage capacity of the solid state disk is improved, and abnormal writing or crash of the computing device caused by insufficient available storage capacity of the solid state disk by the computing device is avoided.
Referring to fig. 8 and 9, the embodiment of fig. 7 is described in some specific application scenarios.
Referring to fig. 8, fig. 8 is a schematic view of a scene based on a change command. As shown in fig. 8, after the computing device a instructs the solid state disk B to execute two write commands, the computing device a creates a virtual disk with a capacity of 8G, and the available storage capacity of the solid state disk B recorded by the computing device a is 88G; after solid state disk B has performed two write commands, the available storage capacity becomes 88G, with 8G as the first physical space mapped with the virtual disk created by computing device a. In addition, it is assumed that the data volume of data written in each time by the solid state disk B is 10G, the data volume of data compressed by the solid state disk is 6G, the preset storage capacity is 8G, and the disk deletion threshold is 4G.
The solid state disk B executes a change command (for example, reference numeral 1), and assuming that the data volume after the data compression is changed from 6G to 8G after the change is completed, for the data after the data re-compression after the change, 6G of the data is stored in the original physical space of the solid state disk B, and the remaining 2G is stored in the first physical space of the solid state disk B, which is mapped with the virtual disk in the computing device a, so that the solid state disk B sends second information (for example, reference numeral 2) indicating the difference amount of 2G to the computing device a, the computing device a marks, in the virtual disk, the virtual capacity equal to the difference amount indicated by the second information as unusable, and the unusable virtual capacity in the virtual disk is 2G and does not reach the disk deletion threshold value.
The solid state disk B executes the change command again (for example, reference numeral 3), similarly, the data volume after the changed data compression is changed from 6G to 8G, the solid state disk B still preferentially stores the 2G which is exceeded after the change into the first physical space of the solid state disk B which is mapped with the virtual disk in the computing device a, and sends the second information (for example, reference numeral 4) indicating the 2G difference to the computing device a, the computing device a marks the virtual capacity which is equal to the difference indicated by the second information in the virtual disk as unavailable, the unavailable virtual capacity in the virtual disk is 4G and reaches the disk deletion threshold, the computing device a intends to delete the virtual disk, because the virtual disk to be deleted stores 4G of data, the computing device a sends the third information (for example, reference numeral 6) to the solid state disk B, and the third information indicates that the solid state disk B migrates the data in the first physical space which is mapped with the virtual disk to be deleted to the solid state disk B And the second physical space is not mapped with the virtual disk. After the data migration of the solid state disk B is completed, the computing device a deletes the virtual disk (for example, reference numeral 7), at this time, the available storage capacity of the solid state disk B recorded by the computing device a is changed from 88G to 80G, and after the data migration of the solid state disk B is completed, the available storage capacity is changed from 88G to 84G.
Fig. 9 is a schematic diagram of another scene based on a change command, as shown in fig. 9.
As shown in fig. 9, assuming that the available storage capacity of the solid state disk recorded by the computing device a is (Y +8), where 8G is the capacity of the virtual disk, and 2G of virtual capacity in the virtual disk is marked as unavailable, it can be seen that the 2G of virtual capacity stores data, that is, the unavailable virtual capacity in the virtual disk is 2G. For the solid state disk B, the available storage capacity is X, wherein an 8G first physical space is mapped with the virtual disk on the computing device side, and 2G data is stored in the 8G first physical space. Assume that the second preset storage capacity is 4G.
The solid state disk B changes the second data according to the change command, after the change is completed, the data volume of the changed second data after compression is changed from original 6G to 8G, the solid state disk B stores the excess 2G into a first physical space mapped with the virtual disk created by the computing device a, and reports second information indicating the difference amount of the 2G to the computing device a, the computing device a marks, according to the received second information, a virtual capacity equal to the difference amount of the 2G indicated by the second information in the virtual disk as unavailable, the unavailable virtual capacity in the virtual disk is accumulated to 4G at this time, and reaches a disk deletion threshold (4G), the computing device deletes the virtual disk in advance, because the virtual disk has data, before deleting the virtual disk, the computing device a sends information (for example, the third information in the above embodiment) indicating that the solid state disk migrates the data in the virtual disk to be deleted to the solid state disk B, specifically, the information indicates that the solid state disk B migrates data in the second physical space to the second physical space of the solid state disk, and the second physical space has no virtual disk mapped thereto. After the solid state disk B finishes data migration, the available storage capacity of the solid state disk B is changed from X to (X-4), the computing device A deletes the virtual disk, the available storage capacity of the solid state disk B recorded by the computing device A is changed from (Y +8) to Y, and Y is smaller than or equal to (X-4).
In the application scenario shown in fig. 9, it can be seen that before the solid state disk performs the change operation, data is already stored in the virtual disk, and the data in the virtual disk may be only data stored due to a change command, may also be only data stored due to a write command, and may also be data stored due to a change command and a write command.
It should be noted that, after the solid state disk executes the change command, the first physical space mapped to the virtual disk created by the computing device is stored with data, that is, the virtual disk is stored with data. The computing device determines whether the virtual capacity marked as unavailable in a virtual disk reaches a trigger condition for deleting the virtual disk (i.e., the virtual capacity marked as unavailable in the virtual disk reaches a disk deletion threshold), where the unavailable virtual capacity may be marked as unavailable due to at least one of a delete command, a write command, and a change command.
The following takes a read command as an example to further describe the method for increasing the available storage capacity provided by the embodiment of the present application. Referring to fig. 10, fig. 10 is a flowchart of a method for increasing available storage capacity applied to a read command according to an embodiment of the present application. The embodiment of fig. 10 may be independent of the embodiments of fig. 4 and 7, or may be a supplement to the embodiments of fig. 2, 4 and 7. The method includes, but is not limited to, the steps of:
s401, the computing equipment sends a reading command to the solid state disk.
In the embodiment of the application, the computing device sends a read command to the solid state disk, wherein the read command is used for instructing the solid state disk to read specified data. It should be noted that the read command also carries a logical address corresponding to the specified data.
It is readily understood that if the computing device instructs the solid state disk to read certain data, the data must have been written to the solid state disk before. Therefore, the sending of the read command to the solid state disk by the computing device is that the computing device sends the delete command to the solid state disk after the computing device sends the write command to the solid state disk, that is, after data is written in the solid state disk.
It should be noted that the target data to be read by the computing device may be the first data written in the embodiment of fig. 2, or may be the second data changed in the embodiment of fig. 7.
S402, the solid state disk receives the reading command and decompresses the specified data according to the reading command.
In the embodiment of the application, after receiving a read command from a computing device, a solid state disk finds a physical address mapped with the read command in a storage medium according to a logical address carried in the read command, and since data stored in the solid state disk is compressed, the data taken out of the mapped physical address by the solid state disk is compressed designated data, and the solid state disk decompresses the designated data (compressed), so that the designated data to be read by the computing device can be obtained.
The data decompression means that the compressed designated data is restored to the state before compression, and the storage capacity of the decompressed designated data is the same as the storage capacity before the decompression.
In a specific implementation, the solid state disk finds a physical address mapped in the storage medium according to the read command, and takes out the specified data (compressed) from a physical space corresponding to the physical address and puts the data into a cache of the solid state disk and decompresses the data. Taking the system framework described in fig. 1 as an example, the compressed Firmware (Firmware) receives a read command transmitted by the storage software of the computing device through the SSD drive, decompresses the specified data (compressed) in the cache, and returns the decompressed specified data to the storage software of the computing device through the SSD drive.
And S403, the solid state disk sends the decompressed specified data to the computing device.
In the embodiment of the application, after the computing device obtains the decompressed specified data, the decompressed specified data is sent to the computing device, so that the specified data is read.
It should be noted that the read command sent by the computing device does not cause a change in the available storage capacity of the solid state disk for the solid state disk, and therefore, the solid state disk does not need to report dynamic storage change information to the computing device under the read operation command, and only needs to return a result after the read operation command is executed to the computing device.
It can be seen that, by implementing the embodiment of the present application, compressed data stored in the solid state disk is read, and the decompression processing of the data by the solid state disk during read operation is decoupled from the read operation service of the system, so that the performance of the system is not affected. In addition, the data to be read is compressed by the solid state disk and then stored, so that the capacity of the solid state disk is indirectly improved, and the unit capacity cost of the solid state disk is reduced.
Referring to fig. 11, an embodiment of the present application further provides a schematic structural diagram of an apparatus, where the apparatus 30 at least includes a processor 310, a memory 311, a receiver 312 and a transmitter 313, and the receiver 312 and the transmitter 313 may also be replaced with a communication interface for providing information input/output for the processor 310. Alternatively, the memory 311, the receiver 312 and the transmitter 313 and the processor 310 may be connected or coupled by a bus. Optionally, the apparatus 30 further includes a display screen 314, where the display screen 314 is configured to display an available storage capacity of the solid state disk stored in the local record, data returned by the solid state disk after the read operation is completed, and the like. Apparatus 30 may be a computing device in the embodiment of fig. 1.
The transmitter 313 is configured to send a write command and write data or other data operation commands (e.g., a change command, a delete command, and a read command) to the solid state disk, and in the case of the delete command, the transmitter 313 is further configured to send information indicating data migration (i.e., the third information in fig. 7) to the solid state disk. The receiver 312 is configured to receive information (e.g., the first information in fig. 2, the second information in fig. 4, and the second information in fig. 7) indicating a change in available storage capacity, which is sent by the solid state disk after executing a corresponding data operation command, and the receiver 312 is further configured to receive a result returned after the data operation command sent by the solid state disk, e.g., decompressed data to be read and the like returned after the read operation in fig. 10 is completed. The receiver 312 and transmitter 313 may include an antenna and chipset for communicating with the solid state disk or other hardware in the solid state disk, either directly or over an air interface. The receiver 312 and the transmitter 313 constitute a communication module that may be configured to receive and transmit information in accordance with one or more other types of wireless communication (e.g., protocols), such as bluetooth, IEEE 802.11 communication protocols, cellular technologies, Worldwide Interoperability for Microwave Access (WiMAX) or LTE (Long Term Evolution), ZigBee protocols, Dedicated Short Range Communications (DSRC), and RFID (Radio Frequency Identification) Communications, among others.
The Memory 311 may include a Volatile Memory (Volatile Memory), such as a Random Access Memory (RAM); the Memory 311 may also include a Non-Volatile Memory (Non-Volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD), or a Solid-State Drive (SSD); the memory 311 may also include a combination of the above categories. The memory 311 may store programs and data, wherein the stored programs include: data operation commands (write commands, read commands, change commands and delete commands), adding and removing programs of a virtual disk, driving programs of a solid state disk and the like, wherein the stored data comprise: presetting storage capacity, deleting threshold, logic address of write data, data to be read, available storage capacity of the solid state disk and the like. The memory 311 may be separate or integrated within the processor 310.
The specific implementation of the operations performed by the processor 310 may refer to the specific operations of creating a storage pool based on the first information in fig. 2, creating a virtual disk, marking an unavailable virtual capacity based on the second information in fig. 4 or the second information in fig. 7, deleting a virtual disk, and the like in the above method embodiments. Processor 310 may be comprised of one or more general-purpose processors, such as a Central Processing Unit (CPU), or a combination of a CPU and hardware chips. The hardware chip may be an Application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), General Array Logic (GAL), or any combination thereof. The processor 310 is specifically configured to invoke the program code and data in the memory 311 to perform the various operations described above. In one implementation, the storage software, the compression middleware, the SSD driver, and the compression driver of FIG. 1 may run in the processor 310.
In the embodiment of the present application, the apparatus 30 is used to implement the method on the computing device side as described in the embodiments of fig. 2, fig. 4, fig. 7, and fig. 10.
Referring to fig. 12, the embodiment of the present application further provides a schematic structural diagram of an apparatus, and the apparatus 40 at least includes a processor 410, a memory 411, a receiver 412, and a transmitter 413. The receiver 412 and transmitter 413 may also be replaced with a communication interface for providing information input/output to the processor 410. Alternatively, the memory 411, the receiver 412, and the transmitter 413 and the processor 410 may be connected or coupled by a bus. The device 40 may be a solid state disk in the embodiment of fig. 1.
The receiver 412 is configured to receive a write command and a write data or other data manipulation command (e.g., a change command, a delete command, and a read command) from the computing device, and in response to the delete command, the receiver 412 is further configured to receive information (i.e., the third information in fig. 7) from the computing device indicating data migration. The transmitter 413 is configured to send information (e.g., the first information in fig. 2, the second information in fig. 4, and the second information in fig. 7) indicating a change in available storage capacity after the solid state disk executes a corresponding data operation command to the computing device, and the transmitter 413 is further configured to send a data operation command to the computing device and return a result, e.g., the read operation in fig. 10 completes sending decompressed data to be read, and the like. The receiver 412 and transmitter 413 may include an antenna and chipset for communicating with the solid state disk or other hardware in the solid state disk, either directly or over an air interface. The receiver 412 and the transmitter 413 constitute a communication module that may be configured to receive and transmit information according to one or more other types of wireless communication (e.g., protocols), such as bluetooth, IEEE 802.11 communication protocols, cellular technologies, Worldwide Interoperability for Microwave Access (WiMAX) or LTE (Long Term Evolution), ZigBee protocols, Dedicated Short Range Communications (DSRC), and RFID (Radio Frequency Identification) Communications, among others.
The Memory 411 may include a Non-Volatile Memory (Non-Volatile Memory), such as a Flash chip, which may be specifically a Flash Memory granule (NAND Flash); memory 411 may also be a Dynamic Random Access Memory (DRAM), Random Access Memory (RAM), or other type of volatile Memory; the memory 411 may also comprise a combination of the above categories. The memory 411 may store programs and data, wherein the stored programs include: a compression/decompression program, a setting program for transmitting capacity change information (for example, the first information in fig. 2, the second information in fig. 4, and the second information in fig. 7), an initialization program for a solid state disk, and the like, and stored data includes: the method comprises the steps of presetting a threshold, an address mapping table, first data, second data, changed second data and the like. The memory 411 may be separately present or may be integrated within the processor 410. Memory 411 may be a flash memory granule in fig. 1.
The specific implementation of the processor 410 to execute the operations may refer to the method embodiment described above, where the first data is compressed and stored, the change command is executed on part or all of the second data, and the delete command, the data migration and storage, and the like are executed on part or all of the second data. Processor 410 may be comprised of one or more general-purpose processors, such as a Central Processing Unit (CPU), or a combination of a CPU and hardware chips. The hardware chip may be an Application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), General Array Logic (GAL), or any combination thereof. The processor 410 has a codec function integrated therein. Processor 410 may be the SSD controller of fig. 1. The processor 410 is specifically configured to call the program code and data in the memory 411 to perform the operations described above. In one implementation, processor 410 may be the SSD controller of fig. 1, and a compressed Firmware (Firmware) and FTL module may be run in processor 410.
In the embodiment of the present application, the apparatus 40 is used to implement the method of the solid state disk side described in the embodiments of fig. 2, 4, 7 and 10.
Referring to fig. 13, an embodiment of the present application further provides a functional structure diagram of an apparatus, and the apparatus 32 further includes a sending unit 320, a receiving unit 321, and a processing unit 322.
The sending unit 320 is configured to send a write command and first data to the memory, where the write command is used to instruct the memory to write the first data; the receiving unit 321 receives the first information from the memory; the processing unit 322 is configured to create a virtual disk for the memory in response to the first information.
The functional modules of the apparatus 32 may be used to implement the method on the computing device side described in the embodiment of fig. 2. In the embodiment of fig. 2, the sending unit 320 may be configured to perform S101, the receiving unit 321 may be configured to perform S105, and the processing unit 322 may be configured to perform S105 and S106. Each functional module of the apparatus 32 may also be configured to execute a method on the computing device side in the embodiments of fig. 4, fig. 7, and fig. 10, and for brevity of description, the present application is not described herein again.
Referring to fig. 14, an embodiment of the present application further provides a functional structure diagram of an apparatus, where the apparatus 42 at least includes that the apparatus 42 further includes a receiving unit 420, a processing unit 421, and a sending unit 422.
Wherein the receiving unit 420 is configured to receive a write command and first data from a computing device; the processing unit 421 is configured to compress and store the first data; the sending unit 422 is configured to send first information to the computing device, where the first information is used to instruct the computing device to create a virtual disk for the memory.
The functional blocks of the device 42 may be used to implement the solid state hard disk side method described in the embodiment of fig. 2. In the embodiment of fig. 2, the receiving unit 420 may be configured to perform S102, the processing unit 421 may be configured to perform S102 and S103, and the transmitting unit 422 may be configured to perform S104. The functional modules of the device 42 may also be used to execute the method on the solid state disk side in the embodiments of fig. 4, fig. 7, and fig. 10, and for brevity of description, the description of the present application is not repeated herein.
Embodiments of the present application further provide a storage system, where the storage system includes a computing device, such as a computer, and further optionally, the storage system further includes at least one memory, such as a solid state disk. The computing device may be the apparatus described in the above embodiment of fig. 11, or may be the apparatus described in the embodiment of fig. 13. Further, optionally, the memory may be the apparatus described in the embodiment of fig. 12, or may be the apparatus described in the embodiment of fig. 14.
In the embodiments described above, the descriptions of the respective embodiments have respective emphasis, and reference may be made to related descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
It should be noted that all or part of the steps in the methods of the above embodiments may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an optical Disc (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM), or other Programmable Read-Only memories (ROM, CD-ROM), Disk storage, tape storage, or any other medium readable by a computer that can be used to carry or store data.
The technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be implemented in the form of a software product, where the computer software product is stored in a storage medium and includes several instructions to enable a device (which may be a personal computer, a server, or a network device, a robot, a single chip, a robot, etc.) to execute all or part of the steps of the method according to the embodiments of the present application.

Claims (24)

1. A method for increasing available storage capacity, applied to a computing device, the method comprising:
sending a write command and first data to a memory, wherein the write command is used for instructing the memory to write the first data;
receiving first information from the memory;
and responding to the first information, and creating a virtual disk for the memory.
2. The method of claim 1, wherein the first information is used to indicate a difference between a first data amount before the first data compression and a second data amount after the first data compression;
said creating a virtual disk for said memory in response to said first information, comprising:
and creating the virtual disk for the memory according to the difference indicated by the first information.
3. The method of claim 1 or 2, wherein after sending the write command and the first data to the memory, the method further comprises:
sending a delete command or a change command to the memory, wherein the delete command is used for instructing the memory to delete target data, the change command is used for instructing the memory to change the target data, and the target data is part or all of the second data;
receiving second information from the memory;
and responding to the second information, and deleting the virtual disk.
4. The method of claim 3, wherein the second information is used to indicate a difference amount caused before and after the deletion command or the modification command is executed by the memory;
after the receiving the second information from the memory, the method further comprises:
marking virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable;
the responding to the second information, and deleting the virtual disk comprises:
and deleting the virtual disk according to the unavailable virtual capacity.
5. The method of claim 4,
when the deletion command instructs the memory to delete the target data, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; alternatively, the first and second electrodes may be,
when the change command instructs the memory to change the target data, the difference amount indicated by the second information is a difference amount between a fifth data amount after the changed second data is compressed and a sixth data amount after the second data is compressed.
6. The method of claim 5, wherein the virtual disk is mapped to a first physical space of the memory, the first physical space being used to store data of a difference size between the fifth amount of data and the sixth amount of data;
before the deleting the virtual disk according to the unavailable virtual capacity, the method further comprises:
sending third information to the memory, wherein the third information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
7. A method for increasing available storage capacity, applied to a memory, the method comprising:
receiving a write command and first data from a computing device;
compressing and storing the first data;
sending first information to the computing device, wherein the first information is used for instructing the computing device to create a virtual disk for the memory.
8. The method of claim 7, wherein the first information is used to indicate a difference between a first data amount before the first data compression and a second data amount after the first data compression;
the sending, to the computing device, first information for instructing the computing device to create a virtual disk for the memory includes:
sending the first information to the computing device, wherein the first information is used for instructing the computing device to create the virtual disk for the memory based on the difference quantity indicated by the first information.
9. The method of claim 8, wherein after said compressing and storing said first data, said method further comprises:
receiving a deletion command or a change command sent by the computing equipment;
deleting target data according to the deleting command or changing the target data according to the changing command, wherein the target data is part or all of second data;
and sending second information to the computing equipment, wherein the second information is used for indicating the computing equipment to delete the virtual disk.
10. The method of claim 9, wherein the second information is further used to indicate an amount of difference caused before and after the memory executes the delete command or the change command.
11. The method of claim 10,
when the target data is deleted by the memory, the difference amount indicated by the second information is a difference amount between a third data amount before the target data is compressed and a fourth data amount after the target data is compressed; alternatively, the first and second electrodes may be,
when the target data is changed by the memory, the difference amount indicated by the second information is a difference amount between a fifth data amount after the second data is changed and a sixth data amount after the second data is changed.
12. The method of claim 11, wherein the virtual disk is mapped to a first physical space of the memory, the first physical space being used to store data of a difference size between the fifth amount of data and the sixth amount of data;
after sending the second information to the computing device while the memory is altering the target data, the method further comprises:
and receiving third information from the computing equipment, and migrating the data of the first physical space to a second physical space of the memory according to the third information.
13. An apparatus, characterized in that the apparatus comprises:
a sending unit, configured to send a write command and first data to a memory, where the write command is used to instruct the memory to write the first data;
a receiving unit for receiving first information from the memory;
and the processing unit is used for responding to the first information and creating a virtual disk for the memory.
14. The apparatus of claim 13, wherein the first information is used to indicate a difference between a first data amount before the first data compression and a second data amount after the first data compression;
the processing unit is specifically configured to:
and creating the virtual disk for the memory according to the difference indicated by the first information.
15. The apparatus of claim 13 or 14,
the sending unit is further configured to send a delete command or a change command to the memory, where the delete command is used to instruct the memory to delete target data, the change command is used to instruct the memory to change the target data, and the target data is part or all of second data;
the receiving unit is further used for receiving second information from the memory;
the processing unit is further configured to respond to the second information and delete the virtual disk.
16. The apparatus of claim 15, wherein the second information is used to indicate a difference amount caused before and after the deletion command or the modification command is executed by the memory;
the processing unit is further to: marking virtual capacity in the virtual disk, which is equal to the difference indicated by the second information, as unavailable;
the processing unit is specifically configured to: and deleting the virtual disk according to the unavailable virtual capacity.
17. The apparatus of claim 16,
when the deletion command instructs the memory to delete the target data, the difference amount indicated by the second information is a difference amount between a third data amount before compression of the target data and a fourth data amount after compression of the target data; alternatively, the first and second electrodes may be,
when the change command instructs the memory to change the target data, the difference amount indicated by the second information is a difference amount between a fifth data amount after the changed second data is compressed and a sixth data amount after the second data is compressed.
18. The apparatus of claim 17, wherein the virtual disk is mapped to a first physical space of the memory, and the first physical space is used for storing data with a difference size between the fifth amount of data and the sixth amount of data;
the sending unit is further configured to: sending third information to the memory, wherein the third information is used for instructing the memory to migrate the data of the first physical space to a second physical space of the memory.
19. An apparatus, characterized in that the apparatus comprises:
a receiving unit configured to receive a write command and first data from a computing device;
the processing unit is used for compressing and storing the first data;
a sending unit, configured to send first information to the computing device, where the first information is used to instruct the computing device to create a virtual disk for the memory.
20. The apparatus of claim 19, wherein the first information is used to indicate a difference between a first amount of data before the first data compression and a second amount of data after the first data compression;
the sending unit is specifically configured to: sending the first information to the computing device, wherein the first information is used for instructing the computing device to create the virtual disk for the memory based on the difference quantity indicated by the first information.
21. The apparatus of claim 19 or 20,
the receiving unit is further used for receiving a deleting command or a changing command from the computing equipment;
the processing unit is further configured to delete target data according to the deletion command or change the target data according to the change command, where the target data is part or all of second data;
the sending unit is further configured to send second information to the computing device, where the second information is used to instruct the computing device to delete the virtual disk.
22. The apparatus of claim 21, wherein the second information is further used to indicate an amount of difference caused before and after the deletion command or the modification command is executed by the memory.
23. The apparatus of claim 22,
when the target data is deleted by the memory, the difference amount indicated by the second information is a difference amount between a third data amount before the target data is compressed and a fourth data amount after the target data is compressed; alternatively, the first and second electrodes may be,
when the target data is changed by the memory, the difference amount indicated by the second information is a difference amount between a fifth data amount after the second data is changed and a sixth data amount after the second data is changed.
24. The apparatus of claim 23, wherein the virtual disk is mapped to a first physical space of the memory, and the first physical space is used for storing data with a difference size between the fifth amount of data and the sixth amount of data;
while the memory is altering the target data, the receiving unit is further to: receiving third information from the computing device; the processing unit is specifically configured to: and migrating the data of the first physical space to a second physical space of the memory according to the third information.
CN202010239040.7A 2020-03-30 2020-03-30 Method and device for improving available storage capacity Active CN113467699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010239040.7A CN113467699B (en) 2020-03-30 2020-03-30 Method and device for improving available storage capacity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010239040.7A CN113467699B (en) 2020-03-30 2020-03-30 Method and device for improving available storage capacity

Publications (2)

Publication Number Publication Date
CN113467699A true CN113467699A (en) 2021-10-01
CN113467699B CN113467699B (en) 2023-08-22

Family

ID=77865134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010239040.7A Active CN113467699B (en) 2020-03-30 2020-03-30 Method and device for improving available storage capacity

Country Status (1)

Country Link
CN (1) CN113467699B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220283740A1 (en) * 2021-03-02 2022-09-08 Phison Electronics Corp. Memory control method, memory storage device and memory control circuit unit

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI20125779A (en) * 2012-07-05 2014-01-06 Blancco Oy Ltd Device, arrangement, method, and computer program for erasing data stored in mass storage
US20150378613A1 (en) * 2013-05-17 2015-12-31 Hitachi, Ltd. Storage device
US20160196075A1 (en) * 2013-07-19 2016-07-07 Hitachi, Ltd. Storage apparatus and storage control method
WO2017219364A1 (en) * 2016-06-24 2017-12-28 华为技术有限公司 Method for processing data, storage apparatus, solid state disk and storage system
CN108415669A (en) * 2018-03-15 2018-08-17 深信服科技股份有限公司 The data duplicate removal method and device of storage system, computer installation and storage medium
CN108427538A (en) * 2018-03-15 2018-08-21 深信服科技股份有限公司 Storage data compression method, device and the readable storage medium storing program for executing of full flash array

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI20125779A (en) * 2012-07-05 2014-01-06 Blancco Oy Ltd Device, arrangement, method, and computer program for erasing data stored in mass storage
US20150378613A1 (en) * 2013-05-17 2015-12-31 Hitachi, Ltd. Storage device
US20160196075A1 (en) * 2013-07-19 2016-07-07 Hitachi, Ltd. Storage apparatus and storage control method
WO2017219364A1 (en) * 2016-06-24 2017-12-28 华为技术有限公司 Method for processing data, storage apparatus, solid state disk and storage system
CN109690681A (en) * 2016-06-24 2019-04-26 华为技术有限公司 Handle method, storage device, solid state hard disk and the storage system of data
CN108415669A (en) * 2018-03-15 2018-08-17 深信服科技股份有限公司 The data duplicate removal method and device of storage system, computer installation and storage medium
CN108427538A (en) * 2018-03-15 2018-08-21 深信服科技股份有限公司 Storage data compression method, device and the readable storage medium storing program for executing of full flash array

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220283740A1 (en) * 2021-03-02 2022-09-08 Phison Electronics Corp. Memory control method, memory storage device and memory control circuit unit
US11816355B2 (en) * 2021-03-02 2023-11-14 Phison Electronics Corp. Data writing method based on different numbers of chip enabled regions, memory storage device and memory control circuit unit

Also Published As

Publication number Publication date
CN113467699B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
US10628060B2 (en) Smart storage management based on dynamic logic capacity for the storage
TWI700586B (en) Computer system and control method of storage device
TWI682278B (en) Memory system and control method
CN101526923B (en) Data processing method, device thereof and flash-memory storage system
US8799562B2 (en) Storage apparatus and data control method for generating and storing format data and guarantee codes
JP2019079113A (en) Storage device, data management method, and data management program
US20210096983A1 (en) System controller and system garbage collection method
WO2014188528A1 (en) Memory device, computer system, and memory device control method
CN110018966A (en) A kind of memory, storage system, host and data manipulation, rubbish recovering method
WO2017132797A1 (en) Data arrangement method, storage apparatus, storage controller and storage array
CN111309267A (en) Storage space allocation method and device, storage equipment and storage medium
CN111831215A (en) Apparatus for transferring mapping information in memory system
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
US20140114936A1 (en) Method for generating data in storage system having compression function
EP3798852B1 (en) System controller and system garbage recovery method
CN113467699B (en) Method and device for improving available storage capacity
CN117075810B (en) ZNS solid state disk-based data management method
CN117472285A (en) Intelligent operation acceleration method for solid state disk, computer equipment and storage medium
JPH0844498A (en) Storage device with compressing function and computer system having the device
US10949340B2 (en) Block mapping systems and methods for storage device
CN117348789A (en) Data access method, storage device, hard disk, storage system and storage medium
KR20230081505A (en) Memory controller and operating method thereof
CN111597128B (en) Method and device for managing data in solid-state nonvolatile storage device
WO2024001863A1 (en) Data processing method and related device
US20230273727A1 (en) Dynamic storage for adaptive mapping for data compression on a storage device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant