WO2020233175A1 - 硬盘格式转换方法、装置及存储设备 - Google Patents

硬盘格式转换方法、装置及存储设备 Download PDF

Info

Publication number
WO2020233175A1
WO2020233175A1 PCT/CN2020/075158 CN2020075158W WO2020233175A1 WO 2020233175 A1 WO2020233175 A1 WO 2020233175A1 CN 2020075158 W CN2020075158 W CN 2020075158W WO 2020233175 A1 WO2020233175 A1 WO 2020233175A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage
storage device
threshold
disk
smr
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.)
Ceased
Application number
PCT/CN2020/075158
Other languages
English (en)
French (fr)
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
Publication of WO2020233175A1 publication Critical patent/WO2020233175A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B20/1217Formatting, e.g. arrangement of data block or words on the record carriers on discs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/061Improving I/O performance
    • G06F3/0613Improving I/O performance in relation to throughput
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0661Format or protocol conversion arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0674Disk device
    • G06F3/0676Magnetic disk device
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B2020/1264Formatting, e.g. arrangement of data block or words on the record carriers wherein the formatting concerns a specific kind of data
    • G11B2020/1265Control data, system data or management information, i.e. data used to access or process user data
    • G11B2020/1285Status of the record carrier, e.g. space bit maps, flags indicating a formatting status or a write permission
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B2020/1291Formatting, e.g. arrangement of data block or words on the record carriers wherein the formatting serves a specific purpose
    • G11B2020/1292Enhancement of the total storage capacity
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B2020/1291Formatting, e.g. arrangement of data block or words on the record carriers wherein the formatting serves a specific purpose
    • G11B2020/1294Increase of the access speed

Definitions

  • This application relates to the field of storage technology, and in particular to a hard disk format conversion method, device and storage device.
  • Mechanical hard disk (English full name: hard disk drive, English abbreviation: HDD) is a widely used storage medium. With its low price per unit capacity, it plays a pivotal role in storage technology.
  • the disk body of a mechanical hard disk usually includes multiple disks.
  • the upper or lower surface of each disk is called a magnetic surface.
  • the magnetic surface can be divided into multiple tracks.
  • One or more tracks can form a storage unit of the mechanical hard drive.
  • the data that needs to be stored can be stored in the storage unit.
  • Mechanical hard disks include shingle magnetic recording (English full name: shingle magnetic recording, English abbreviation: SMR) disks and traditional perpendicular magnetic recording (English full name: permanent magnetic recording, English abbreviation: PMR) disks.
  • SMR shingle magnetic recording
  • PMR perpendicular magnetic recording
  • Each track of the SMR disk is similar to overlapping tiles, and there will be overlapping areas between adjacent tracks. Therefore, the disk surface of the SMR disk can accommodate more tracks, which makes the SMR disk have the advantage of higher storage capacity. But at the same time, because writing data on any track of the SMR disk will affect the adjacent tracks of the track, for the SMR area composed of the tracks of the SMR disk, the order can only be used on the SMR area Data is stored by writing instead of random writing.
  • the embodiments of the present application provide a hard disk format conversion method, device, and storage device, which can solve the technical problem of low IOPS or small storage capacity of storage units in related technologies.
  • the technical solution is as follows:
  • a hard disk format conversion method is provided, the method is applied to a storage device, and the method includes:
  • the first storage format and the second storage format are respectively one of the shingled magnetic recording SMR method or the perpendicular magnetic recording PMR method, and the first storage format and the second storage format different.
  • the method provided in this embodiment converts the storage format of the storage unit from the SMR mode to the PMR mode. Since the PMR mode has higher IOPS than the SMR mode, the IOPS of the storage unit can be improved after the storage format is converted. Or, by converting the storage format of the storage unit from the PMR mode to the SMR mode, since the SMR mode has a higher storage capacity than the PMR mode, the storage capacity of the storage unit can be increased after the storage format is converted.
  • the first storage unit is an SMR area
  • the second storage unit is a PMR area
  • the first storage unit is a PMR area
  • the second storage unit is an SMR area
  • the first storage unit is an SMR disk
  • the second storage unit is a PMR disk
  • the first storage unit is a PMR disk
  • the second storage unit is an SMR disk
  • the method before the selecting the first storage unit, the method further includes:
  • the hard disk format conversion can be performed, which can make the timing of the hard disk format conversion more flexible, and can combine the function of the hard disk format conversion with the current situation.
  • the preset conditions include any one and a combination of the following conditions:
  • the cold data refers to data whose access frequency is lower than the temperature threshold
  • the thermal data refers to data whose access frequency is higher than the temperature threshold, or
  • the free space of the storage device is insufficient, you can determine whether the free space of the storage device is lower than the set space threshold. If the free space of the storage device is lower than the set space threshold, the hard disk format conversion is performed, for example, The storage format of the storage unit is converted from the PMR mode to the SMR mode. As the SMR mode has a higher storage capacity than the PMR mode, the storage capacity can be increased, thereby increasing the free space of the storage device, thereby solving the problem of insufficient free space .
  • the number of first storage units it can be determined whether the number of first storage units is higher than the set first number threshold. If the number of first storage units is higher than the set first number threshold, then The first storage unit converts more second storage units to meet storage capacity or performance requirements.
  • the thermal data in the storage device reaches the set second proportional threshold. If the thermal data reaches the set second proportional threshold, change the storage format of the storage unit from the PMR mode Convert to SMR mode.
  • the proportion of cold data stored in the storage device is relatively large, the IOPS requirement for the storage device is relatively low. Therefore, even if the storage unit in the PMR mode is converted to the storage unit in the SMR mode, The performance of the storage device will not be affected too much due to the reduction of storage units in the PMR method.
  • the SMR method has a higher storage capacity than the PMR method, the storage capacity of the storage device can be increased.
  • the storage unit will be stored The format is converted from SMR mode to PMR mode, thereby obtaining more PMR area. Then because the proportion of hot data stored in the storage device is large, the IOPS requirement for the storage device is higher. As the PMR method has higher IOPS compared to the SMR method, the IOPS of the storage device can be increased, thereby Improve the performance of storage devices.
  • the storage format of the storage unit is converted from SMR to PMR , Then because the PMR method has higher IOPS compared to the SMR method, it can increase the IOPS of the storage device, thereby improving the performance of the storage device.
  • whether the cold data stored in the storage device reaches the set first proportion threshold includes: whether the cold data stored in the storage device reaches the set first proportion threshold, And whether the growth of the cold data stored in the storage device in the target time period reaches the set first growth threshold.
  • the cold data stored in the storage device has reached the set first ratio threshold, and the increase in the preset time period has reached the set first increase threshold, it indicates that the data in the storage device is cold, And the temperature of the data changes to a colder trend, and a cooler level of storage is required, and the storage format of the storage unit can be converted from the PMR mode to the SMR mode.
  • the proportion of cold data stored in the storage device is relatively large, the IOPS requirement for the storage device is relatively low. Therefore, even if the storage unit in the PMR mode is converted to the storage unit in the SMR mode, The performance of the storage device will not be affected too much due to the reduction of storage units in the PMR method.
  • the SMR method has a higher storage capacity than the PMR method, the storage capacity of the storage device can be increased.
  • whether the thermal data stored in the storage device reaches the set second proportion threshold includes: whether the thermal data stored in the storage device reaches the set second proportion threshold, And whether the increase of the hot data stored in the storage device in the target time period reaches the set second increase threshold.
  • the hot data stored in the storage device has reached the set second ratio threshold, and the increase in the preset time period has reached the set second increase threshold, it indicates that the data in the storage device is hot. And the temperature of the data changes to a hotter trend, and higher IOPS is required, so the storage format of the storage unit can be converted from SMR to PMR to increase IOPS.
  • the first storage unit is pre-configured with a first parameter and a second parameter, the first parameter is used to support the first storage format, and the second parameter is used to support the The second storage format,
  • the instructing the first storage unit to convert the first storage format into the second storage format specifically includes:
  • the first parameter includes flying height, number of bits per inch BPI, number of tracks per inch TPI, the distance between the read head and the write head on the tangent line, and the distance between the read head and the write head in the radial direction. Any one of and a combination of them.
  • the method before the instructing the first storage unit to convert the first storage format into the second storage format, the method further includes:
  • the data stored in the first storage area is migrated to other areas in advance, thereby avoiding the loss of the data stored in the first storage area and realizing the data stored in the first storage area.
  • the backup function improves the security of data storage.
  • the method further includes:
  • the migrating data stored in other storage units of the storage device to the second storage unit includes:
  • the second area uses SMR to store data, migrate cold data stored in other storage units of the storage device to the second storage unit, or,
  • the second area uses the PMR method to store data, migrate the hot data stored in other storage units of the storage device to the second storage unit.
  • a hard disk format conversion device is provided, the device is applied to a storage device, and the device includes:
  • the selection module is configured to select a first storage unit, and the first storage unit stores data in a first storage format
  • An instruction module configured to instruct the first storage unit to convert the first storage format into a second storage format to obtain a second storage unit
  • the first storage format and the second storage format are respectively one of the shingled magnetic recording SMR method or the perpendicular magnetic recording PMR method, and the first storage format and the second storage format different.
  • the device further includes:
  • the judgment module is used to judge whether the storage device meets a preset condition.
  • the preset conditions include any one and a combination of the following conditions:
  • the cold data refers to data whose access frequency is lower than the temperature threshold
  • the thermal data refers to data whose access frequency is higher than the temperature threshold, or
  • the first storage unit is pre-configured with a first parameter and a second parameter, the first parameter is used to support the first storage format, and the second parameter is used to support the The second storage format,
  • the instruction module is specifically configured to instruct the first storage unit to enable the second parameter, and to disable the first parameter.
  • the first parameter includes flying height, number of bits per inch BPI, number of tracks per inch TPI, the distance between the read head and the write head on the tangent line, and the distance between the read head and the write head in the radial direction. Any one of and a combination of them.
  • the device further includes:
  • the migration module is used to migrate the data stored in the first storage unit to other storage units of the storage device.
  • a storage device in a third aspect, includes a processor and at least two areas, the at least two areas including a shingled magnetic recording SMR area and a perpendicular magnetic recording PMR area;
  • the processor is configured to select a first area, and the first area uses a first storage format to store data;
  • the processor is configured to instruct the first area to convert the first storage format into a second storage format to obtain a second area; wherein the first storage format and the second storage format are SMR respectively Or PMR, and the first storage format is different from the second storage format.
  • the processor is further configured to determine whether the storage device meets a preset condition.
  • the preset conditions include any one and a combination of the following conditions:
  • the cold data refers to data whose access frequency is lower than the temperature threshold
  • the thermal data refers to data whose access frequency is higher than the temperature threshold, or
  • the first area is pre-configured with a first parameter and a second parameter
  • the first parameter is used to support the first storage format
  • the second parameter is used to support the first parameter.
  • the first parameter includes flying height, number of bits per inch BPI, number of tracks per inch TPI, the distance between the read head and the write head on the tangent line, and the distance between the read head and the write head in the radial direction. Any one of and a combination of them.
  • the processor is further configured to migrate data stored in the first area to other areas of the storage device.
  • a storage device in a fourth aspect, includes a system controller and at least two disks, the at least two disks including a shingled magnetic recording SMR disk and a perpendicular magnetic recording PMR disk;
  • the system controller is configured to select a first disk, and the first disk uses a first storage format to store data;
  • the system controller is configured to instruct the first disk to convert the first storage format into a second storage format to obtain a second disk; wherein, the first storage format and the second storage format are respectively One of the SMR method or the PMR method, and the first storage format and the second storage format are different.
  • system controller is also used to determine whether the storage device meets a preset condition.
  • the preset conditions include any one and a combination of the following conditions:
  • the cold data refers to data whose access frequency is lower than the temperature threshold
  • the thermal data refers to data whose access frequency is higher than the temperature threshold, or
  • the first disk is pre-configured with a first parameter and a second parameter
  • the first parameter is used to support the first storage format
  • the second parameter is used to support the first parameter.
  • the system controller is specifically configured to instruct the first disk to enable the second parameter, and to disable the first parameter.
  • the first parameter includes flying height, number of bits per inch BPI, number of tracks per inch TPI, the distance between the read head and the write head on the tangent line, and the distance between the read head and the write head in the radial direction. Any one of and a combination of them.
  • system controller is further configured to migrate data stored in the first disk to other disks of the storage device.
  • a computer-readable storage medium is provided, and the computer-readable storage medium is used to store the computer program described in the fifth aspect.
  • FIG. 1 is a schematic diagram of the principle of reading and writing data of an HDD provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of TPI and BPI provided by an embodiment of the present application.
  • FIG. 4 is an architecture diagram of an implementation environment provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a storage device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a storage device provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a hard disk format conversion method provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of switching from an SMR area to a PMR area according to an embodiment of the present application.
  • FIG. 9 is a flowchart of switching from a PMR area to an SMR area provided by an embodiment of the present application.
  • FIG. 10 is a flowchart of a hard disk format conversion method provided by an embodiment of the present application.
  • FIG. 11 is a flowchart of a hard disk format conversion method provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a hard disk format conversion device provided by an embodiment of the present application.
  • HDD It is a storage medium with the advantage of low price per unit capacity.
  • An HDD usually includes one or more disks, and the upper or lower surface of each disk can usually store data, and is an effective disk surface, usually called a magnetic surface.
  • Each magnetic surface can be logically divided into multiple tracks. Generally speaking, the magnetic surface can be divided into thousands or even tens of thousands of tracks.
  • each track is a concentric circle, the outermost concentric circle on the magnetic surface can be recorded as track 0, and one or more tracks can form a storage unit of the mechanical hard disk.
  • each magnetic sheet may have a magnetic head above and below each magnetic sheet, and the magnetic sheet may rotate between the two magnetic heads.
  • the magnetic head will find the track corresponding to the storage location of the data on the disk, and find the corresponding sector on the track, and then the distance between the head and the disk meets the requirements
  • apply a changing current to the magnetic head so that the magnetic field on the track will change accordingly, then the changed magnetic field on the track is the stored data.
  • the magnetic head includes a read head and a write head.
  • the read head is used for positioning when performing a read operation or a write operation
  • the write head is used for writing data.
  • the width of the write head can be approximately twice that of the read head.
  • Parameters Also known as disk format (full English name: zone format, English abbreviation: ZF), parameters are used to support the storage format of the storage unit in the hard disk. If a certain storage unit in the disk enables a certain parameter, the parameter can be used to store data in the storage unit, and the storage format of the storage unit is the storage format corresponding to the parameter.
  • the parameters may include flying height, number of bits per inch (full English name: bits per inch, abbreviation: BPI), track number per inch (full English name: track per inch, abbreviation: TPI), Any one of the distance between the read head and the write head on the tangent line, the distance between the read head and the write head in the radial direction, and a combination thereof.
  • the flying height is the distance between the head and the disk.
  • HDD hard disk drive
  • the flying height needs to be within a certain range to ensure that the write head can write signals to the track with an appropriate circuit, and the read head can sense the signal of the track.
  • TPI Refers to how many tracks can be stored per inch on the disk. TPI can be shown in Figure 2(a).
  • BPI Refers to how many bits can be stored per inch on the track. BPI can be shown in Figure 2(b). BPI can reflect the storage density on the track.
  • the capacity of the disk is determined by the product of BPI and TPI.
  • BPI number of cars on a single lane on the road
  • TPI total number of lanes on the road
  • the total number of cars can be understood as the capacity of the disk, and the total number of cars is equal to the product of the number of cars in a single lane and the number of lanes.
  • the distance between the read head and the write head on the tangent line used to determine the position of the read head and the write head in the tangential direction of the track.
  • the distance between the read head and the write head in the radial direction used to determine the position of the read head and the write head in the radial direction of the track.
  • PMR disc A disc with spaces between adjacent tracks.
  • the tracks of the PMR disk are separated from each other. For example, see Figure 3(a). There is a certain interval between track (N-1) and track N, and there is a certain interval between track N and track (N+1), where N is Positive integer.
  • each track of the PMR disk can be divided into at least two PMR areas, and each PMR area includes one or more tracks.
  • PMR disks have the advantage of high IOPS. Specifically, because there is no overlap between different tracks, when data is written to any track, it will not affect other tracks. Therefore, random writing can be used to store data on the PMR disk.
  • the random writing will bring Higher IOPS, so that the IOPS of PMR disks is better than that of SMR disks.
  • PMR disks in order to write signals to the tracks, it is necessary to ensure that the magnetic head has a certain width. Generally, the wider the magnetic head, the wider the track, the smaller the TPI, and the number of tracks that can be accommodated on the PMR disk. Because the storage capacity is limited, the storage capacity of the PMR disk is usually smaller than that of the SMR disk.
  • Each track of the SMR disk is similar to overlapping tiles, and there will be overlapping areas between adjacent tracks.
  • the track (N-1) overlaps with the track N
  • the track N overlaps with the track (N+1).
  • the SMR disc divides multiple tracks into several bands. Bands are continuously writable areas composed of continuous tracks, and each area constitutes a basic unit that needs to be written sequentially.
  • the zone is the physical concept on the SMR disk, and its corresponding logical concept is the SMR zone (zone), and the SMR zone is the sequential write area in the SMR disk that can be seen by the upper software.
  • SMR disks The size of an SMR area is usually 256 megabytes (full English name: MByte, English abbreviation: MB).
  • SMR disks have the advantage of high capacity. Specifically, SMR disks use the characteristics of different read-write head widths, and the magnetic field required to read data is less than the magnetic field required to write data, to change the previous independent recording method between discrete tracks to an overlapping track recording method. Without adding additional hardware complexity, the distance between the centers of adjacent tracks is significantly reduced, so that there can be more tracks per inch. As shown in Figure 3, the TPI can be significantly increased. The head is relatively narrow, and the read head can still read data from the track.
  • the product of BPI and TPI can be increased without increasing the physical size and without increasing the BPI, which increases the storage capacity.
  • the SMR disc can increase the capacity by about 20% compared to the PMR disc, so the data storage cost of the SMR disc is about 15% lower than that of the PMR disc.
  • the capacity of SMR disks is increased, it also has its inherent defects. Since the storage format of SMR disks is similar to shingled tiles, when data is written to any track of the SMR disk, other tracks that overlap with the track will be overwritten. It will affect the data stored on other tracks. Therefore, the SMR method cannot write data randomly on any track like the PMR method, and the IOPS of the SMR disk is generally lower than the IOPS of the PMR disk.
  • FIG. 4 is an architecture diagram of an implementation environment provided by an embodiment of the present application.
  • the implementation environment includes a storage device 401 and a terminal 402.
  • the storage device 401 and the terminal 402 can establish a communication path, and communicate through the communication path.
  • the storage device 401 may include a system controller 4011 and at least two disks 4012.
  • the at least two disks 4012 include SMR disks and PMR disks.
  • the system controller 4011 is used to control the at least two disks 4012 to perform hard disk format conversion, and each disk 4012 can convert the storage format of the local end to other storage formats under the control of the system controller 4011.
  • the storage device 401 may provide a data storage service for the terminal 402. Specifically, the terminal 402 can send the data to be stored to the system controller 4011, the system controller 4011 can send the data to at least two disks 4012, and the at least two disks 4012 can receive data from the system controller 4011 and perform data processing. storage.
  • the terminal 402 may send an input/output (full English name: input/output, English abbreviation: I/O) request to the storage device 401, and the I/O request carries the data to be stored, and the storage device 401 can send data from the terminal 402 Receive I/O requests, get data from I/O requests, and store data.
  • I/O full English name: input/output, English abbreviation: I/O
  • the storage device 401 may be provided to users as a cloud storage service. Specifically, the storage device 401 may run in a cloud environment, for example, it may run on a public cloud, a private cloud, or a hybrid cloud. The user can use the terminal 402 to apply for a certain capacity of storage space in the cloud storage service. The storage device 401 may allocate storage space of corresponding capacity to the user, for example, allocate one or more disks 4012 to the user, so as to store data in the allocated storage space. As an example, the storage device 401 may be provided as an object storage service (English full name: object storage service, English abbreviation: OBS), cloud hard disk, cloud database, etc.
  • object storage service English full name: object storage service, English abbreviation: OBS
  • cloud hard disk cloud database, etc.
  • the terminal 402 may be a personal computer (English full name: personal computer, English abbreviation: PC), mobile phone, tablet computer, etc. Those skilled in the art may know that the number of the aforementioned terminals 402 may be more or less. For example, there may be only one terminal 402, or there may be dozens or hundreds of terminals 402, or a greater number. In this case, the implementation environment may also include other terminals. The embodiment of the present application does not limit the number of terminals 402 and device types.
  • the present application provides a storage device 500.
  • the storage device 500 may be but is not limited to a disk.
  • the storage device 500 may be an HDD.
  • the storage device 500 includes a processor 501 and at least two areas 502.
  • the processor 501 may not be limited to a control circuit or a control chip.
  • the storage device 500 may include a system on a chip, and the processor 501 may be located in the system on a chip of the storage device 500.
  • the at least two areas 502 include an SMR area and a PMR area.
  • Each area 502 is a storage unit of the storage device 500, and each area 502 can be used to store data.
  • the storage device 500 may include one or more disks, each disk including an upper surface and a lower surface, and each area 502 may be located on the upper surface or the lower surface of any disk of the storage device 500.
  • the storage device 500 may further include a memory 504, and the memory 504 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 501 to implement the hard disk format conversion method provided in the embodiment of FIG. 7 below.
  • the memory 504 may store the first parameter and the second parameter, the first parameter is used to support the first storage format, and the second parameter is used to support the second storage format.
  • the memory 504 may be a non-volatile memory, for example, a flash memory (flash).
  • flash flash
  • the storage device 500 may further include a bus 503 and a transceiver 505.
  • the bus 503 is connected to the processor 501 and the at least two areas 502, and the processor 501 and the at least two areas 502 can communicate with each other through the bus 503.
  • the transceiver 505 is used to send and receive signals, and for example, can be used to receive instructions from the system controller 601 or the host shown in the following embodiment of FIG. 6.
  • the storage device 500 may also include other components for implementing device functions, which are not described here.
  • the present application provides a storage device 600.
  • the storage device 600 may be, but is not limited to, a storage array.
  • the storage device 600 includes a system controller 601 and at least two disks 602.
  • the system controller 600 may be a server, a personal computer (full English name: personal computer, English abbreviation: PC), etc.
  • the system controller 601 may have relatively large differences due to different configurations or performance, and may include one or more processors 6011 (central processing units, CPU) and one or more memories 6012. Wherein, at least one instruction is stored in the memory 6012 of the system controller 601, and the at least one instruction is loaded and executed by the processor 6011 to implement the hard disk format conversion method provided in the embodiment of FIG. 10 below.
  • the types of the memory 6012 of the system controller 601 include but are not limited to volatile memory 6012, non-volatile memory 6012, such as random access memory 6012 (English full name: random access memory, English abbreviation: RAM), read-only memory 6012 (English name: read-only memory, English abbreviation: ROM), CD-ROM (English name: compact disc read-only memory, English abbreviation: CD-ROM), magnetic tape, floppy disk, optical data storage device, flash memory 6012 , HDD, solid state drive (English full name: solid state drive, English abbreviation: SSD).
  • the system controller 601 may also have components such as a wired or wireless network interface and an input/output interface for input and output, and the system controller 601 may also include other components for implementing device functions, which will not be repeated here.
  • FIG. 6 is only described by taking the storage device 600 including one system controller 601 as an example.
  • the storage device 600 may also include two or more system controllers.
  • Each step in the following embodiment in FIG. 10 can be distributed and executed on different system controllers, so as to share the overall calculation amount of the system controller 601.
  • this embodiment does not limit the connection mode between different system controllers 601, and only needs to ensure that different system controllers 601 can communicate with each other.
  • the connection mode of the system controller 601 and the disk 602 is not limited, and it is only necessary to ensure that different system controllers 601 can communicate with each other.
  • Each disk 602 may be the storage device 500 in the embodiment of FIG. 5, and each disk 602 may be, but is not limited to, a hard disk, such as an HDD.
  • Each disk 602 is a storage unit of the storage device 600.
  • the at least two disks 602 may include SMR disks and PMR disks.
  • the storage device may convert the storage format of the storage unit to obtain a storage unit in another storage format.
  • the storage device may convert the storage format of the storage unit from the SMR mode to the PMR mode, or convert the storage format of the storage unit from the PMR mode to the SMR mode.
  • Fig. 7 is a flowchart of a hard disk format conversion method provided by an embodiment of the present application. The method can be applied to the storage device shown in FIG. 5, and the method can be executed by the processor 501 of the storage device 500. The method includes the following steps 701 to 704:
  • Step 701 The processor determines whether the storage device meets a preset condition.
  • the preset condition may include any one of the following conditions (1) to (6) and combinations thereof:
  • the processor can obtain the free space of the storage device and determine whether the free space of the storage device is lower than the set space threshold. If the free space of the storage device is lower than the set space threshold, then Perform the following step 702. Among them, the processor may obtain the free space of each area in the storage device, and determine the sum of the free space of all the areas as the free space of the storage device.
  • step 701 the processor can convert the storage format of the area from the PMR mode to the SMR mode by determining that the storage device meets the condition (1) when the free space of the storage device is insufficient.
  • the SMR method has a higher storage capacity in a single area. Therefore, the storage capacity can be increased after the storage format conversion is performed through condition (1), and the problem of insufficient free space can be solved.
  • the space threshold can be set according to experiment, experience, or demand, and the specific value of the space threshold is not limited in this embodiment.
  • the space threshold may be pre-stored in the storage device.
  • the space threshold may be stored in the memory of the storage device, for example, may be stored in the flash memory in the system-on-chip of the storage device.
  • the processor can read the space threshold from the memory.
  • the user can input the space threshold on the terminal, the terminal can obtain the space threshold input by the user, the terminal can send the space threshold to the storage device, and the storage device can receive the space threshold from the terminal.
  • the spatial threshold can be adjusted dynamically.
  • the terminal may send the space threshold to the storage device multiple times, and the storage device may update the stored space threshold to the received space threshold every time it receives the space threshold from the terminal.
  • the storage device can dynamically adjust the size of the free space. For example, the original space threshold of the storage device is a, and the storage device determines whether the free space is lower than a, and if the free space is less than a, execute the following steps to convert the storage format of the area from PMR to SMR. Until the free space reaches a, the free space is controlled to a. After that, the terminal sends the space threshold b to the storage device.
  • the storage device re-judges whether the free space is lower than b by updating the space threshold to b.
  • the free space is less than b, perform the following steps to change the storage format of the on-disk area from The PMR mode is converted to the SMR mode until the free space reaches b, thereby controlling the free space to b.
  • the storage device can dynamically adjust the free space of the disk from a to b, which improves flexibility.
  • b and a are positive numbers, and b and a are different.
  • Condition (2) Whether the number of first regions is higher than the set first number threshold.
  • the processor can obtain the number of first areas in the storage device, and determine whether the number of first areas in the storage device is higher than the set first number threshold, and if the number of first areas is high At the set first number threshold, the following step 702 is executed.
  • the processor can convert more second areas through the first area in a scenario where the number of first areas is sufficient to meet storage capacity or performance requirements.
  • the first area may be an SMR area.
  • the SMR area in the storage device is higher than the set first number threshold, if the number of SMR areas is higher than the set first number threshold, the subsequent steps are executed, To convert the storage format of the SMR area from the SMR mode to the PMR mode, the PMR mode has higher IOPS than the SMR mode, so IOPS can be increased, thereby improving the performance of the storage device.
  • the first area may be a PMR area.
  • the SMR mode has a higher storage capacity than the PMR mode, thereby increasing the storage capacity of the storage device.
  • the first number threshold can be set according to experiment, experience, or demand, and the specific value of the first number threshold is not limited in this embodiment.
  • the first number threshold may be stored in a storage device in advance, for example, stored in a memory of the storage device.
  • the processor of the storage device may read the first number threshold value from the memory.
  • the user can input the first number threshold value on the terminal, the terminal can obtain the first number threshold value input by the user, the terminal can send the first number threshold value to the storage device, and the storage device can receive the first number threshold value from the terminal.
  • the first number threshold is not limited in this embodiment.
  • the first number threshold may be stored in a storage device in advance, for example, stored in a memory of the storage device.
  • the processor of the storage device may read the first number threshold value from the memory.
  • the user can input the first number threshold value on the terminal, the terminal can obtain the first number threshold value input by the user, the terminal can send the first number threshold value to the storage device, and the storage device can receive the first number threshold
  • the first number threshold can be dynamically adjusted.
  • the terminal may send the first quantity threshold to the storage device multiple times, and the storage device may update the stored first quantity threshold to the received first quantity threshold each time it receives the first quantity threshold from the terminal.
  • the storage device can dynamically adjust the number of the first area.
  • the first number threshold originally set by the storage device is c.
  • the storage device determines whether the number of the first area is higher than c. When the number of the first area is higher than c, the subsequent steps are performed to check the area on the disk.
  • the storage format is converted to reduce the number of first areas and get more second areas.
  • the terminal sends the first number threshold d to the storage device, and the storage device re-determines whether the number of the first area is higher than d by updating the first number threshold to d. If the number of the first area is higher than d, execute Under up steps to get more second areas. Then, if d is less than c, after the storage format of the area has been converted, the number of the first area can be further reduced to increase the number of the second area.
  • the processor can obtain the number of second areas in the storage device, and determine whether the number of second areas in the storage device is lower than the set second number threshold, and if the number of second areas is low At the second set threshold, the following step 702 is executed.
  • the processor can switch out more second areas to meet storage capacity or performance requirements in a scenario where the number of second areas is insufficient.
  • the second area may be an SMR area. It is determined whether the SMR area in the storage device is lower than the set second number threshold. If the number of SMR areas is lower than the set second number threshold, then Performing the following steps can convert the storage format of the PMR area from the PMR mode to the SMR mode to obtain the SMR area, so that the storage device can include more SMR areas and ensure that the number of SMR areas can meet the requirements. Moreover, since the SMR method has a higher storage capacity than the PMR method, the storage capacity of the storage device can be increased.
  • the second area may be a PMR area. It is determined whether the PMR area in the storage device is lower than the set second number threshold, and if the number of PMR areas is lower than the set second number threshold, By performing the subsequent steps, the storage format of the SMR area can be converted from the SMR mode to the PMR mode, so that the storage device can include more PMR areas and ensure that the number of PMR areas can meet the demand. Moreover, since the PMR method has higher IOPS compared to the SMR method, it can increase the IOPS, thereby improving the performance of the storage device.
  • the second number threshold and the first number threshold may be the same or different.
  • the present embodiment does not limit the relationship between the second number threshold and the first number threshold.
  • the second number threshold can be set according to experiment, experience or demand, and the specific value of the second number threshold is not limited in this embodiment.
  • the second number threshold may be pre-stored in the storage device, for example, in the memory of the storage device, for example, in the flash memory of the system-on-chip of the storage device.
  • the processor can read the second number threshold from the memory.
  • the user can input the second number threshold value on the terminal, the terminal can obtain the second number threshold value input by the user, the terminal can send the second number threshold value to the storage device, and the storage device can receive the second number threshold value from the terminal.
  • the second number threshold is a pre-stored in the storage device, for example, in the memory of the storage device, for example, in the flash memory of the system-on-chip of the storage device.
  • the processor can read the second number threshold from the memory.
  • the second quantity threshold may be expressed as the product of the total capacity of the storage device and the ratio threshold.
  • the ratio threshold is the ratio between the total capacity of the second area and the total capacity of the first area, and the unit of the ratio threshold may be As a percentage, the ratio threshold indicates the proportion of the second area in the storage device.
  • the ratio threshold is denoted as x
  • the second quantity threshold can be expressed as total capacity*x%, where * means multiplication and x is a positive number.
  • the second number threshold can be dynamically adjusted.
  • the terminal may send the second quantity threshold to the storage device multiple times, and the storage device may update the stored second quantity threshold to the received second quantity threshold every time it receives the second quantity threshold from the terminal.
  • the storage device can dynamically adjust the number of second areas.
  • the second number threshold originally set by the storage device is c.
  • the storage device determines whether the number of the second area is lower than d. When the number of the second area is lower than d, execute the subsequent steps to check the area on the disk.
  • the storage format is converted to obtain more second areas until the number of second areas reaches d.
  • the terminal sends the second number threshold e to the storage device, and the storage device re-judges whether the number of the second area is lower than e by updating the second number threshold to e. If the number of the second area is lower than e, execute Under up steps to obtain more second regions until the number of second regions reaches e. Then, if d is less than e, the number of second regions can be adjusted to e on the basis of d, thereby further increasing the number of second regions.
  • the processor can determine whether the cold data stored in the storage device reaches the set first ratio threshold, and if the cold data reaches the set first ratio threshold, the following step 702 is executed.
  • the cold data refers to data whose access frequency is lower than a temperature threshold, and the temperature threshold may be stored in the memory of the storage device in advance.
  • the processor can obtain the data volume of cold data stored in each area and the data volume of all data stored in each area, and obtain the difference between the data volume of cold data and the data volume of all data.
  • the ratio is used as the ratio of the cold data stored in the storage device, and the ratio of the cold data is compared with the set first ratio threshold, so as to determine whether the cold data reaches the set first ratio threshold.
  • the first area may be a PMR area
  • the second area may be an SMR area.
  • the first ratio threshold can be set according to experiment, experience or demand, and the specific value of the first ratio threshold is not limited in this embodiment.
  • the first ratio threshold may be stored in a storage device in advance, for example, stored in a memory of the storage device.
  • the processor can read the first ratio threshold value from the memory.
  • the user may input the first ratio threshold value on the terminal, the terminal may obtain the first ratio threshold value input by the user, the terminal may send the first ratio threshold value to the storage device, and the storage device may receive the first ratio threshold value from the terminal.
  • the first ratio threshold is arranged according to experiment, experience or demand, and the specific value of the first ratio threshold is not limited in this embodiment.
  • the first ratio threshold may be stored in a storage device in advance, for example, stored in a memory of the storage device.
  • the processor can read the first ratio threshold value from the memory.
  • the user may input the first ratio threshold value on the terminal, the terminal may obtain the first ratio threshold value input by the user, the terminal may send the first ratio threshold value to the storage device
  • the first ratio threshold can be dynamically adjusted.
  • the terminal may send the first proportion threshold to the storage device multiple times, and the storage device may update the stored first proportion threshold to the received first proportion threshold every time it receives the first proportion threshold from the terminal.
  • the condition (4) may include: whether the cold data stored in the storage device reaches the set first ratio threshold, and whether the growth of the cold data stored in the storage device reaches the target time period Set the first increase threshold.
  • the system controller can obtain the proportion of cold data stored in the storage device and the increase in the amount of cold data stored in the storage device within the target time period; determine whether the cold data stored in the storage device reaches Set the first proportion threshold, and whether the growth in the target time period reaches the set first growth threshold; if the cold data stored in the storage device has reached the set first proportion threshold, and within the preset time period
  • the growth amount has reached the set first growth threshold, indicating that the data stored in the storage device is colder, and the temperature of the stored data is changing to a colder trend, then it is determined that a cooler one-level storage is currently required, and the next
  • the step 702 is described to convert the PMR area into the SMR area.
  • the target time period may be a recent period of time. For example, the time length of the target time
  • the processor can obtain the proportion of the thermal data stored in the storage device and determine whether the thermal data stored in the storage device reaches the set second proportion threshold. If the thermal data reaches the set If the second ratio threshold is set, the following step 702 is executed.
  • thermal data is also called hot data
  • thermal data refers to data whose access frequency is higher than the temperature threshold.
  • the processor can obtain the data volume of the thermal data stored in each area and the data volume of all the data stored in each area, and obtain the ratio between the data volume of the thermal data and the data volume of all data. As the ratio of the thermal data stored in the storage device, the ratio of the thermal data is compared with the set first ratio threshold to determine whether the thermal data reaches the set first ratio threshold.
  • condition (5) if condition (5) is adopted to perform step 701, the first area may be an SMR area, and the second area may be a PMR area.
  • the processor can determine whether the thermal data in the storage device reaches the set second proportional threshold under the scenario where the temperature of the data rises. If the thermal data reaches the set second proportional threshold, it will The SMR area is converted to the PMR area, thereby obtaining more PMR areas. Then due to the large proportion of the hot data stored in the storage device, the IOPS requirement for the storage device is higher. Therefore, the SMR area of the storage device is converted to the PMR area, because the PMR method is compared with the SMR method. , IOPS is higher, which can increase the IOPS of the storage device, thereby improving the performance of the storage device.
  • the second ratio threshold can be set according to experiment, experience, or demand, and the specific value of the second ratio threshold is not limited in this embodiment.
  • the second ratio threshold may be stored in a storage device in advance, for example, in a memory of the storage device.
  • the processor can read the second ratio threshold value from the memory.
  • the user may input the second ratio threshold value on the terminal, the terminal may obtain the second ratio threshold value input by the user, the terminal may send the second ratio threshold value to the storage device, and the storage device may receive the second ratio threshold value from the terminal.
  • the second ratio threshold is arranged according to experiment, experience, or demand, and the specific value of the second ratio threshold is not limited in this embodiment.
  • the second ratio threshold may be stored in a storage device in advance, for example, in a memory of the storage device.
  • the processor can read the second ratio threshold value from the memory.
  • the user may input the second ratio threshold value on the terminal, the terminal may obtain the second ratio threshold value input by the user, the terminal may send the second ratio threshold value to the storage device
  • the second ratio threshold can be dynamically adjusted.
  • the terminal may send the second proportion threshold value to the storage device multiple times, and the storage device may update the stored second proportion threshold value to the received second proportion threshold value whenever the storage device receives the second proportion threshold value from the terminal.
  • the condition (5) may include: whether the thermal data stored in the storage device reaches the set second ratio threshold, and whether the increase in the thermal data stored in the storage device reaches the target time period Set the second increase threshold.
  • the system controller can obtain the proportion of the hot data stored in the storage device and the increase of the hot data stored in the storage device within the target time period; determine whether the hot data stored in the storage device reaches Set the second proportion threshold, and whether the growth within the target time period reaches the set second growth threshold; if the thermal data stored in the storage device has reached the set second proportion threshold, and within the preset time period The growth of has reached the set second growth threshold, indicating that the data stored in the storage device is hotter, and the temperature of the stored data changes to a hotter trend, then it is determined that a higher IOPS storage is currently required, and the following Step 702, to convert the SMR area into a PMR area.
  • the processor can obtain the IOPS of the storage device and determine whether the IOPS of the storage device is lower than the set read and write threshold. If the IOPS is lower than the set read and write threshold, perform the following steps 702.
  • the first area may be an SMR area
  • the second area may be a PMR area.
  • the processor determines whether the IOPS of the storage device is lower than the set read and write threshold, and if the IOPS is lower than the set read and write threshold, it converts the SMR area into a PMR area. So as to get more PMR area. Then, because the PMR method has higher IOPS than the SMR method, it can increase the IOPS of the storage device, thereby improving the performance of the storage device.
  • the reading and writing threshold can be set according to experiment, experience or demand, and the specific value of the reading and writing threshold is not limited in this embodiment.
  • the read and write threshold may be stored in a storage device in advance, for example, in a memory of the storage device.
  • the processor can read the read and write threshold from the memory.
  • the user can input the read and write threshold on the terminal, the terminal can obtain the read and write threshold entered by the user, the terminal can send the read and write threshold to the storage device, and the storage device can receive the read and write threshold from the terminal. Threshold.
  • the read and write threshold can be adjusted dynamically.
  • the terminal may send the read and write threshold to the storage device multiple times, and whenever the storage device receives the read and write threshold from the terminal, it may update the stored read and write threshold to the received read and write threshold.
  • the above conditions (1) to (6) can be combined in two or more combinations.
  • the way of combination may include a combination of and and a combination of or.
  • the processor can determine whether the free space of the storage device is lower than the set space threshold, and whether the number of PMR areas is higher than the set first Quantity threshold; if the free space of the storage device is lower than the set space threshold, and the number of PMR areas is higher than the set first number threshold, it indicates that the current free space of the storage device is insufficient and there are enough PMR areas to be converted. Then the following step 702 is executed.
  • Step 702 If the storage device meets the preset condition, the processor selects the first area.
  • the area before the storage format conversion is called the first area
  • the area after the storage format conversion is called the second area.
  • the processor may select the first area from at least two areas in the disc, so as to convert the selected first area into the second area.
  • the first area uses a first storage format to store data
  • the second area uses a second storage format to store data.
  • the first storage format and the second storage format are respectively one of the SMR mode and the PMR mode, and the first storage format and the second storage format are different.
  • the first area may be an SMR area
  • the second area may be a PMR area
  • the first area uses an SMR method to store data
  • the second area uses a PMR method to store data
  • the first area may be a PMR area
  • the second area may be an SMR area
  • the first area uses a PMR method to store data
  • the second area uses an SMR method to store data.
  • the processor may obtain the free space of the storage device before selecting the first area, and determine whether the free space is greater than or equal to the space of a second area, and if the free space is greater than or equal to the space of a second area Space, and then select the first area. For example, if the storage device is an SMR disk, the processor of the SMR disk can determine whether the SMR disk has free space, and the free space is greater than 1 PMR area, and if the free space is greater than 1 PMR area, select the SMR area to be converted.
  • the processor of the PMR disk can determine whether the PMR disk has free space, and the free space is greater than 1 SMR area, and if the free space is greater than 1 SMR area, select the PMR area to be converted.
  • the processor can select A plurality of consecutive SMR regions is used as the first region.
  • the number of selected SMR areas can be an integer multiple of a preset ratio, which is the ratio between the capacity of the PMR area and the capacity of the SMR area. For example, if one PMR area is 60 SMR areas, the preset ratio is Let the ratio be 60.
  • SMR area 0 to SMR area 59 can be selected, these 60 SMR areas can be used as the first area, and the 60 SMR areas can be subsequently converted into 1 PMR area.
  • SMR regions 0 to SMR regions 119 can be selected, these 120 SMR regions can be used as the first region, and the 120 SMR regions can be subsequently converted into 2 PMR regions.
  • Step 703 The processor migrates the data stored in the first area to other areas of the storage device.
  • the processor can select other areas that are different from the first area from the storage device, and migrate the data stored in the first area to other areas, so as to organize the data stored in the first area to other locations in advance, avoiding the storage in the first area. Data loss, to achieve the effect of backing up the data stored in the first area.
  • the other area may be an idle area, and the capacity of the other area may be greater than or equal to the capacity of the first area.
  • the processor may mark the first area as a convertible area after migrating data in the first area. Whenever you want to perform the steps of converting the storage format, you can select the area marked as the convertible area to convert the convertible area. In this way, if the processor migrates the data of the N first areas, it can mark the N first areas as convertible areas. If the storage format of the M convertible areas in the N convertible areas is converted, The converted second area is sufficient, and the processor can stop performing the step of converting the storage format. At this time, the storage device still has (NM) convertible areas that have not been converted.
  • N and M are positive integers, and N is greater than M.
  • the processor may generate convertible area information, store the convertible area information in the memory, the convertible area information is used to record the convertible area, and the convertible area information may include each convertible area.
  • the area ID After the processor migrates data in any area, the area can be used as a convertible area, and the area identifier of the area can be written into the convertible area information.
  • the processor needs to convert the storage format of the convertible area, it can read the area identifier of the area from the convertible area information, and determine the area corresponding to the area identifier as the convertible area.
  • Step 704 The processor instructs the first area to convert the first storage format into a second storage format to obtain the second area.
  • the processor may instruct the SMR area to convert the storage format from the SMR mode to the PMR mode to obtain the PMR area.
  • the processor may instruct the PMR area to convert the storage format from the PMR mode to the SMR mode to obtain the SMR area.
  • the function of converting the storage format can be implemented by enabling the parameters corresponding to the new storage format and disabling the parameters corresponding to the old storage format.
  • the first area may be pre-configured with the first parameter and the second parameter.
  • the first parameter is used to support the first storage format
  • the second parameter is used to support the second storage format.
  • the processor may instruct the first region to enable the second parameter and disable the first parameter.
  • the parameters of the first area will be updated from the first parameter to the second parameter.
  • the first area will use the second parameter.
  • the supported storage format is used to store data, and the storage format supported by the first parameter is no longer used to store data, thereby realizing the function of converting the storage format.
  • the first area is an SMR area
  • the second area is a PMR area
  • the first storage format is SMR
  • the second storage format is PMR
  • the first parameter refers to a parameter for supporting SMR, that is, SMR
  • the second parameter refers to the parameter used to support the PMR mode, that is, the disk format of the PMR area.
  • the processor instructs the SMR area to enable the parameters that support the PMR mode, and to disable the parameters that support the SMR mode, so as to update the parameters of the SMR area to the parameters that support the PMR mode, and also convert the storage format of the SMR area from SMR mode to
  • the PMR method also converts the SMR area into a PMR area.
  • the first area is a PMR area
  • the second area is an SMR area
  • the first storage format is the PMR mode
  • the second storage format is the SMR mode
  • the first parameter refers to the parameter used to support the PMR mode. That is, the disk format of the PMR area
  • the second parameter refers to the parameter used to support the SMR mode, that is, the disk format of the SMR area.
  • the processor enables the parameters supporting the SMR mode by instructing the PMR area, and disables the parameters supporting the PMR mode, thereby updating the parameters in the PMR area to the parameters supporting the SMR mode, and also converting the storage format of the PMR area from the PMR mode to
  • the SMR method also converts the PMR area into an SMR area.
  • the first parameter may include one or more sub-parameters.
  • the first parameter may include any one of flying height, BPI, TPI, the distance between the read head and the write head on the tangent line, the distance between the read head and the write head in the radial direction, and a combination thereof.
  • the second parameter may also include one or more sub-parameters.
  • the first parameter may include any one of flying height, BPI, TPI, the distance between the read head and the write head on the tangent line, the distance between the read head and the write head in the radial direction, and a combination thereof.
  • the memory may instruct the first area to enable each sub-parameter of the second parameter, and disable each sub-parameter of the first parameter. For example, if the first parameter is used to support the SMR mode and the second parameter is used to support the PMR mode, the memory can instruct the first region to enable TPI and BPI for supporting the SMR mode, and disable TPI and BPI for supporting the PMR mode. BPI.
  • the first parameter and the second parameter can be configured for each of the N areas in advance, and the storage device is configured with 2N types of parameters in total.
  • N is a positive integer.
  • the first parameter and the second parameter of each area can be configured during the factory test phase of the storage device.
  • a factory manufactures HDDs
  • it can store the first parameter and the second parameter of each area in the HDD's memory (such as flash memory).
  • the processor can read the pre-configured first parameter or second parameter of the first area from the memory.
  • each storage unit on the PMR disk is a PMR area, and each PMR area will permanently store data in a PMR manner.
  • the PMR area is not used to store data, but used as a buffer between different SMR areas . That is, each area used for storing data on the SMR disk is also an SMR area, and each SMR area will always use the SMR method to store data.
  • the storage format of each storage unit on the disk is fixed. Either only the PMR method or the SMR method will be used instead of the two. Convert between the storage formats.
  • the PMR disk only parameters that support the PMR method are stored in the PMR disk, but parameters that support the SMR method are not stored, so the PMR area cannot be switched to the SMR area.
  • the SMR disk only stores the parameters that support the SMR mode, but does not store the parameters that support the PMR mode, so the SMR area cannot be switched to the PMR area.
  • both the parameters supporting the SMR mode and the parameters supporting the PMR mode are configured. According to the requirements, one of the parameters can be enabled, and the other can be disabled.
  • the number of first regions to be converted may be multiple, and the storage device may sequentially convert the multiple first regions.
  • the storage device may sequentially instruct the plurality of first regions to convert the first storage format into the second storage format according to the order in which the plurality of first regions are arranged on the storage device.
  • each first area may be a ring on the disk of the storage device, multiple first areas may be distributed in a concentric circle, and the processor may instruct multiple first areas in sequence from the outer radius to the inner radius. The area converts the first storage format into the second storage format, or in order from the inner radius to the outer radius, sequentially instructs a plurality of first areas to convert the first storage format into the second storage format.
  • the processor may continue to determine whether the storage device meets the preset condition, and if the storage device does not meet the preset condition, Then continue to select the first area, convert the storage format of the first area that continues to be selected, and obtain more second areas. By repeating such steps, the storage device can gradually approach to meet the preset conditions. When the device has met the preset condition, the step of converting the storage format can be stopped. In this way, the storage device can be controlled to a state that satisfies the preset condition, thereby expanding the control function of the storage device.
  • the processor can continue to instruct other PMR areas to also change the storage format from PMR Convert to the SMR mode, thereby converting to obtain more SMR areas, to pass more SMR areas, and continue to increase the free space of the storage device until the free space of the storage device reaches the set space threshold.
  • the size of the free space of the storage device can be controlled at about the space threshold.
  • the processor may continue to instruct other The first area converts the storage format from the first storage format to the second storage format, thereby converting more second areas, to continue to increase the number of second areas of the storage device, until the number of second areas of the storage device reaches The second number threshold.
  • the number of second areas of the storage device can be controlled at about the second number threshold.
  • the second number threshold is K
  • the number of SMR areas or the number of PMR areas can be reduced by executing the method provided in this embodiment. Control around K, where K is a positive integer.
  • the storage device may migrate the data stored in the first area selected next time to the second area converted last time in. For example, in the scenario of converting from SMR area to PMR area, after the storage device converts SMR area 1 to PMR area 1, when the storage format of SMR area 2 is to be converted, you can first change the storage format of SMR area 2 The data is migrated to PMR area 1, and then SMR area 1 is converted.
  • the storage device may also migrate the data stored in the first area that is continuously selected to other areas, which is not limited in this embodiment.
  • the processor may store data in the second area.
  • the processor may obtain the data in the write request, and store the data in the write request in the second area.
  • the processor may migrate data stored in other areas to the second area. For example, if the second area is an SMR area, cold data stored in other areas can be migrated to the second area; and if the second area is a PMR area, hot data stored in other areas can be migrated to the second area. Area.
  • the storage device may store a corresponding relationship between an area identifier and an area type, and the corresponding relationship includes at least one area identifier and an area type corresponding to each area identifier, for example, as shown in Table 1 below.
  • the processor instructs the first area to convert the first storage format to the second storage format, it can query the area type corresponding to the area identifier in the correspondence relationship according to the area identifier of the first area, and update the area type to the second The area type corresponding to the storage format. For example, if the processor instructs area 1 to convert the storage format from the SMR mode to the PMR mode, after converting the storage format of area 1, the SMR area corresponding to area 1 in Table 1 below can be updated to the PMR area.
  • the area identification is used to identify the corresponding area, for example, it may be an identification identifier (full English name: identification, English abbreviation: ID), number, etc. of the area, and the area identification may be allocated by the storage device for each area of the disk.
  • the area type may include two types of SMR area and PMR area.
  • the corresponding relationship between the region identifier and the region type can be stored in the memory (such as flash memory) of the storage device.
  • the terminal can read the corresponding relationship from the memory of the storage device.
  • each region in the storage device can be known Which type is used to know the current number of SMR areas and the number of PMR areas of the storage device, and present the number of SMR areas and the number of PMR areas to the upper application so that the upper application can manage the storage device.
  • the processor may record the number of SMR areas and the number of PMR areas of the storage device.
  • the memory of the storage device may store record information including the number of SMR areas and the number of PMR areas. After the storage device instructs the first area to convert the storage format, the record information may be updated. For example, if the storage device converts k SMR areas into m PMR areas, the number of SMR areas in the record information can be reduced by k, and the number of PMR areas in the record information can be increased by m. Where k and m are positive integers.
  • FIG. 8 shows that the SMR disc switches the SMR area in the disc from the SMR area to the PMR area.
  • Step 1 Determine whether the free capacity is greater than or equal to 1 PMR area. If yes, go to step 2; if no, end.
  • Step 2 Migrate data stored in multiple consecutive SMR regions to other regions.
  • Step 3 Judge whether the data migration is over, if yes, go to step 4, if not, end.
  • Step 4 Mark the SMR area where the data migration is completed as a convertible area.
  • Step 5 Instruct the switchable area to enable the parameters supporting the PMR mode, and disable the parameters supporting the SMR mode.
  • Step 6 It is judged whether the current number of PMR areas is lower than the set second number threshold, if yes, continue to execute the above steps 2 to 6, if not, end.
  • FIG. 9 shows that the PMR disk switches the PMR area in the disk from the PMR area to the SMR area.
  • Step 1 Determine whether the free capacity is greater than or equal to 1 SMR area. If yes, go to step 2; if no, end.
  • Step 2 Migrate the data stored in the PMR area to other areas.
  • Step 3 Judge whether the data migration is successful, if yes, proceed to step 4, if not, end.
  • Step 4 Mark the PMR area where the data migration is completed as a convertible area.
  • Step 5 Instruct the convertible area to enable the parameters supporting the SMR mode, and disable the parameters supporting the PMR mode.
  • Step 6 It is judged whether the current number of SMR areas is lower than the set second number threshold, if yes, continue to perform the above steps 2 to 6, if not, end.
  • the storage device may include a processor and a large number of regions.
  • the processor can control one or more areas to switch flexibly between the SMR area and the PMR area by executing each step in the above method embodiment, so as to find a balance between storage capacity and IOPS, that is, if the current need to change If there is more storage capacity, the PMR area will be converted to the SMR area. If the current IOPS needs to be increased, the SMR area will be converted to the PMR area.
  • the switching direction may be bidirectional, that is, the control area may be switched from the SMR area to the PMR area, or the control area may be switched from the PMR area to the SMR area.
  • HDDs are divided into various specifications and models according to different storage capacities. For example, HDDs with a storage capacity of 1 terabyte (English full name: terabyte, English abbreviation: TB) are recorded as specification 1. , HDD with a storage capacity of 1.1TB is recorded as specification 2, and HDD with a storage capacity of 1.2TB is recorded as specification 3. Due to the large number of specifications and models, it is more inconvenient for HDD manufacturers to produce and sell HDDs. With the method provided in this embodiment, the storage capacity of the HDD can be a variable that can be dynamically changed within a range.
  • the minimum value of the range can be that when each area in the HDD is a PMR area, the HDD
  • the maximum storage capacity of this range can be the storage capacity of the HDD when each area in the HDD is an SMR area.
  • the specific value of the variable can be controlled by the HDD processor or system controller by converting the storage format of the area. In this way, since the storage capacity of the HDD is no longer a fixed and single value corresponding to the specification, but a variable that can be dynamically adjusted according to demand, the specification and model of the HDD can be reduced or even eliminated. For example, HDD may not distinguish whether the specification model is specification 1, specification 2 or specification 3, but record 1T to 1.2T as one specification. If you need to increase the storage capacity, control more PMR areas to convert to SMR areas.
  • the test tasks of hard disks of various specifications and models can be merged, thereby reducing the overhead of test tasks.
  • a total of 3 test strategies need to be designed, and 3 test strategies are used to test HDDs of 3 specifications.
  • the specification 1, specification 2, and specification 3 can be combined into one specification, a test strategy is designed for the specification, and the test strategy can be used to test the HDD of the specification. It can reduce the pressure of hard disk manufacturers and storage service providers to carry out testing work.
  • the update tasks of hard disks of various specifications and models can be merged, thereby reducing the cost of updating.
  • the update task to perform fault repair as an example, if a certain fault occurs in the HDD, it is necessary to design a fault repair strategy for the HDDs of size 1, size 2 and size 3. A total of 3 fault repair strategies need to be designed. And adopt 3 kinds of failure repair strategies to test 3 kinds of HDD respectively.
  • specification 1, specification 2, and specification 3 can be combined into one specification, and a fault repair strategy is designed for the specification, and the HDD of the specification can be repaired by using the fault repair strategy. In this way, the pressure on hard disk manufacturers and storage service providers to perform updates can be reduced.
  • the PMR area is obtained by converting the storage format of the SMR area from the SMR mode to the PMR mode. Since the PMR mode has higher IOPS compared to the SMR mode, the storage format can be improved after conversion. Regional IOPS, and can further improve the overall IOPS of the storage device.
  • the SMR area can be obtained by converting the storage format of the PMR area from the PMR method to the SMR method. Since the SMR method has a higher storage capacity than the PMR method, the storage capacity of the area can be increased after the storage format is converted , And can further increase the storage capacity of the storage device.
  • FIG. 10 is a flowchart of a hard disk format conversion method provided by an embodiment of the present application. As shown in FIG. 10, the method can be applied to the storage device shown in FIG. 6, for example, the system controller 601 of the storage device 600 carried out. The method includes the following steps 1001 to 1004:
  • Step 1001 The system controller determines whether the storage device meets a preset condition.
  • the preset condition may include any one of the following conditions (1) to (6) and combinations thereof:
  • the system controller can obtain the free space of the storage device and determine whether the free space of the storage device is lower than the set space threshold, and if the free space of the storage device is lower than the set space threshold, Then the following step 1002 is executed. Among them, the system controller can obtain the free space of each disk in the storage device, and determine the sum of the free space of all the disks as the free space of the storage device.
  • step 1001 is performed according to condition (1)
  • the system controller can convert the storage format of the PMR disk from PMR mode to SMR by determining that the storage device meets condition (1) when the free space of the storage device is insufficient. In this way, an SMR disk is obtained. Compared with the PMR disk, the storage capacity of the SMR disk is higher. Therefore, the storage capacity of the storage device can be increased, thereby solving the problem of insufficient free space.
  • the space threshold can be set according to experiment, experience, or requirements, and the specific value of the space threshold is not limited in this embodiment.
  • the space threshold may be pre-stored in the system controller.
  • the space threshold may be stored in the memory of the system controller.
  • the system controller can read the space threshold from the memory.
  • the user can input the space threshold on the terminal, the terminal can obtain the space threshold input by the user, the terminal can send the space threshold to the system controller, and the system controller can receive the space threshold from the terminal.
  • the spatial threshold can be adjusted dynamically.
  • the terminal may send the space threshold to the system controller multiple times, and the system controller may update the stored space threshold to the received space threshold each time it receives the space threshold from the terminal.
  • the system controller can dynamically adjust the size of the free space.
  • the space threshold originally set by the system controller is a.
  • the system controller determines whether the free space is lower than a, and if the free space is less than a, executes the following steps to convert the storage format of the PMR disk from PMR to In SMR mode, until the free space reaches a, the free space of the storage device is controlled to a. After that, the terminal sends the space threshold b to the system controller.
  • the system controller re-judges whether the free space is lower than b by updating the space threshold to b.
  • the free space is less than b, perform the following steps to store other PMR disks
  • the format is also converted from the PMR mode to the SMR mode, thereby obtaining more SMR disks, until the free space reaches b, thereby controlling the free space to b.
  • the system controller can dynamically adjust the free space from a to b, which improves flexibility.
  • b and a are positive numbers, and b and a are different.
  • the system controller can obtain the number of the first disk in the storage device and determine whether the number of the first disk in the storage device is higher than the set first number threshold. If it is higher than the set first number threshold, the following step 1002 is executed.
  • the system controller can convert more second disks in a scenario where the number of first disks is sufficient to meet storage capacity or performance requirements.
  • the first disk may be an SMR disk. It is determined whether the SMR disk is higher than the set first number threshold. If the number of SMR disks is higher than the set first number threshold, the following steps are executed to remove the SMR disk. The storage format of the disk is converted from the SMR mode to the PMR mode, thereby converting the PMR disk, then since the PMR disk has a higher IOPS compared to the SMR disk, the IOPS can be increased, thereby improving the performance of the storage device.
  • the first disk may be a PMR disk.
  • the first number threshold can be set according to experiment, experience, or demand, and the specific value of the first number threshold is not limited in this embodiment.
  • the first number threshold may be pre-stored in the system controller, for example, in the memory of the system controller.
  • the system controller can read the first number threshold value from the memory.
  • the user can input the first number threshold value on the terminal, the terminal can obtain the first number threshold value input by the user, and the terminal can send the first number threshold value to the system controller, and the system controller can download The terminal receives the first number threshold.
  • the first number threshold can be dynamically adjusted.
  • the terminal may send the first quantity threshold to the system controller multiple times, and the system controller may update the stored first quantity threshold to the received first quantity whenever the system controller receives the first quantity threshold from the terminal. Threshold.
  • the system controller can dynamically adjust the number of the first disk.
  • the first number threshold originally set by the system controller is c, and the system controller determines whether the number of the first disk is higher than c, and if the number of the first disk is higher than c, executes the subsequent steps, The storage format of one disk is converted, thereby reducing the number of the first disk and obtaining more second disks.
  • the terminal sends the first number threshold d to the system controller, and the system controller re-judges whether the number of the first disk is higher than d by updating the first number threshold to d, and when the number of the first disk is higher than d , Perform the next steps to get more second discs. Then, if d is less than c, after the storage format of the hard disk has been converted, the number of the first disk can be further reduced to increase the number of the second disk.
  • the system controller can obtain the number of second disks in the storage device and determine whether the number of second disks in the storage device is lower than the set second number threshold. If the number of second disks is If it is lower than the second set threshold, the following step 1002 is executed.
  • the system controller can convert more second disks to meet storage capacity or performance requirements in a scenario where the number of second disks is insufficient.
  • the second disk may be an SMR disk. It is determined whether the SMR disk in the storage device is lower than the set second number threshold. If the number of SMR disks is lower than the set second number threshold, then Perform the following steps to convert the storage format of the PMR disk from the PMR mode to the SMR mode to obtain the SMR disk, so that the storage device can include more SMR disks and ensure that the number of SMR disks can meet the demand. Moreover, since the SMR disk has a higher storage capacity than the PMR disk, the storage capacity of the storage device can be increased.
  • the second disk may be a PMR disk. It is determined whether the PMR disk in the storage device is lower than the set second number threshold. If the number of PMR disks is lower than the set second number threshold, By performing the subsequent steps, the storage format of the SMR disk can be converted from the SMR mode to the PMR mode, so that the storage device can include more PMR disks and ensure that the number of PMR disks can meet the demand. In addition, since PMR disks have higher IOPS compared to SMR disks, IOPS can be increased, thereby improving the performance of storage devices.
  • the second number threshold and the first number threshold may be the same or different.
  • the present embodiment does not limit the relationship between the second number threshold and the first number threshold.
  • the second number threshold can be set according to experiment, experience or demand, and the specific value of the second number threshold is not limited in this embodiment.
  • the second number threshold may be pre-stored in the system controller, for example, stored in the memory of the system controller.
  • the system controller can read the second number threshold value from the memory.
  • the user can input the second number threshold on the terminal, the terminal can obtain the second number threshold entered by the user, and the terminal can send the second number threshold to the system controller, and the system controller can download The terminal receives the second number threshold.
  • the second number threshold may be expressed as the product of the total number of disks in the storage device and the ratio threshold.
  • the ratio threshold is the ratio between the total number of the second disk and the total number of the first disk.
  • the unit can be a percentage, and the ratio threshold indicates the proportion of the second disk in the storage device.
  • the ratio threshold is denoted as x
  • the second number threshold can be expressed as the total number of disks*x%. Where x is a positive number.
  • the second number threshold can be dynamically adjusted.
  • the terminal may send the second quantity threshold value to the system controller multiple times, and the system controller may update the stored second quantity threshold value to the received second quantity whenever it receives the second quantity threshold value from the terminal. Threshold.
  • the system controller can dynamically adjust the number of second disks.
  • the second number threshold originally set by the system controller is c. The system controller determines whether the number of the second disk is less than d, and if the number of the second disk is less than d, executes the subsequent steps to perform The storage format is converted to get more second disks until the number of second disks reaches d.
  • the terminal sends the second number threshold e to the system controller, and the system controller re-judges whether the number of the second disk is lower than e by updating the second number threshold to e.
  • the system controller re-judges whether the number of the second disk is lower than e by updating the second number threshold to e.
  • the number of the second disk is lower than e .
  • the number of second discs can be adjusted to e on the basis of d, thereby further increasing the number of second discs.
  • the system controller can obtain the proportion of cold data stored in the storage device and determine whether the cold data stored in the storage device reaches the set first proportion threshold. If the cold data reaches the set If the first ratio threshold is set, the following step 1002 is executed.
  • cold data refers to data whose access frequency is lower than a temperature threshold
  • the temperature threshold may be stored in the system controller in advance.
  • the system controller can obtain the data volume of the cold data stored in each disk and the data volume of all the data stored in each disk, and the data volume of the cold data and the data volume of all data can be obtained.
  • the ratio of is used as the ratio of the cold data stored in the storage device, and the ratio of the cold data is compared with the set first ratio threshold to determine whether the cold data reaches the set first ratio threshold.
  • the first disk may be a PMR disk
  • the second disk may be an SMR disk.
  • the system controller can determine whether the cold data in the storage device reaches the set first ratio threshold in a scenario where the ratio of cold data is large, and if the cold data reaches the set first ratio threshold, Then, the PMR disk is converted to SMR disk, and more SMR disks are obtained. Then, on the one hand, due to the large proportion of cold data stored in the storage device, the IOPS requirement for the storage device is low. Therefore, even if the PMR disk is converted to an SMR disk, it will not be due to the reduction of PMR disks. , And too much affects the overall performance of the storage device. On the other hand, because SMR disks have a higher storage capacity than PMR disks, the overall storage capacity can be increased.
  • the first ratio threshold can be set according to experiment, experience or demand, and the specific value of the first ratio threshold is not limited in this embodiment.
  • the first ratio threshold may be stored in the system controller in advance, for example, in the memory of the system controller.
  • the system controller can read the first ratio threshold value from the memory.
  • the user may input the first proportional threshold value on the terminal, the terminal may obtain the first proportional threshold value input by the user, and the terminal may send the first proportional threshold value to the system controller, and the system controller may obtain The terminal receives the first ratio threshold.
  • the first ratio threshold can be dynamically adjusted.
  • the terminal may send the first ratio threshold to the system controller multiple times. Whenever the system controller receives the first ratio threshold from the terminal, it may update the stored first ratio threshold to the received first ratio. Threshold.
  • the condition (4) may include: whether the cold data stored in the storage device reaches the set first ratio threshold, and whether the growth of the cold data stored in the storage device reaches the target time period Set the first increase threshold.
  • the system controller can obtain the proportion of cold data stored in the storage device and the increase in the amount of cold data stored in the storage device within the target time period; determine whether the cold data stored in the storage device reaches Set the first proportion threshold, and whether the growth in the target time period reaches the set first growth threshold; if the cold data stored in the storage device has reached the set first proportion threshold, and within the preset time period The growth amount of has reached the set first growth threshold, which indicates that the data of the storage device is colder and the temperature of the data changes to a colder trend. If a cooler level of storage is required, the following step 1002 is executed.
  • the duration of the target time period may be a preset duration
  • the time end point of the target time period may be a current time point.
  • the system controller can obtain the proportion of the thermal data stored in the storage device and determine whether the thermal data stored in the storage device reaches the set second proportion threshold. If the thermal data reaches the set If the second ratio threshold is set, the following step 1002 is executed.
  • thermal data is also called hot data
  • thermal data refers to data whose access frequency is lower than a temperature threshold
  • the temperature threshold can be stored in a storage device in advance.
  • the system controller can obtain the data volume of the hot data stored on each disk and the data volume of all the data stored on each disk, and the data volume between the data volume of the hot data and the data volume of all data can be obtained.
  • the ratio is used as the ratio of the thermal data stored in the storage device, and the ratio of the thermal data is compared with the set first ratio threshold to determine whether the thermal data reaches the set first ratio threshold.
  • the first disk may be an SMR disk
  • the second disk may be a PMR disk.
  • the system controller can determine whether the thermal data in the storage device reaches the set second proportional threshold in a scenario where the proportion of thermal data is large, and if the thermal data reaches the set second proportional threshold, Then, the SMR disk is converted into a PMR disk, thereby obtaining more PMR disks. Then due to the large proportion of hot data stored in the storage device, the IOPS requirement for the storage device is higher. Therefore, the SMR disk of the storage device is converted to a PMR disk, because the PMR disk is relative to the SMR disk. , IOPS is higher, which can increase the IOPS of the storage device, thereby improving the performance of the storage device.
  • the second ratio threshold can be set according to experiment, experience, or demand, and the specific value of the second ratio threshold is not limited in this embodiment.
  • the second ratio threshold may be pre-stored in the system controller, for example, in a memory of the system controller.
  • the system controller can read the second ratio threshold value from the memory.
  • the user may input the second proportional threshold value on the terminal, the terminal may obtain the second proportional threshold value input by the user, and the terminal may send the second proportional threshold value to the system controller, and the system controller may obtain the second proportional threshold value from The terminal receives the second ratio threshold.
  • the second ratio threshold can be dynamically adjusted.
  • the terminal may send the second ratio threshold to the system controller multiple times. Whenever the system controller receives the second ratio threshold from the terminal, it may update the stored second ratio threshold to the received second ratio. Threshold.
  • the condition (05) may include: whether the thermal data stored in the storage device reaches the set second ratio threshold, and whether the increase in the thermal data stored in the storage device in the target time period reaches Set the second increase threshold.
  • the system controller can obtain the proportion of the hot data stored in the storage device and the increase of the hot data stored in the storage device within the target time period; determine whether the hot data stored in the storage device reaches Set the second proportion threshold, and whether the growth within the target time period reaches the set second growth threshold; if the thermal data stored in the storage device has reached the set second proportion threshold, and within the preset time period The growth amount of has reached the set second growth threshold, indicating that the data of the storage device is hotter, and the temperature of the data changes to a hotter trend, and higher IOPS is required, then the following step 1002 is performed.
  • machine learning that is, artificial intelligence (English full name: artificial intelligence, English abbreviation: AI) can be used to determine whether the data is cold data or hot data.
  • AI artificial intelligence
  • the value of the temperature label can include two types, one representing cold data and the other representing hot data. If the temperature label of the data represents cold data, it can be determined that the data is cold data, and if the temperature label of the data represents hot data, it can be determined that the data is hot data.
  • the classification model can be trained based on multiple sample data and the temperature label of each sample data.
  • the regression model is obtained by training based on multiple sample data and the temperature of each sample data.
  • the classification model or the regression model can be stored in the system controller in advance.
  • model training can be performed through massive sample data and the temperature label or temperature of each sample data to obtain a classification model or regression model.
  • the sample data can include different types, for example, can include text, pictures, videos, and so on.
  • Model training can be performed on the system controller, or model training can be performed on other devices, and the obtained classification model or regression model can be sent to the system controller.
  • the system controller can obtain the IOPS of the storage device and determine whether the IOPS of the storage device is lower than the set read and write threshold. If the IOPS is lower than the set read and write threshold, execute the following Step 1002.
  • the first disk may be an SMR disk
  • the second disk may be a PMR disk.
  • the system controller judges whether the IOPS of the storage device is lower than the set read and write threshold, and if the IOPS is lower than the set read and write threshold, it converts the SMR disk to a PMR disk , So as to get more PMR disks. Then, because PMR disks have higher IOPS than SMR disks, the IOPS of the storage device can be increased, thereby improving the performance of the storage device.
  • the reading and writing threshold can be set according to experiment, experience or demand, and the specific value of the reading and writing threshold is not limited in this embodiment.
  • the read and write threshold may be stored in the system controller in advance, for example, in the memory of the system controller.
  • the system controller can read the read and write threshold from the memory.
  • the user can input the read and write threshold on the terminal, the terminal can obtain the read and write threshold entered by the user, the terminal can send the read and write threshold to the system controller, and the system controller can receive the read and write threshold from the terminal.
  • Read and write threshold can be adjusted dynamically. Specifically, the terminal may send the read and write threshold to the system controller multiple times, and whenever the system controller receives the read and write threshold from the terminal, it may update the stored read and write threshold to the received read and write threshold.
  • the above conditions (1) to (6) can be combined in two or more combinations.
  • the method of combination may be an AND or an OR.
  • the system controller can determine whether the free space of the storage device is lower than the set space threshold, and whether the number of PMR disks is higher than the set first A number threshold; if the free space of the storage device is lower than the set space threshold and the number of PMR disks is higher than the set first number threshold, it indicates that the current free space of the storage device is insufficient and there are enough PMR disks to convert , Then perform the following step 1002.
  • Step 1002 if the storage device meets the preset condition, the system controller selects the first disk.
  • the disk before the storage format conversion is called the first disk
  • the disk after the storage format conversion is called the second disk.
  • the system controller may select the first disk from at least two disks in the storage device, so as to convert the selected first disk into the second disk.
  • the first disk uses a first storage format to store data
  • the second disk uses a second storage format to store data.
  • the first storage format and the second storage format are respectively one of the SMR mode and the PMR mode, and the first storage format and the second storage format are different.
  • the first disk may be an SMR disk, the first disk may use an SMR method to store data, the second disk may be a PMR disk, and the second disk may use a PMR method to store data.
  • the first disk may be a PMR disk, the first disk may store data in a PMR mode, the second disk may be an SMR disk, and the second disk may store data in an SMR mode.
  • Step 1003 The system controller migrates the data stored in the first disk to other disks in the storage device.
  • the system controller can select other disks different from the first disk from the storage device, and migrate the data stored on the first disk to other disks, so as to organize the data stored on the first disk to other locations in advance, avoiding the storage of the first disk The data is lost to achieve the effect of backing up the data stored on the first disk.
  • the other disks may be one or more idle disks, the idle disks may be completely idle or partially idle disks, and the capacity of the other disks may be greater than or equal to the capacity of the first disk.
  • the system controller determines that a colder storage is required, for example, the system controller determines that the storage device meets the preset condition (4), it can select a PMR disk that stores cold data, and set the PMR disk The stored cold data is migrated, and PMR disks are converted to SMR disks. If the system controller determines that a higher IOPS is required, for example, the system controller determines that the storage device meets the preset condition (5), it can select the SMR disk storing hot data, migrate the hot data stored in the SMR disk, and transfer the SMR The disk is converted to a PMR disk.
  • Step 1004 The system controller instructs the first disk to convert the first storage format into the second storage format to obtain the second disk.
  • the system controller can instruct the SMR disk to convert the storage format from the SMR mode to the PMR mode to obtain the PMR disk.
  • the system controller may instruct the PMR disk to convert the storage format from the PMR mode to the SMR mode to obtain the SMR disk.
  • the system controller may instruct the SMR disk to convert the storage format of each SMR area from the SMR mode to the PMR mode, and then each SMR area of the SMR disk becomes a PMR area, thereby converting Get the PMR disk.
  • the system controller can also instruct the SMR disk to convert part of the SMR area into the PMR area, and the remaining SMR area can be kept as the SMR area, thereby obtaining an SMR disk that includes both the SMR area and the PMR area.
  • the system controller can instruct the PMR disk to convert the storage format of each PMR area from the PMR mode to the SMR mode, and then each PMR area of the PMR disk becomes an SMR area, thereby converting it to an SMR disk.
  • the system controller can also instruct the PMR disk to convert part of the PMR area into the SMR area, and the remaining PMR area can be kept as the PMR area, thereby obtaining a PMR disk that includes both the SMR area and the PMR area.
  • the function of converting the storage format can be implemented by enabling the parameters corresponding to the new storage format and disabling the parameters corresponding to the old storage format.
  • the first disk may be pre-configured with the first parameter and the second parameter.
  • the first parameter is used to support the first storage format
  • the second parameter is used to support the second storage format.
  • the system controller can instruct the first disk to enable the second parameter and disable the first parameter.
  • the parameters of the first disk will be updated from the first parameter to the second parameter.
  • the first disk will use the second parameter.
  • the supported storage format is used to store data, and the storage format supported by the first parameter is no longer used to store data, thereby realizing the function of converting the storage format.
  • the first parameter refers to the parameter used to support the SMR mode, namely SMR
  • the second parameter refers to the parameter used to support the PMR mode, that is, the disk format of the PMR disk.
  • the system controller instructs the SMR disk to enable the parameters that support the PMR mode, and to disable the parameters that support the SMR mode, thereby converting the SMR disk to the PMR disk.
  • the first parameter refers to the parameter used to support the PMR mode, namely
  • the second parameter refers to the parameter used to support the SMR mode, that is, the disk format of the SMR disk.
  • the system controller instructs the PMR disk to enable the parameters that support the SMR mode, and to disable the parameters that support the PMR mode, thereby converting the PMR disk into an SMR disk.
  • the system controller may continue to determine whether the storage device meets the preset condition. If the storage device does not meet the preset condition, then Continue to select the first disk, convert the storage format of the first disk that continues to be selected, and get more second disks. By repeating such steps, the storage device can approach the preset conditions until the storage device has been Until the preset condition is met, the step of converting the storage format is stopped. In this way, the storage device can be controlled to a state that satisfies the preset condition, thereby expanding the control function of the storage device.
  • the system controller instructs the PMR disk to convert the storage format from PMR to SMR, and the free space of the storage device is still below the set space threshold, the system controller can continue to instruct other PMR disks to also change the storage format from The PMR mode is converted to the SMR mode, so that more SMR disks are obtained by conversion, and more SMR disks are used to continue to increase the free space of the storage device until the free space of the storage device reaches the set space threshold. In this way, the size of the free space of the storage device can be controlled at about the space threshold.
  • the system controller can continue Instruct other first disks to convert the storage format from the first storage format to the second storage format, so as to obtain more second disks, so as to continue to increase the number of second disks of the storage device until the second disk of the storage device The quantity reaches the second quantity threshold.
  • the number of second disks of the storage device can be controlled at about the second number threshold.
  • the second number threshold is K
  • the number of SMR disks or the number of PMR disks can be reduced by executing the method provided in this embodiment. Control around K, and K is a positive integer.
  • the storage device can migrate the data stored in the first disk selected next time to the second disk converted last time in. For example, in the scenario of converting from an SMR disk to a PMR disk, after the storage device converts SMR disk 1 to PMR disk 1, when the storage format of SMR disk 2 is to be converted, you can first change the storage format of SMR disk 2 The data is migrated to PMR disk 1, and then SMR disk 1 is converted.
  • the storage device can also migrate the data stored in the first disk that continues to be selected to other disks, which is not limited in this embodiment.
  • the system controller may store data in the second disk.
  • the processor may obtain the data in the write request, and store the data in the write request in the second disk.
  • the processor may migrate data stored in other disks to the second disk. Exemplarily, if the second disk is an SMR disk, cold data stored on other disks can be migrated to the second disk; and if the second disk is a PMR disk, hot data stored on other disks can be migrated to the second disk. Intraday.
  • the storage device may store a corresponding relationship between a disk identifier and a disk type, and the corresponding relationship includes at least one disk identifier and the disk type corresponding to each disk identifier, for example, as shown in Table 2 below.
  • the system controller instructs the first disk to convert the first storage format into the second storage format, it can query the disk type corresponding to the disk identifier in the correspondence relationship according to the disk identifier of the first disk, and update the disk type to the first disk identifier. 2.
  • Disk type corresponding to the storage format After the system controller instructs the first disk to convert the first storage format into the second storage format, it can query the disk type corresponding to the disk identifier in the correspondence relationship according to the disk identifier of the first disk, and update the disk type to the first disk identifier. 2. Disk type corresponding to the storage format.
  • Disk 1 For example, if the system controller instructs Disk 1 to convert the storage format from SMR to PMR, after converting the storage format of Disk 1, the SMR disk corresponding to Disk 1 in Table 2 below can be updated to PMR.
  • the disk identifier is used to identify the corresponding disk, for example, the disk ID, number, etc., and the disk identifier may be allocated by the system controller for each disk.
  • Disk types can include SMR disks and PMR disks.
  • the corresponding relationship between the disk identifier and the disk type can be stored in the memory of the system controller.
  • the terminal can read the corresponding relationship from the memory of the system controller.
  • each disk in the storage device is Which type
  • the system controller may record the number of SMR disks and the number of PMR disks of the storage device.
  • recording information can be stored in the upper-level application software.
  • the recording information includes the number of SMR disks and the number of PMR disks.
  • the storage device instructs the first disk to convert the storage format, it can be based on the current number of SMR disks and the number of PMR disks. Update the record information. For example, if the storage device converts k SMR disks into m PMR disks, the number of SMR disks in the recording information can be reduced by k, and the number of PMR disks in the recording information can be increased by m. Where k and m are positive integers.
  • FIG. 11 shows a flowchart of the storage device switching between an SMR disk and a PMR disk.
  • the flowchart shows the following steps 1 to 6:
  • Step 1 Determine the temperature of the data stored in the storage device through machine learning.
  • Step 2 Determine whether the temperature change of the data is greater than the set threshold, if yes, perform step 3, if not, end.
  • Step 3 Determine whether you need a cooler one-level storage or a higher IOPS. If it is determined that a cooler level of storage is required, perform the following step 4, if it is determined that a higher IOPS is required, perform the following step 6.
  • Step 4 Migrate the data of the PMR disk to other disks.
  • Step 5 Start the conversion mechanism from PMR disk to SMR disk.
  • Step 6 Migrate the data of the SMR disk to other disks.
  • Step 7 Start the conversion mechanism from SMR disk to PMR disk.
  • Step 8 Update the information of the PMR disk and the information of the SMR disk in the upper layer application.
  • the storage device may be used to provide massive data storage services, and the storage device may include a storage controller and a large number of disks.
  • the system controller can control one or more disks to switch between SMR disks and PMR disks flexibly by executing the steps in the above method embodiments, so as to find a balance between storage capacity and IOPS, that is, if currently required For more storage capacity, convert the disk to SMR disk, if the current need to increase IOPS, convert the disk to PMR disk.
  • the switching direction can be bidirectional, that is, the control disk can be switched from the SMR disk to the PMR disk, or the control disk can be switched from the PMR disk to the SMR disk.
  • the pure disk mentioned here refers to a disk with a single storage format.
  • the storage format is either SMR or PMR.
  • the hybrid disk mentioned here refers to a disk that includes two storage formats.
  • the mixed disk include SMR and PMR.
  • the method provided in this embodiment converts the storage format of the SMR disk from the SMR mode to the PMR mode to obtain the PMR disk. Since the PMR disk has a higher IOPS compared to the SMR disk, the storage format can be improved after conversion. Disk IOPS, and can improve the overall IOPS of the storage device. Or, by converting the storage format of the PMR disk from the PMR mode to the SMR mode, an SMR disk is obtained. Since the SMR disk has a higher storage capacity compared to the PMR disk, the storage capacity of the disk can be increased after the storage format is converted , And can increase the overall storage capacity of the storage device.
  • FIG. 12 is a schematic structural diagram of a hard disk format conversion device provided by an embodiment of the present application.
  • the device includes: a selection module 1201 for selecting a first storage unit, such as performing step 702 or performing step 1002;
  • the instruction module 1202 is configured to instruct the first storage unit to convert the first storage format into the second storage format to obtain the second storage unit, for example, execute step 704 or execute step 1004;
  • the device further includes: a judgment module, configured to execute step 701 or execute step 1001.
  • the preset condition includes any one of the preset condition (1) to the preset condition (6) in step 702 or step 1002 and a combination thereof:
  • the instruction module 1202 is specifically configured to instruct the first storage unit to enable the second parameter, and to disable the first parameter.
  • the device further includes: a migration module, configured to migrate the data stored in the first storage unit to other storage units, for example, perform step 703 or step 1003.
  • a migration module configured to migrate the data stored in the first storage unit to other storage units, for example, perform step 703 or step 1003.
  • the hard disk format conversion apparatus may be located in a storage device. Each step involved in the embodiment in FIG. 12 may be executed by a processor of the storage device calling instructions stored in the memory of the storage device.
  • the hard disk format conversion device may also be located in the disk, and each step involved in the embodiment in FIG. 12 may be executed by the processing chip of the disk.
  • the hard disk format conversion device may be located in the system controller of the disk array, and each step involved in the embodiment of FIG. 12 may be executed by the processor of the system controller calling the instructions stored in the memory of the system controller.
  • the hard disk format conversion device provided in the embodiment of FIG. 12 converts the hard disk format
  • only the division of the above-mentioned functional modules is used as an example.
  • the above-mentioned functions can be assigned to different functions according to needs.
  • Module completion means dividing the internal structure of the storage device into different functional modules to complete all or part of the functions described above.
  • the hard disk format conversion device provided by the above-mentioned embodiment and the embodiment of the hard disk format conversion method belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • This application also provides a computer program, which includes instructions for executing the above-mentioned hard disk format conversion method.
  • the computer program may include instructions for executing the hard disk format conversion method executed by the processor in the embodiment of FIG. 7; for another example, the computer program may include instructions for executing the method executed by the system controller in the embodiment of FIG. The instruction of the hard disk format conversion method.
  • the application also provides a computer-readable storage medium for storing a computer program, the computer program including instructions for executing the above-mentioned hard disk format conversion method.
  • the computer program product includes one or more computer program instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer program instructions may be transmitted from a website, computer, server, or data.
  • the center transmits to another website site, computer, server or data center through wired or wireless means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (DVD), or a semiconductor medium (for example, a solid state hard disk).
  • multiple in this application means two or more than two, for example, multiple data packets refer to two or more data packets.

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)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Digital Magnetic Recording (AREA)

Abstract

一种硬盘格式转换方法、装置及存储设备,属于存储技术领域。通过将存储单元的存储格式从SMR方式转换为PMR方式,由于PMR方式相对于SMR方式来说,IOPS更高,因此在转换存储格式后,可以提高存储单元的IOPS。或者,通过将存储单元的存储格式从PMR方式转换为SMR方式,由于SMR方式相对于PMR方式来说,存储容量更高,因此在转换存储格式后,可以提高存储单元的存储容量。

Description

硬盘格式转换方法、装置及存储设备 技术领域
本申请涉及存储技术领域,特别涉及一种硬盘格式转换方法、装置及存储设备。
背景技术
机械硬盘(英文全称:hard disk drive,英文简称:HDD)是一种应用广泛的存储介质,以其单位容量价格低廉的优势,在存储技术中扮演着举足轻重的作用。机械硬盘的盘体通常包括多个盘片,每个盘片的上表面或下表面称为磁面,磁面可以划分为多个磁道,一个或多个磁道可以组成机械硬盘的一个存储单元,可以在存储单元中存储需要存储的数据。
机械硬盘包括叠瓦片式磁记录(英文全称:shingle magnetic recording,英文简称:SMR)盘以及传统垂直磁记录(英文全称:perpendicular magnetic recording,英文简称:PMR)盘这两种类型。SMR盘的各个磁道类似于重叠的瓦片,相邻磁道之间会具有重叠的区域,因此SMR盘的盘面上能够容纳更多的磁道,使得SMR盘具有存储容量更高的优势。但是与此同时,由于在SMR盘的任一磁道上写入数据时,会影响到该磁道的相邻磁道,因此对于SMR盘的磁道组成的SMR区域来说,只能在SMR区域上采用顺序写的方式来存储数据,而不可以采用随机写的方式存储数据,这就导致对于SMR区域这种存储单元来说,其每秒读写次数(英文全称:input output per second,英文简称:IOPS)较低。而PMR盘中的各个磁道相互分开,相邻磁道之间具有一定的间隔,因此对于PMR盘的磁道组成的PMR区域来说,可以采用随机写的方式在PMR区域上存储数据,使得PMR盘具有IOPS更高的优势。但是与此同时,由于PMR盘的盘面上能够容纳的磁道的数量较少,导致对于PMR区域这种存储单元来说,其存储容量较小。
发明内容
本申请实施例提供了一种硬盘格式转换方法、装置及存储设备,能够解决相关技术中存储单元的IOPS较低或存储容量较小的技术问题。所述技术方案如下:
第一方面,提供了一种硬盘格式转换方法,所述方法应用于存储设备中,所述方法包括:
选取第一存储单元,所述第一存储单元采用第一存储格式存储数据;
指令所述第一存储单元将所述第一存储格式转换为第二存储格式,得到第二存储单元;
其中,所述第一存储格式和所述第二存储格式分别为叠瓦片式磁记录SMR方式或垂直磁记录PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
本实施例提供的方法,通过将存储单元的存储格式从SMR方式转换为PMR方式,由于PMR方式相对于SMR方式来说,IOPS更高,因此在转换存储格式后,可以提高存储单元的IOPS。或者,通过将存储单元的存储格式从PMR方式转换为SMR方式,由于SMR方式相对于PMR方式来说,存储容量更高,因此在转换存储格式后,可以提高存储单元的存储容量。
在一种可能的实现中,所述第一存储单元为SMR区域,所述第二存储单元为PMR区域;或者,所述第一存储单元为PMR区域,所述第二存储单元为SMR区域。
在一种可能的实现中,所述第一存储单元为SMR盘,所述第二存储单元为PMR盘;或者,所述第一存储单元为PMR盘,所述第二存储单元为SMR盘。
在一种可能的实现中,在所述选取第一存储单元之前,所述方法还包括:
判断所述存储设备是否满足预设条件。
通过设置预设条件,在存储设备满足预设条件时,再进行硬盘格式转换,可以让转换硬盘格式的时机更加灵活,并且可以将硬盘格式转换的功能与当前的情况结合起来。
在一种可能的实现中,所述预设条件包括以下条件中的任意一种及其组合:
所述存储设备的空闲空间是否低于设定的空间阈值,或者
所述第一存储单元的数量是否高于设定的第一数量阈值,或者
所述第二存储单元的数量是否低于设定的第二数量阈值,或者
所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
在存储设备的空闲空间不足的场景下,可以通过判断存储设备的空闲空间是否低于设定的空间阈值,如果存储设备的空闲空间低于设定的空间阈值,则进行硬盘格式转换,例如将存储单元的存储格式从PMR方式转换为SMR方式,那么由于SMR方式相对于PMR方式来说,存储容量更高,因此可以提高存储容量,从而提高存储设备的空闲空间,进而解决空闲空间不足的问题。
在第一存储单元的数量足够的场景下,可以通过判断第一存储单元的数量是否高于设定的第一数量阈值,如果第一存储单元的数量高于设定的第一数量阈值,则第一存储单元转换出更多的第二存储单元,以满足存储容量或性能的需求。
在第二存储单元的数量不足的场景下,可以通过确定第二存储单元的数量是否低于设定的第二数量阈值,通过第一存储单元转换出更多的第二存储单元,让存储设备包括的第二存储单元更多,以满足存储容量或性能的需求。
在存储的数据温度降低的场景下,可以通过判断存储设备中热数据是否达到设定的第二比例阈值,如果热数据达到设定的第二比例阈值,则将存储单元的存储格式从PMR方式转换为SMR方式。那么一方面,由于存储设备中存储的冷数据的比例较大,则对于该存储设备来说,IOPS的要求相对较低,因此即使将该PMR方式的存储单元转换为SMR方式的存储单元,也不会由于PMR方式的存储单元的减少,而过多的影响存储设备的性能。另一方面,由于SMR方式相对于PMR方式来说,存储容量更高,可以提高存储设备的存储容量。
在存储的数据温度升高的场景下,可以通过判断存储设备中冷数据是否达到设定的第一比例阈值,如果存储设备中冷数据达到设定的第一比例阈值,则将存储单元的存储格式从SMR方式转换为PMR方式,从而得到更多的PMR区域。那么由于存储设备中存储的热数据的比例较大,则对于该存储设备来说,IOPS的要求较高,由于PMR方式相对于SMR方式来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
在IOPS不满足需求的场景下,通过判断存储设备的IOPS是否低于设定的读写阈值,如果IOPS低于设定的读写阈值,则将存储单元的存储格式从SMR方式转换为PMR方式,那么由于PMR方式相对于SMR方式来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
在一种可能的实现中,所述存储设备中存储的冷数据是否达到设定的第一比例阈值,包括:所述存储设备中存储的冷数据是否达到所述设定的第一比例阈值,且存储设备中存储的冷数据在目标时间段内 的增长量是否达到设定的第一增长量阈值。
通过这种方式,如果存储设备中存储的冷数据已经达到设定的第一比例阈值,且预设时长内的增长量已经达到设定的第一增长量阈值,表明存储设备的数据较冷,且数据的温度向更冷的趋势变化,需要更冷一级的存储,则可以将存储单元的存储格式从PMR方式转换为SMR方式。那么一方面,由于存储设备中存储的冷数据的比例较大,则对于该存储设备来说,IOPS的要求相对较低,因此即使将该PMR方式的存储单元转换为SMR方式的存储单元,也不会由于PMR方式的存储单元的减少,而过多的影响存储设备的性能。另一方面,由于SMR方式相对于PMR方式来说,存储容量更高,可以提高存储设备的存储容量。
在一种可能的实现中,所述存储设备中存储的热数据是否达到设定的第二比例阈值,包括:所述存储设备中存储的热数据是否达到所述设定的第二比例阈值,且所述存储设备中存储的热数据在目标时间段内的增长量是否达到设定的第二增长量阈值。
通过这种方式,如果存储设备中存储的热数据已经达到设定的第二比例阈值,且预设时长内的增长量已经达到设定的第二增长量阈值,表明存储设备的数据较热,且数据的温度向更热的趋势变化,需要更高的IOPS,则可以将存储单元的存储格式从SMR方式转换为PMR方式,以提高IOPS。
在一种可能的实现中,所述第一存储单元预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
所述指令所述第一存储单元将所述第一存储格式转换为第二存储格式具体包括:
指令所述第一存储单元使能所述第二参数,并且去使能所述第一参数。
在一种可能的实现中,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
在一种可能的实现中,在所述指令所述第一存储单元将所述第一存储格式转换为第二存储格式之前,所述方法还包括:
将所述第一存储单元中存储的数据迁移至所述存储设备的其他存储单元中。
通过在对第一存储单元的存储格式进行转换之前,预先将第一存储区域存储的数据迁移至其他区域中,从而避免第一存储区域存储的数据丢失,实现对第一存储区域存储的数据进行备份的功能,提高了数据存储的安全性。
在一种可能的实现中,所述指令所述第一存储单元将所述第一存储格式转换为第二存储格式,得到第二存储单元之后,所述方法还包括:
将所述存储设备的其他存储单元中存储的数据迁移至所述第二存储单元。
在一种可能的实现中,所述将所述存储设备的其他存储单元中存储的数据迁移至所述第二存储单元,包括:
如果所述第二区域采用SMR方式存储数据,将所述存储设备的其他存储单元中存储的冷数据迁移至所述第二存储单元,或者,
如果所述第二区域采用PMR方式存储数据,将所述存储设备的其他存储单元中存储的热数据迁移至所述第二存储单元。
通过这种方式,可以充分的利用SMR方式存储容量更高、PMR方式IOPS更高的特性,调整存储设备中冷数据与热数据的分布,从而对存储设备的存储资源进行合理的规划,保证存储设备整体的性能更加优化。
第二方面,提供了一种硬盘格式转换装置,所述装置应用于存储设备中,所述装置包括:
选取模块,用于选取第一存储单元,所述第一存储单元采用第一存储格式存储数据;
指令模块,用于指令所述第一存储单元将所述第一存储格式转换为第二存储格式,得到第二存储单元;
其中,所述第一存储格式和所述第二存储格式分别为叠瓦片式磁记录SMR方式或垂直磁记录PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
在一种可能的实现中,所述装置还包括:
判断模块,用于判断所述存储设备是否满足预设条件。
在一种可能的实现中,所述预设条件包括以下条件中的任意一种及其组合:
所述存储设备的空闲空间是否低于设定的空间阈值,或者
所述第一存储单元的数量是否高于设定的第一数量阈值,或者
所述第二存储单元的数量是否低于设定的第二数量阈值,或者
所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
在一种可能的实现中,所述第一存储单元预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
所述指令模块具体用于:指令所述第一存储单元使能所述第二参数,并且去使能所述第一参数。
在一种可能的实现中,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
在一种可能的实现中,所述装置还包括:
迁移模块,用于将所述第一存储单元中存储的数据迁移至所述存储设备的其他存储单元中。
第三方面,提供了一种存储设备,所述存储设备包括处理器以及至少两个区域,所述至少两个区域包括叠瓦片式磁记录SMR区域以及垂直磁记录PMR区域;
所述处理器,用于选取第一区域,所述第一区域采用第一存储格式存储数据;
所述处理器,用于指令所述第一区域将所述第一存储格式转换为第二存储格式,得到第二区域;其中,所述第一存储格式和所述第二存储格式分别为SMR方式或PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
在一种可能的实现中,所述处理器还用于判断所述存储设备是否满足预设条件。
在一种可能的实现中,所述预设条件包括以下条件中的任意一种及其组合:
所述存储设备的空闲空间是否低于设定的空间阈值,或者
所述第一区域的数量是否高于设定的第一数量阈值,或者
所述第二区域的数量是否低于设定的第二数量阈值,或者
所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈 值的数据,或者
所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
在一种可能的实现中,所述第一区域预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
所述处理器具体用于指令所述第一区域使能所述第二参数,并且去使能所述第一参数。
在一种可能的实现中,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
在一种可能的实现中,所述处理器还用于将所述第一区域中存储的数据迁移至所述存储设备的其他区域中。
第四方面,提供了一种存储设备,所述存储设备包括系统控制器以及至少两个盘,所述至少两个盘包括叠瓦片式磁记录SMR盘以及垂直磁记录PMR盘;
所述系统控制器,用于选取第一盘,所述第一盘采用第一存储格式存储数据;
所述系统控制器,用于指令所述第一盘将所述第一存储格式转换为第二存储格式,得到第二盘;其中,所述第一存储格式和所述第二存储格式分别为SMR方式或PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
在一种可能的实现中,所述系统控制器还用于判断所述存储设备是否满足预设条件。
在一种可能的实现中,所述预设条件包括以下条件中的任意一种及其组合:
所述存储设备的空闲空间是否低于设定的空间阈值,或者
所述第一盘的数量是否高于设定的第一数量阈值,或者
所述第二盘的数量是否低于设定的第二数量阈值,或者
所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
在一种可能的实现中,所述第一盘预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
所述系统控制器具体用于指令所述第一盘使能所述第二参数,并且去使能所述第一参数。
在一种可能的实现中,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
在一种可能的实现中,所述系统控制器还用于将所述第一盘中存储的数据迁移至所述存储设备的其他盘中。
第五方面,提供一种计算机程序,所述计算机程序包括用于执行上述第一方面或第一方面任意可能的实现方式的指令。
第六方面,提供一种计算机可读存储介质,所述计算机可读存储介质用于存储上述第五方面所述的计算机程序。
附图说明
图1是本申请实施例提供的一种HDD读写数据的原理示意图;
图2是本申请实施例提供的一种TPI和BPI的示意图;
图3是本申请实施例提供的一种PMR盘的磁道和SMR盘的磁道的示意图;
图4是本申请实施例提供的一种实施环境的架构图;
图5是本申请实施例提供的一种存储设备的结构示意图;
图6是本申请实施例提供的一种存储设备的结构示意图;
图7是本申请实施例提供的一种硬盘格式转换方法的流程图;
图8是本申请实施例提供的一种从SMR区域向PMR区域切换的流程图;
图9是本申请实施例提供的一种从PMR区域向SMR区域切换的流程图;
图10是本申请实施例提供的一种硬盘格式转换方法的流程图;
图11是本申请实施例提供的一种硬盘格式转换方法的流程图;
图12是本申请实施例提供的一种硬盘格式转换装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。
以下,介绍本申请使用的概念。
HDD:是一种存储介质,具有单位容量价格低廉的优势。HDD通常包括一个或多个盘片,每个盘片的上表面或下表面通常可以存储数据,是有效盘面,通常称为磁面。每个磁面可以在逻辑上划分为多个磁道,通常来讲,磁面可以划分出成千乃至上万个磁道。其中,每个磁道为一个同心圆,磁面上最外侧的同心圆可以记为0磁道,一个或多个磁道可以组成机械硬盘的一个存储单元。其中,每个磁片的上方和下方可以分别具有一个磁头,磁片可以在两个磁头之间旋转。在HDD读写数据时,参见图1,磁头会在磁片上找到数据的存储位置对应的磁道,并在该磁道上找到对应的扇区,然后在磁头和磁碟之间的距离满足要求的情况下,在磁头上施加变化的电流,这样磁道上的磁场会相应变化,那么磁道上面变化后的磁场就是存储后的数据。其中,磁头包括读头和写头,读头用于在执行读操作或写操作时进行定位,写头用于写入数据,写头的宽度可以接近于读头的二倍左右。
参数:也称磁盘格式(英文全称:zone format,英文简称:ZF),参数用于支持硬盘中存储单元的存储格式。如果磁盘中的某个存储单元使能了某种参数,则可以采用该参数在该该存储单元中存储数据,那么该存储单元的存储格式即为该参数对应的存储格式。在一些可能的实施例中,参数可以包括飞行高度、单位英寸位数(英文全称:bits per inch,英文简称:BPI)、单位英寸磁道数(英文全称:track per inch,英文简称:TPI)、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
飞行高度:磁片旋转时会产生气流,气流会托起磁头,使得磁头悬浮起来,磁头悬浮的高度称为飞行高度。飞行高度是磁头和磁碟之间的距离。HDD读写时,飞行高度需要处于一定的范围内,以保证写头能够以适当的电路把信号写到磁道,读头能够感知磁道的信号。
TPI:是指盘上每英寸可以存储多少条磁道,TPI可以如图2(a)所示。
BPI:是指磁道上每英寸可以存储多少个比特(bit),BPI可以如图2(b)所示。BPI可以反映磁道上的存储密度。
盘的容量根据BPI和TPI的乘积确定。做个类比,假设将盘面比作马路,将磁道比作马路中的车道,马路上单个车道上的汽车的数量可以理解为BPI,马路上共计有多少个车道可以理解为TPI,那么马路上的汽车总数量可以理解为盘的容量,而汽车总数量等于单个车道上汽车的数量与车道数量的乘积。
读头和写头在切线上的距离:用于确定读头和写头在磁道的切向方向上的位置。
读头和写头在径向上的距离:用于确定读头和写头在磁道的径向方向上的位置。
PMR盘:一种相邻磁道之间存在间隔的盘。PMR盘的各个磁道相互分开,例如参见图3(a),磁道(N-1)和磁道N之间具有一定的间隔,磁道N和磁道(N+1)之间具有一定的间隔,N为正整数。其中,PMR盘的各个磁道可以划分为至少两个PMR区域,每个PMR区域包括一个或多个磁道。相对于SMR盘来说,PMR盘具有高IOPS的优势。具体来说,由于不同磁道之间没有重叠,数据写入任一条磁道时,不会影响到其他磁道,因此可以采用随机写的方式在PMR盘上存储数据,那么由于随机写的方式会带来更高的IOPS,从而让PMR盘的IOPS比SMR盘的IOPS更好。但是,对于PMR盘来说,为了把信号写到磁道上,必须保证磁头具有一定的宽度,通常磁头越宽,则磁道越宽,TPI越小,则PMR盘的盘面上能够容纳的磁道的数量较少,因此存储容量就会受限,导致PMR盘的存储容量通常小于SMR盘的存储容量。
SMR盘:SMR盘的各个磁道类似于重叠的瓦片,相邻磁道之间会具有重叠的区域。例如参见图3(b),磁道(N-1)和磁道N之间重叠,磁道N和磁道(N+1)之间重叠。SMR盘将多个磁道划分为若干个带(Band),带为由连续磁道所构成的可连续写入区域,每个区域构成一个需要顺序写入的基本单元。带是SMR盘上的物理概念,其对应的逻辑概念是SMR区域(zone),SMR区域是上层软件所能看到的SMR盘中的顺序写入区域。一个SMR区域的大小通常为256兆(英文全称:MByte,英文简称:MB)。相对于PMR盘来说,SMR盘具有高容量的优势。具体来说,SMR盘利用读写头宽度不同、读数据需要的磁场小于写数据需要的磁场的特性,改变之前各个离散磁道之间相互独立的记录方式,变成重叠磁道式的记录方式,这样在不增加额外硬件复杂度的情况下,相邻磁道中心之间的距离明显减小,这样单位英寸就可以有更多的磁道,这样如图3所示,可以明显地提高TPI,那么由于读头相对较窄,读头还是可以从磁道上读出数据,因此可以在物理尺寸不变且无需增加BPI的情况下,增加BPI与TPI的乘积,即增加了存储容量。通常来说,在相同的头碟情况下,SMR盘可以比PMR盘提高20%左右的容量,因此SMR盘相对PMR盘的数据存储成本大约低15%左右。但SMR盘在容量提高的同时,也有其天生的缺陷,由于SMR盘的存储格式类似于叠瓦片,当向SMR盘的任一条磁道写入数据时,会覆盖与该磁道重叠的其他磁道,导致影响其他磁道存储的数据。因此,SMR方式无法向PMR方式那样随机在任意一条磁道上写入数据,导致SMR盘的IOPS通常低于PMR盘的IOPS。
图4是本申请实施例提供的一种实施环境的架构图,该实施环境包括存储设备401以及终端402,存储设备401和终端402可以建立通信通路,通过该通信通路进行通信。
在一些可能的实施例中,存储设备401可以包括系统控制器4011以及至少两个盘4012。至少两个盘4012包括SMR盘和PMR盘。系统控制器4011用于控制该至少两个盘4012进行硬盘格式转换,每个盘4012可以在系统控制器4011的控制下,将本端的存储格式转换为其他存储格式。
在一些可能的实施例中,存储设备401可以为终端402提供数据存储服务。具体来说,终端402可以将要存储的数据发送至系统控制器4011,系统控制器4011可以将数据发送给至少两个盘4012,至少两个盘4012可以从系统控制器4011接收数据,并进行数据存储。示例性地,终端402可以向存储设备401发送输入/输出(英文全称:input/output,英文简称:I/O)请求,该I/O请求携带需要存储的数据,存储设备401可以从终端402接收I/O请求,从I/O请求中获取数据,存储数据。
其中,存储设备401可以作为云存储服务提供给用户。具体来说,存储设备401可以运行在云环境中,例如可以运行在公有云、私有云或混合云上。用户可以使用终端402,在云存储服务中申请一定容量的存储空间。存储设备401可以为用户分配相应容量的存储空间,例如为用户分配一个或多个盘4012,从而在分配的存储空间中,存储数据。作为示例,存储设备401可以提供为对象存储服务(英文全称:object storage service,英文简称:OBS)、云硬盘、云数据库等。
终端402可以是个人计算机(英文全称:personal computer,英文简称:PC)、手机、平板电脑等。本领域技术人员可以知晓,上述终端402的数量可以更多或更少。比如上述终端402可以仅为一个,或者上述终端402为几十个或几百个,或者更多数量,此时上述实施环境还包括其他终端。本申请实施例对终端402的数量和设备类型不加以限定。
如图5所示,本申请提供了一种存储设备500。该存储设备500可以而不限于是盘,例如该存储设备500可以是HDD。存储设备500包括处理器501以及至少两个区域502。
处理器501可以而不限于是控制电路或控制芯片。在一些可能的实施例中,存储设备500可以包括片上系统,处理器501可以位于存储设备500的片上系统中。
至少两个区域502包括SMR区域以及PMR区域。每个区域502为存储设备500的存储单元,每个区域502可以用于存储数据。其中,存储设备500可以包括一个或多个盘片,每个盘片包括上表面以及下表面,每个区域502可以位于存储设备500的任一个盘片的上表面或下表面上。
存储设备500还可以包括存储器504,该存储器504存储有至少一条指令,该至少一条指令由该处理器501加载并执行,以实现下述图7实施例提供的硬盘格式转换方法。在一些可能的实施例中,存储器504可以存储第一参数和第二参数,第一参数用于支持第一存储格式,第二参数用于支持第二存储格式。存储器504可以是非易失性存储器,例如可以是闪存(flash)。存储器504可以位于存储设备500的片上系统中。
另外,存储设备500还可以包括总线503以及收发器505,总线503与处理器501以及至少两个区域502均连接,处理器501以及至少两个区域502之间可以通过总线503通信。收发器505用于收发信号,例如可以用于从下述图6实施例所示的系统控制器601或主机接收指令。
当然,该存储设备500还可以包括其他用于实现设备功能的部件,在此不做赘述。
如图6所示,本申请提供了一种存储设备600。该存储设备600可以而不限于是存储阵列。存储设备600包括系统控制器601以及至少两个盘602。
系统控制器600可以是服务器、个人计算机(英文全称:personal computer,英文简称:PC)等。系 统控制器601可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器6011(central processing units,CPU)和一个或一个以上的存储器6012。其中,系统控制器601的存储器6012中存储有至少一条指令,该至少一条指令由该处理器6011加载并执行以实现下述图10实施例提供的硬盘格式转换方法。系统控制器601的存储器6012的类型包括但不限于易失性存储器6012、非易失性存储器6012,例如随机存取存储器6012(英文全称:random access memory,英文简称:RAM)、只读存储器6012(英文全称:read-only memory,英文简称:ROM)、只读光盘(英文全称:compact disc read-only memory,英文简称:CD-ROM)、磁带、软盘、光数据存储设备、快闪存储器6012、HDD、固态硬盘(英文全称:solid state drive,英文简称:SSD)。当然,该系统控制器601还可以具有有线或无线网络接口以及输入输出接口等部件,以便进行输入输出,该系统控制器601还可以包括其他用于实现设备功能的部件,在此不做赘述。
需要说明的一点是,图6仅是以存储设备600包括1个系统控制器601为例进行描述,在一些可能的实施例中,存储设备600也可以包括两个或两个以上的系统控制器,下述图10实施例中的各个步骤可以分散在不同的系统控制器上执行,从而分担系统控制器601整体的计算量。并且,本实施例并不限定不同系统控制器601之间的连接方式,只需保证不同系统控制器601可以相互通信即可。另外,也不限定系统控制器601与盘602的连接方式,只需保证不同系统控制器601可以相互通信即可。
每个盘602可以为上述图5实施例中的存储设备500,每个盘602可以而不限于是硬盘,例如是HDD。每个盘602为存储设备600的一个存储单元。其中,至少两个盘602可以包括SMR盘以及PMR盘。
本申请实施例中,存储设备可以对存储单元的存储格式进行转换,得到另一种存储格式的存储单元。例如,存储设备可以将存储单元的存储格式从SMR方式转换为PMR方式,或者将存储单元的存储格式从PMR方式转换为SMR方式。
下面,以存储单元为SMR区域或PMR区域为例,通过图7实施例对硬盘格式转换的流程进行阐述。
图7是本申请实施例提供的一种硬盘格式转换方法的流程图。该方法可以应用于图5所示的存储设备中,该方法可以由存储设备500的处理器501执行,该方法包括下述步骤701至704:
步骤701、处理器判断存储设备是否满足预设条件。
在一些可能的实施例中,预设条件可以包括以下条件(1)至条件(6)中的任意一种及其组合:
条件(1)存储设备的空闲空间是否低于设定的空间阈值。
如果预设条件包括条件(1),处理器可以获取存储设备的空闲空间,判断存储设备的空闲空间是否低于设定的空间阈值,如果存储设备的空闲空间低于设定的空间阈值,则执行下述步骤702。其中,处理器可以获取存储设备中每个区域的空闲空间,确定所有区域的空闲空间的总和,作为存储设备的空闲空间。
如果根据条件(1)来执行步骤701,处理器可以在存储设备的空闲空间不足的场景下,通过确定存储设备满足条件(1),来将区域的存储格式,从PMR方式转换为SMR方式,那么由于SMR方式相对于PMR方式来说,单个区域的存储容量更高,因此通过条件(1)进行存储格式转换后,可以提高存储容量,从而可以解决空闲空间不足的问题。
该空间阈值可以根据实验、经验或需求设置,本实施例对空间阈值的具体数值不做限定。在一些可能的实施例中,空间阈值可以预先存储在存储设备中。例如,空间阈值可以存储在存储设备的存储器中,比如说,可以存储在存储设备的片上系统中的闪存中。处理器可以从存储器中读取该空间阈值。在另一 些可能的实施例中,用户可以在终端上输入该空间阈值,终端可以获取用户输入的空间阈值,终端可以向存储设备发送该空间阈值,存储设备可以从终端接收该空间阈值。
可选地,空间阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送空间阈值,存储设备每当从终端接收到空间阈值时,可以将已存储的空间阈值更新为接收到的空间阈值。结合这种方式、条件(1)以及后续步骤,存储设备可以动态地调整空闲空间的大小。例如,存储设备原本设定的空间阈值为a,存储设备通过判断空闲空间是否低于a,在空闲空间小于a的情况下,执行后续步骤,将区域的存储格式从PMR方式转换为SMR方式,直到空闲空间达到a为止,从而将空闲空间控制为a。之后终端向存储设备发送空间阈值b,存储设备通过将空间阈值更新为b,重新判断空闲空间是否低于b,在空闲空间小于b的情况下,执行后续步骤,将盘上区域的存储格式从PMR方式转换为SMR方式,直到空闲空间达到b为止,从而将空闲空间控制为b。那么,存储设备可以将盘的空闲空间从a动态地调整到b,提高了灵活性。其中,b和a为正数,b与a不同。
条件(2)第一区域的数量是否高于设定的第一数量阈值。
如果预设条件包括条件(2),处理器可以获取存储设备中第一区域的数量,判断存储设备中第一区域的数量是否高于设定的第一数量阈值,如果第一区域的数量高于设定的第一数量阈值,则执行下述步骤702。
通过根据条件(2)来执行步骤701,处理器可以在第一区域的数量足够的场景下,通过第一区域转换出更多的第二区域,以满足存储容量或性能的需求。具体来说,第一区域可以为SMR区域,通过判断存储设备中SMR区域是否高于设定的第一数量阈值,如果SMR区域的数量高于设定的第一数量阈值,则执行后续步骤,来将SMR区域的存储格式从SMR方式转换为PMR方式,那么由于PMR方式相对于SMR方式来说,IOPS更高,因此可以提高IOPS,从而提高了存储设备的性能。在另一些可能的实施例中,第一区域可以为PMR区域,通过判断存储设备中PMR区域是否高于设定的第一数量阈值,如果PMR区域的数量高于设定的第一数量阈值,则执行后续步骤,来将PMR区域的存储格式从PMR方式转换为SMR方式,那么由于SMR方式相对于PMR方式来说,存储容量更高,从而提高了存储设备的存储容量。
第一数量阈值可以根据实验、经验或需求设置,本实施例对第一数量阈值的具体数值不做限定。在一些可能的实施例中,第一数量阈值可以预先存储在存储设备中,例如存储在存储设备的存储器中。存储设备的处理器可以从存储器中读取该第一数量阈值。在另一些可能的实施例中,用户可以在终端上输入该第一数量阈值,终端可以获取用户输入的第一数量阈值,终端可以向存储设备发送该第一数量阈值,存储设备可以从终端接收该第一数量阈值。
可选地,第一数量阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送第一数量阈值,存储设备每当从终端接收到第一数量阈值时,可以将已存储的第一数量阈值更新为接收到的第一数量阈值。结合这种方式、条件(2)以及后续步骤,存储设备可以动态地调整第一区域的数量的多少。例如,存储设备原本设定的第一数量阈值为c,存储设备通过判断第一区域的数量是否高于c,在第一区域的数量高于c的情况下,执行后续步骤,对盘上区域的存储格式进行转换,从而减少第一区域的数量,而得到更多的第二区域。之后终端向存储设备发送第一数量阈值d,存储设备通过将第一数量阈值更新为d,重新判断第一区域的数量是否高于d,在第一区域的数量高于d的情况下,执行后续步骤,从而得到更多的第二区域。那么,如果d小于c,则可以在已经对区域的存储格式进行转换后,进一步 减少第一区域的数量,来增加第二区域的数量。
条件(3)第二区域的数量是否低于设定的第二数量阈值。
如果预设条件包括条件(3),处理器可以获取存储设备中第二区域的数量,判断存储设备中第二区域的数量是否低于设定的第二数量阈值,如果第二区域的数量低于设定的第二数量阈值,则执行下述步骤702。
通过根据条件(3)来执行步骤701,处理器可以在第二区域的数量不足的场景下,转换出更多的第二区域以满足存储容量或性能的需求。在一些可能的实施例中,第二区域可以为SMR区域,通过判断存储设备中SMR区域是否低于设定的第二数量阈值,如果SMR区域的数量低于设定的第二数量阈值,则执行后续步骤,可以将PMR区域的存储格式从PMR方式转换为SMR方式,得到SMR区域,从而可以让存储设备包括的SMR区域更多,保证SMR区域的数量可以符合需求。并且,由于SMR方式相对于PMR方式来说,存储容量更高,因此可以提高存储设备的存储容量。在另一些可能的实施例中,第二区域可以为PMR区域,通过判断存储设备中PMR区域是否低于设定的第二数量阈值,如果PMR区域的数量低于设定的第二数量阈值,则执行后续步骤,可以将SMR区域的存储格式从SMR方式转换为PMR方式,从而可以让存储设备包括的PMR区域更多,保证PMR区域的数量可以符合需求。并且,由于PMR方式相对于SMR方式来说,IOPS更高,因此可以提高IOPS,从而可以提高存储设备的性能。
第二数量阈值和第一数量阈值可以相同,也可以不同,本实施例对第二数量阈值与第一数量阈值之间的数值大小关系不做限定。第二数量阈值可以根据实验、经验或需求设置,本实施例对第二数量阈值的具体数值不做限定。在一些可能的实施例中,第二数量阈值可以预先存储在存储设备中,例如存储在存储设备的存储器中,比如存储在存储设备的片上系统的闪存中。处理器可以从存储器中读取该第二数量阈值。在另一些可能的实施例中,用户可以在终端上输入该第二数量阈值,终端可以获取用户输入的第二数量阈值,终端可以向存储设备发送该第二数量阈值,存储设备可以从终端接收该第二数量阈值。
可选地,第二数量阈值可以表示为存储设备的总容量与比例阈值的乘积,该比例阈值为第二区域的总容量与第一区域的总容量之间的比值,该比例阈值的单位可以为百分比,该比例阈值表示第二区域在存储设备所占的比重。例如,如果该比例阈值记为x,第二数量阈值可以表示为总容量*x%,其中*表示相乘,x为正数。
可选地,第二数量阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送第二数量阈值,存储设备每当从终端接收到第二数量阈值时,可以将已存储的第二数量阈值更新为接收到的第二数量阈值。结合这种方式、条件(2)以及后续步骤,存储设备可以动态地调整第二区域的数量的多少。例如,存储设备原本设定的第二数量阈值为c,存储设备通过判断第二区域的数量是否低于d,在第二区域的数量低于d的情况下,执行后续步骤,对盘上区域的存储格式进行转换,以得到更多的第二区域,直至第二区域的数量达到d为止。之后终端向存储设备发送第二数量阈值e,存储设备通过将第二数量阈值更新为e,重新判断第二区域的数量是否低于e,在第二区域的数量低于e的情况下,执行后续步骤,以得到更多的第二区域,直至第二区域的数量达到e为止。那么,如果d小于e,则可以将第二区域的数量在d的基础上调整至e,从而进一步增加了第二区域的数量。
条件(4)存储设备中存储的冷数据是否达到设定的第一比例阈值。
如果预设条件包括条件(4),处理器可以判断存储设备中存储的冷数据是否达到设定的第一比例阈值,如果冷数据达到设定的第一比例阈值,则执行下述步骤702。其中,该冷数据是指访问频率低于温度阈值的数据,该温度阈值可以预先存储在存储设备的存储器中。在一种可能的实现中,处理器可以获 取每个区域中存储的冷数据的数据量以及每个区域存储的所有数据的数据量,获取冷数据的数据量与所有数据的数据量之间的比值,作为存储设备中存储的冷数据的比例,对冷数据的比例与设定的第一比例阈值进行比较,从而判定冷数据是否达到设定的第一比例阈值。
在一些可能的实施例中,如果采用条件(4)来执行步骤701,第一区域可以为PMR区域,第二区域可以为SMR区域。那么,在存储的数据温度降低的场景下,通过判断存储设备中冷数据是否达到设定的第一比例阈值,如果冷数据达到设定的第一比例阈值,则将PMR区域转换为SMR区域,从而得到更多的SMR区域。那么一方面,由于存储设备中存储的冷数据的比例较大,则对于该存储设备来说,IOPS的要求相对较低,因此即使将该存储设备的PMR区域转换为SMR区域,也不会由于PMR区域的减少,而过多的影响存储设备的性能。另一方面,由于SMR方式相对于PMR方式来说,存储容量更高,可以提高存储设备的存储容量。
第一比例阈值可以根据实验、经验或需求设置,本实施例对第一比例阈值的具体数值不做限定。在一些可能的实施例中,第一比例阈值可以预先存储在存储设备中,例如存储在存储设备的存储器中。处理器可以从存储器中读取该第一比例阈值。在另一些可能的实施例中,用户可以在终端上输入该第一比例阈值,终端可以获取用户输入的第一比例阈值,终端可以向存储设备发送该第一比例阈值,存储设备可以从终端接收该第一比例阈值。
可选地,第一比例阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送第一比例阈值,存储设备每当从终端接收到第一比例阈值时,可以将已存储的第一比例阈值更新为接收到的第一比例阈值。
在一些可能的实施例中,条件(4)可以包括:存储设备中存储的冷数据是否达到设定的第一比例阈值,且存储设备中存储的冷数据在目标时间段内的增长量是否达到设定的第一增长量阈值。在这种条件下,系统控制器可以获取存储设备中存储的冷数据所占的比例,以及存储设备中存储的冷数据在目标时间段内的增长量;判断存储设备中存储的冷数据是否达到设定的第一比例阈值,且目标时间段内的增长量是否达到设定的第一增长量阈值;如果存储设备中存储的冷数据已经达到设定的第一比例阈值,且预设时长内的增长量已经达到设定的第一增长量阈值,表明存储设备存储的数据较冷,且存储的数据的温度向更冷的趋势变化,则判定当前需要更冷一级的存储,则执行下述步骤702,以将PMR区域转换为SMR区域。其中,该目标时间段可以为最近的一段时间,例如,该目标时间段的时长可以是预设时长,该目标时间段的时间结束点可以是当前时间点。
条件(5)存储设备中存储的热数据是否达到设定的第二比例阈值。
如果预设条件为条件(5),处理器可以获取存储设备中存储的热数据所占的比例,判断存储设备中存储的热数据是否达到设定的第二比例阈值,如果热数据达到设定的第二比例阈值,则执行下述步骤702。其中,热数据也称热点数据,热数据是指访问频率高于温度阈值的数据。在一种可能的实现中,处理器可以获取每个区域存储的热数据的数据量以及每个区域存储的所有数据的数据量,获取热数据的数据量与所有数据的数据量之间的比值,作为存储设备中存储的热数据的比例,对热数据的比例与设定的第一比例阈值进行比较,从而判定热数据是否达到设定的第一比例阈值。
在一些可能的实施例中,如果采用条件(5)来执行步骤701,第一区域可以为SMR区域、第二区域可以为PMR区域。通过条件(5),处理器可以在数据的温度升高的场景下,通过判断存储设备中热数据是否达到设定的第二比例阈值,如果热数据达到设定的第二比例阈值,则将SMR区域转换为PMR区域,从而得到更多的PMR区域。那么由于存储设备中存储的热数据的比例较大,则对于该存储设备 来说,IOPS的要求较高,因此将该存储设备的SMR区域转换为PMR区域,由于PMR方式相对于SMR方式来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
第二比例阈值可以根据实验、经验或需求设置,本实施例对第二比例阈值的具体数值不做限定。在一些可能的实施例中,第二比例阈值可以预先存储在存储设备中,例如存储在存储设备的存储器中。处理器可以从存储器中读取该第二比例阈值。在另一些可能的实施例中,用户可以在终端上输入该第二比例阈值,终端可以获取用户输入的第二比例阈值,终端可以向存储设备发送该第二比例阈值,存储设备可以从终端接收该第二比例阈值。
可选地,第二比例阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送第二比例阈值,存储设备每当从终端接收到第二比例阈值时,可以将已存储的第二比例阈值更新为接收到的第二比例阈值。
在一些可能的实施例中,条件(5)可以包括:存储设备中存储的热数据是否达到设定的第二比例阈值,且存储设备中存储的热数据在目标时间段内的增长量是否达到设定的第二增长量阈值。在这种条件下,系统控制器可以获取存储设备中存储的热数据所占的比例,以及存储设备中存储的热数据在目标时间段内的增长量;判断存储设备中存储的热数据是否达到设定的第二比例阈值,且目标时间段内的增长量是否达到设定的第二增长量阈值;如果存储设备中存储的热数据已经达到设定的第二比例阈值,且预设时长内的增长量已经达到设定的第二增长量阈值,表明存储设备存储的数据较热,且存储的数据的温度向更热的趋势变化,则判定当前需要IOPS更高的存储,则执行下述步骤702,以将SMR区域转换为PMR区域。
条件(6)存储设备的IOPS是否低于设定的读写阈值。
如果预设条件包括条件(6),处理器可以获取存储设备的IOPS,判断存储设备的IOPS是否低于设定的读写阈值,如果IOPS低于设定的读写阈值,则执行下述步骤702。
在一些可能的实施例中,如果采用条件(6)来执行步骤701,第一区域可以为SMR区域、第二区域可以为PMR区域。在存储设备的IOPS不满足需求的场景下,处理器通过判断存储设备的IOPS是否低于设定的读写阈值,如果IOPS低于设定的读写阈值,则将SMR区域转换为PMR区域,从而得到更多的PMR区域。那么由于PMR方式相对于SMR方式来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
读写阈值可以根据实验、经验或需求设置,本实施例对读写阈值的具体数值不做限定。在一些可能的实施例中,读写阈值可以预先存储在存储设备中,例如存储在存储设备的存储器中。处理器可以从存储器中读取该读写阈值。在另一些可能的实施例中,用户可以在终端上输入该读写阈值,终端可以获取用户输入的读写阈值,终端可以向存储设备发送该读写阈值,存储设备可以从终端接收该读写阈值。
可选地,读写阈值可以动态地进行调整。具体来说,终端可以多次向存储设备发送读写阈值,存储设备每当从终端接收到读写阈值时,可以将已存储的读写阈值更新为接收到的读写阈值。
在一些可能的实施例中,上述条件(1)至条件(6)可以采用两种或两种以上的组合方式组合。其中,组合的方式可以包括且的方式组合以及或的方式组合。示例性地,以上述条件(1)和条件(2)组合为例,处理器可以判断存储设备的空闲空间是否低于设定的空间阈值,且PMR区域的数量是否高于设定的第一数量阈值;如果存储设备的空闲空间低于设定的空间阈值,且PMR区域的数量高于设定的第一数量阈值,表明存储设备当前的空闲空间不足,且具有足够的PMR区域可以转换,则执行下述步骤702。
步骤702、如果存储设备满足预设条件,处理器选取第一区域。
为了区分描述,将存储格式转换前的区域称为第一区域,将存储格式转换后的区域称为第二区域。处理器可以从盘中的至少两个区域中,选取该第一区域,以便将选取的第一区域转换为第二区域。
其中,该第一区域采用第一存储格式存储数据,第二区域采用第二存储格式存储数据。该第一存储格式和该第二存储格式分别为SMR方式或PMR方式的其中一种,并且该第一存储格式和该第二存储格式不同。
具体来说,在一些可能的实施例中,第一区域可以为SMR区域,第二区域可以为PMR区域,第一区域采用SMR方式存储数据,第二区域采用PMR方式存储数据。在另一些可能的实施例中,第一区域可以为PMR区域,第二区域可以为SMR区域,第一区域采用PMR方式存储数据,第二区域采用SMR方式存储数据。
在一些可能的实施例中,处理器可以在选取第一区域之前,获取存储设备的空闲空间,判断空闲空间是否大于或等于一个第二区域的空间,如果空闲空间大于或等于一个第二区域的空间,再选取第一区域。例如,如果存储设备为SMR盘,SMR盘的处理器可以判断SMR盘是否有空闲空间,且空闲空间大于1个PMR区域,如果空闲空间大于1个PMR区域,则选取待转换的SMR区域。如果存储设备为PMR盘,PMR盘的处理器可以判断PMR盘是否有空闲空间,且空闲空间大于1个SMR区域,如果空闲空间大于1个SMR区域,则选取待转换的PMR区域。
在一些可能的实施例中,在SMR区域向PMR区域切换的场景下,由于SMR区域的容量大于PMR区域的容量,通常来讲,多个PMR区域才可以转换为SMR区域,则处理器可以选取多个连续的SMR区域,作为第一区域。其中,选取的SMR区域的数量可以为预设比例的整数倍,该预设比例为PMR区域的容量与SMR区域的容量之间的比值,例如如果1个PMR区域为60个SMR区域,则预设比例可以为60。例如,可以选取SMR区域0至SMR区域59,将这60个SMR区域作为第一区域,后续可以将这60个SMR区域转换为1个PMR区域。又如,可以选取SMR区域0至SMR区域119,将这120个SMR区域作为第一区域,后续可以将这120个SMR区域转换为2个PMR区域。
步骤703、处理器将第一区域中存储的数据迁移至存储设备的其他区域中。
处理器可以从存储设备中选取与第一区域不同的其他区域,将第一区域存储的数据迁移至其他区域中,从而预先将第一区域存储的数据整理到其他位置,避免第一区域存储的数据丢失,达到对第一区域存储的数据进行备份的效果。其中,该其他区域可以为空闲的区域,该其他区域的容量可以大于或等于第一区域的容量。
在一些可能的实施例中,处理器可以对第一区域的数据进行迁移后,可以将第一区域标记为可转换区。每当要执行转换存储格式的步骤时,可以选取标记为可转换区的区域,对可转换区进行转换。如此,如果处理器对N个第一区域的数据进行了迁移,可以将N个第一区域标记为可转换区,如果将N个可转换区中的M个可转换区的存储格式转换后,转换出的第二区域已经足够,处理器可以停止执行转换存储格式的步骤,此时存储设备仍有(N-M)个可转换区尚未转换。当存储设备下一次符合预设条件时,可以无需执行数据迁移的步骤,而从剩余的(N-M)个可转换区中选取第一区域,对该第一区域的存储格式进行转换。其中,N和M为正整数,N大于M。
在一种可能的实现中,处理器可以生成可转换区信息,在存储器中存储可转换区信息,该可转换区信息用于记录可转换区,该可转换区信息可以包括每个可转换区的区域标识。当处理器对任一区域的数据迁移后,可以将该区域作为可转换区,向该可转换区信息中写入该区域的区域标识。当处理器要对可 转换区进行存储格式转换时,可以从该可转换区信息中读取区域的区域标识,确定区域标识对应的区域,作为可转换区。
步骤704、处理器指令第一区域将该第一存储格式转换为第二存储格式,得到第二区域。
处理器可以指令SMR区域将存储格式从SMR方式转换为PMR方式,得到PMR区域。或者,处理器可以指令PMR区域将存储格式从PMR方式转换为SMR方式,得到SMR区域。
在一些可能的实施例中,转换存储格式的功能可以通过使能新的存储格式对应的参数、去使能旧的存储格式对应的参数实现。具体来说,第一区域可以预先配置有第一参数和第二参数。该第一参数用于支持该第一存储格式,该第二参数用于支持该第二存储格式。处理器可以指令第一区域使能第二参数,并且去使能第一参数。通过使能第二参数、去使能第一参数,第一区域的参数会从第一参数更新为第二参数,那么后续使用第一区域存储数据时,第一区域就会采用第二参数所支持的存储格式来存储数据,而不再采用第一参数所支持的存储格式来存储数据,从而实现了转换存储格式的功能。
例如,如果第一区域为SMR区域,第二区域为PMR区域,第一存储格式为SMR方式,第二存储格式为PMR方式,则该第一参数是指用于支持SMR方式的参数,即SMR区域的磁盘格式,第二参数是指用于支持PMR方式的参数,即PMR区域的磁盘格式。处理器通过指令SMR区域使能支持PMR方式的参数,去使能支持SMR方式的参数,从而将SMR区域的参数更新为支持PMR方式的参数,也就将SMR区域的存储格式从SMR方式转换为PMR方式,也就将SMR区域转换为了PMR区域。同理地,如果第一区域为PMR区域,第二区域为SMR区域,第一存储格式为PMR方式,第二存储格式为SMR方式,则该第一参数是指用于支持PMR方式的参数,即PMR区域的磁盘格式,第二参数是指用于支持SMR方式的参数,即SMR区域的磁盘格式。处理器通过指令PMR区域使能支持SMR方式的参数,去使能支持PMR方式的参数,从而将PMR区域的参数更新为支持SMR方式的参数,也就将PMR区域的存储格式从PMR方式转换为SMR方式,也就将PMR区域转换为了SMR区域。
在一些可能的实施例中,第一参数可以包括一种或多种子参数。示例性地,第一参数可以包括飞行高度、BPI、TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。第二参数也可以包括一种或多种子参数。示例性地,第一参数可以包括飞行高度、BPI、TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
如果第一参数以及第二参数均包括多种子参数,存储器可以指令第一区域使能第二参数的每个子参数,并且去使能第一参数的每个子参数。例如,如果第一参数用于支持SMR方式,第二参数用于支持PMR方式,存储器可以指令第一区域使能用于支持SMR方式的TPI以及BPI,去使能用于支持PMR方式的TPI以及BPI。
在一些可能的实施例中,如果存储设备的盘上有N个区域,可以预先为N个区域中的每个区域配置第一参数和第二参数,则存储设备共计配置有2N种参数,其中N为正整数。
示例性地,可以在存储设备的工厂测试阶段,配置每个区域的第一参数和第二参数。比如说,工厂在生产制造HDD时,可以在HDD的存储器(比如闪存)中,存储每个区域的第一参数和第二参数。如此,在HDD运行时,处理器可以从存储器中,读取预先配置的第一区域的第一参数或第二参数。
相关技术中,对于PMR盘来说,PMR盘上的每个存储单元均为PMR区域,每个PMR区域均会固定地采用PMR方式来存储数据。而对于SMR盘来说,虽然SMR盘会留有极少数(约1%)的PMR区域,但该PMR区域并不是用来存储数据的,而是用来作为不同SMR区域之间的缓冲区的。也即是,SMR盘上每个用于存储数据的区域也均为SMR区域,每个SMR区域均会固定地采用SMR方式来存储数据。 总结来说,相关技术中,无论是PMR盘还是SMR盘,盘上的每个存储单元的存储格式均是固定的,要么仅会采用PMR方式,要么仅会采用SMR方式,而不会在两种存储格式之间相互转换。并且,相关技术中,PMR盘中仅会存储支持PMR方式的参数,而不会存储支持SMR方式的参数,因此无法将PMR区域切换为SMR区域。而SMR盘中仅存储支持SMR方式的参数,而不会存储支持PMR方式的参数,因此无法将SMR区域切换为PMR区域。
而本实施例中,通过为盘的区域同时配置两种参数,既配置有支持SMR方式的参数,也配置有支持PMR方式的参数,可以根据需求,使能其中一种参数、去使能另外一种参数,从而让区域的存储格式在PMR方式与SMR方式之间自适应地切换。
在一些可能的实施例中,被转换的第一区域的数量可以为多个,存储设备可以对多个第一区域进行依次转换。具体来说,存储设备可以按照多个第一区域在存储设备上的排列顺序,依次指令该多个第一区域将第一存储格式转换为该第二存储格式。其中,每个第一区域可以是存储设备的盘片上的一个圆环,多个第一区域可以呈同心圆状分布,处理器可以按照从外侧半径到内侧半径的顺序,依次指令多个第一区域将第一存储格式转换为该第二存储格式,也可以按照从内侧半径到外侧半径的顺序,依次指令多个第一区域将第一存储格式转换为该第二存储格式。
在一些可能的实施例中,处理器在指令该第一区域将该第一存储格式转换为第二存储格式之后,可以继续判断存储设备是否满足预设条件,如果存储设备尚未满足预设条件,则继续选取第一区域,对继续选取的第一区域的存储格式进行转换,得到更多的第二区域,通过重复执行这样的步骤,可以让存储设备逐渐趋近于满足预设条件,当存储设备已经满足预设条件时,可以停止执行转换存储格式的步骤,如此,可以将存储设备控制为满足预设条件的状态,从而扩展了对存储设备的控制功能。
例如,如果处理器指令PMR区域将存储格式从PMR方式转换为SMR方式后,存储设备的空闲空间仍然低于设定的空间阈值,则处理器可以继续指令其他PMR区域也将存储格式从PMR方式转换为SMR方式,从而转换得到更多的SMR区域,来通过更多的SMR区域,继续提高存储设备的空闲空间,直至存储设备的空闲空间达到设定的空间阈值。如此,可以将存储设备的空闲空间大小控制在空间阈值左右。
又如,如果处理器指令第一区域将该第一存储格式转换为第二存储格式后,存储设备的第二区域的数量仍然低于设定的第二数量阈值,则处理器可以继续指令其他第一区域将存储格式从第一存储格式转换为第二存储格式,从而转换得到更多的第二区域,以继续提高存储设备的第二区域的数量,直至存储设备的第二区域的数量达到第二数量阈值。如此,可以将存储设备的第二区域的数量控制在第二数量阈值左右,例如,如果第二数量阈值为K,通过执行本实施例提供的方法,可以将SMR区域的数量或PMR区域的数量控制在K左右,其中K为正整数。
可选地,如果存储设备多次执行选取第一区域以及转换第一区域的存储格式的步骤,存储设备可以将下一次选取的第一区域中存储的数据,迁移至上一次转换出的第二区域中。例如,在从SMR区域向PMR区域转换的场景下,当存储设备将SMR区域1转换为PMR区域1后,当要对SMR区域2的存储格式进行转换时,可以先将SMR区域2中存储的数据迁移至PMR区域1中,再对SMR区域1进行转换。当然,存储设备也可以将继续选取的第一区域中存储的数据迁移至其他区域中,本实施例对此不做限定。
在一些可能的实施例中,在得到第二区域后,处理器可以在第二区域中存储数据。在一些可能的实施例中,处理器可以在接收到写请求后,获取写请求中的数据,将写请求中的数据存储在第二区域中。 在另一些可能的实施例中,处理器可以将其他区域中存储的数据迁移到第二区域中。示例性地,如果第二区域是SMR区域,可以将其他区域存储的冷数据迁移到该第二区域中;而如果第二区域是PMR区域,可以将其他区域存储的热数据迁移到该第二区域中。如此,可以充分的利用SMR方式的存储容量更高、PMR方式的IOPS更高的特性,调整盘中冷数据与热数据的分布,从而对盘的存储资源进行合理的规划,保证整体性能更加优化。
在一些可能的实施例中,存储设备可以存储区域标识与区域类型之间的对应关系,该对应关系包括至少一个区域标识以及每个区域标识对应的区域类型,例如可以如下表1所示。当处理器指令第一区域将第一存储格式转换为第二存储格式后,可以根据第一区域的区域标识,查询该对应关系中该区域标识对应的区域类型,将该区域类型更新为第二存储格式对应的区域类型。例如,如果处理器指令区域1将存储格式从SMR方式转换为PMR方式,则可以在转换区域1的存储格式后,将下表1中区域1对应的SMR区域更新为PMR区域。其中,区域标识用于标识对应的区域,例如可以是区域的身份标识符(英文全称:identification,英文简称:ID)、编号等,区域标识可以由存储设备可以为盘的每个区域分配得到。区域类型可以包括SMR区域以及PMR区域这两种类型。区域标识与区域类型之间的对应关系可以存储在存储设备的存储器(例如闪存)中,终端可以从存储设备的存储器中,读取该对应关系,根据对应关系,可以获知存储设备中每个区域分别是哪种类型,从而可以得知存储设备当前的SMR区域的数量以及PMR区域的数量,将SMR区域的数量以及PMR区域的数量呈现给上层应用,以便上层应用管理存储设备。
表1
区域标识 区域类型
区域1 SMR区域
区域2 PMR区域
区域3 SMR区域
在一些可能的实施例中,处理器可以记录存储设备的SMR区域的数量以及PMR区域的数量。例如存储设备的存储器可以存储记录信息,该记录信息包括SMR区域的数量以及PMR区域的数量,存储设备指令第一区域转换存储格式后,可以更新该记录信息。例如,如果存储设备将k个SMR区域转换为m个PMR区域,可以将记录信息中SMR区域的数量减少k,将记录信息中PMR区域的数量增加m。其中k以及m为正整数。
以第一区域为SMR区域,第二区域为PMR区域为例,在一些可能的实施例中,参见图8,其示出了SMR盘将盘中的SMR区域,从SMR区域向PMR区域切换的流程图,该流程图示出了下述步骤一至步骤六:
步骤一、判断空闲容量是否大于或等于1个PMR区域。如果是,执行步骤二,如果否,则结束。
步骤二、将连续的多个SMR区域中存储的数据迁移至其他区域中。
步骤三、判断数据是否迁移结束,如果是,则执行步骤四,如果否,则结束。
步骤四、将数据迁移结束的SMR区域标记为可转换区。
步骤五、指令可转换区使能支持PMR方式的参数,并且去使能支持SMR方式的参数。
步骤六、判断当前的PMR区域的数量是否低于设定的第二数量阈值,如果是,继续执行上述步骤二至步骤六,如果否,则结束。
通过图8所示的方法,对于侧重容量,而IOPS相对不足的SMR盘来说,如果SMR盘存储的数据温度升高,随机访问的频率变多,而在这种场景下,使用SMR方式进行存储时,IOPS会跟不上。此时,可以通过减少一部分SMR区域,将这些SMR区域转换为PMR区域,来提高IOPS,以便满足存储热数据时,对IOPS的更高要求。
以第一区域为PMR区域,第二区域为SMR区域为例,在一些可能的实施例中,参见图9,其示出了PMR盘将盘中的PMR区域,从PMR区域向SMR区域切换的流程图,该流程图示出了下述步骤一至步骤六:
步骤一、判断空闲容量是否大于或等于1个SMR区域。如果是,执行步骤二,如果否,则结束。
步骤二、将PMR区域中存储的数据迁移至其他区域中。
步骤三、判断数据是否迁移成功,如果是,则执行步骤四,如果否,则结束。
步骤四、将数据迁移结束的PMR区域标记为可转换区。
步骤五、指令可转换区使能支持SMR方式的参数,并且去使能支持PMR方式的参数。
步骤六、判断当前的SMR区域的数量是否低于设定的第二数量阈值,如果是,继续执行上述步骤二至步骤六,如果否,则结束。
通过图9所示的方法,对于侧重IOPS,存储容量相对不足的PMR盘来说,如果PMR盘存储的数据温度降低,随机访问的频率变少,而在这种场景下,此时,可以减少一部分PMR区域,将这些PMR区域转换为SMR区域,来提高存储容量,以便存储更多的数据。
在一个示例性场景中,存储设备可以包括处理器以及大量的区域。处理器通过执行上述方法实施例中的各个步骤,可以控制一个或多个区域在SMR区域与PMR区域之间灵活地进行切换,从而在存储容量和IOPS之间找到平衡,即,如果当前需要更多的存储容量,就将PMR区域转换为SMR区域,如果当前需要提高IOPS,就将SMR区域转换为PMR区域。并且,切换的方向可以是双向的,即,既可以控制区域从SMR区域切换为PMR区域,也可以控制区域从PMR区域切换为SMR区域。
通过本实施例提供的方法,在提高存储容量或IOPS的基础上,还至少可以达到以下效果:
第一,相关技术中,HDD会按照存储容量的不同,分为各种各样的规格型号,比如存储容量是1太字节(英文全称:terabyte,英文简称:TB)的HDD记为规格1,存储容量是1.1TB的HDD记为规格2,存储容量是1.2TB的HDD记为规格3,由于规格型号繁多,导致HDD厂商在制作销售HDD时较为不便。而通过本实施例提供的方法,HDD的存储容量可以是一个变量,该变量可以在一个范围内动态地进行变化,该范围的最小值可以是HDD中的每个区域均为PMR区域时,HDD的存储容量,该范围的最大值可以是HDD中的每个区域均为SMR区域时,HDD的存储容量。该变量的具体取值可以由HDD的处理器或系统控制器,通过转换区域的存储格式来进行控制。如此,由于HDD的存储容量不再是规格对应的固定的、单一的数值,而是可以根据需求来动态调整的变量,因此可以减少甚至消除HDD的规格型号。比如说,HDD可以不区分规格型号是规格1、规格2还是规格3,而是将1T至1.2T统一记为1个规格,如果需要提高存储容量,控制更多的PMR区域转换为SMR区域即可,如果不再需要提高存储容量,控制更多的SMR区域转换为PMR区域即可,从而通过规格型号的减少甚至删除,来极大地提高HDD厂商的灵活性。进一步地,当推出新的硬盘时,可以减少新的硬盘的型号,从而减轻硬盘生产厂商以及存储服务的提供方的压力。
第二,在将各个规格型号的硬盘合并为规格型号统一的硬盘的基础上,可以对各个规格型号的硬盘的测试任务进行合并,从而减少测试任务的开销。例如,原来需要对规格1、规格2以及规格3的HDD 分别设计一种测试策略,总共需要设计3种测试策略,并采用3种测试策略,分别对3种规格的HDD进行测试。而通过采用本实施例提供的方法,可以将规格1、规格2以及规格3合并为1个规格,为该规格设计1种测试策略,采用该测试策略对该规格的HDD测试即可,如此,可以减轻硬盘生产厂商以及存储服务的提供方进行测试工作的压力。
第三,在将各个规格型号的硬盘合并为规格型号统一的硬盘的基础上,可以对各个规格型号的硬盘的更新任务进行合并,从而减少更新工作的开销。例如,以更新任务为进行故障修复为例,如果HDD中出现某种故障,原来需要对规格1、规格2以及规格3的HDD分别设计一种故障修复策略,总共需要设计3种故障修复策略,并采用3种故障修复策略,分别对3种规格的HDD进行测试。而通过采用本实施例提供的方法,可以将规格1、规格2以及规格3合并为1个规格,为该规格设计1种故障修复策略,采用该故障修复策略对该规格的HDD进行修复即可,如此,可以减轻硬盘生产厂商以及存储服务提供方执行更新工作的压力。
本实施例提供的方法,通过将SMR区域的存储格式从SMR方式转换为PMR方式,来得到PMR区域,由于PMR方式相对于SMR方式来说,IOPS更高,因此在转换存储格式后,可以提高区域的IOPS,并且可以进而提高存储设备整体的IOPS。或者,通过将PMR区域的存储格式从PMR方式转换为SMR方式,来得到SMR区域,由于SMR方式相对于PMR方式来说,存储容量更高,因此在转换存储格式后,可以提高区域的存储容量,并且可以进而提高存储设备的存储容量。
下面,以存储单元为盘为例,通过图10实施例对硬盘格式转换的流程进行描述。
图10是本申请实施例提供的一种硬盘格式转换方法的流程图,如图10所示,该方法可以应用于图6所示的存储设备中,例如可以由存储设备600的系统控制器601执行。该方法包括下述步骤1001至1004:
步骤1001、系统控制器判断存储设备是否满足预设条件。
在一些可能的实施例中,预设条件可以包括以下条件(1)至条件(6)中的任意一种及其组合:
条件(1)存储设备的空闲空间是否低于设定的空间阈值。
如果预设条件包括条件(1),系统控制器可以获取存储设备的空闲空间,判断存储设备的空闲空间是否低于设定的空间阈值,如果存储设备的空闲空间低于设定的空间阈值,则执行下述步骤1002。其中,系统控制器可以获取存储设备中每个盘的空闲空间,确定所有盘的空闲空间的总和,作为存储设备的空闲空间。
如果根据条件(1)来执行步骤1001,系统控制器可以在存储设备的空闲空间不足的场景下,通过确定存储设备满足条件(1),来将PMR盘的存储格式,从PMR方式转换为SMR方式,从而得到SMR盘,那么由于SMR盘相对于PMR盘来说,存储容量更高,因此可以提高存储设备的存储容量,从而可以解决空闲空间不足的问题。
空间阈值可以根据实验、经验或需求设置,本实施例对空间阈值的具体数值不做限定。在一些可能的实施例中,空间阈值可以预先存储在系统控制器中。例如,空间阈值可以存储在系统控制器的存储器中。系统控制器可以从存储器中读取该空间阈值。在另一些可能的实施例中,用户可以在终端上输入该空间阈值,终端可以获取用户输入的空间阈值,终端可以向系统控制器发送该空间阈值,系统控制器可以从终端接收该空间阈值。
可选地,空间阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送空间阈值,系 统控制器每当从终端接收到空间阈值时,可以将已存储的空间阈值更新为接收到的空间阈值。结合这种方式、条件(1)以及后续步骤,系统控制器可以动态地调整空闲空间的大小。例如,系统控制器原本设定的空间阈值为a,系统控制器通过判断空闲空间是否低于a,在空闲空间小于a的情况下,执行后续步骤,将PMR盘的存储格式从PMR方式转换为SMR方式,直到空闲空间达到a为止,从而将存储设备的空闲空间控制为a。之后终端向系统控制器发送空间阈值b,系统控制器通过将空间阈值更新为b,重新判断空闲空间是否低于b,在空闲空间小于b的情况下,执行后续步骤,将其他PMR盘的存储格式也从PMR方式转换为SMR方式,从而得到更多的SMR盘,直到空闲空间达到b为止,从而将空闲空间控制为b。那么,系统控制器可以将空闲空间从a动态地调整到b,提高了灵活性。其中,b和a为正数,b与a不同。
条件(2)第一盘的数量是否高于设定的第一数量阈值。
如果预设条件包括条件(2),系统控制器可以获取存储设备中第一盘的数量,判断存储设备中第一盘的数量是否高于设定的第一数量阈值,如果第一盘的数量高于设定的第一数量阈值,则执行下述步骤1002。
通过根据条件(2)来执行步骤1001,系统控制器可以在第一盘的数量足够的场景下,转换出更多的第二盘,以满足存储容量或性能的需求。具体来说,第一盘可以为SMR盘,通过判断SMR盘是否高于设定的第一数量阈值,如果SMR盘的数量高于设定的第一数量阈值,则执行后续步骤,来将SMR盘的存储格式从SMR方式转换为PMR方式,从而转换出PMR盘,那么由于PMR盘相对于SMR盘来说,IOPS更高,因此可以提高IOPS,从而提高了存储设备的性能。在另一些可能的实施例中,第一盘可以为PMR盘,通过判断存储设备中PMR盘是否高于设定的第一数量阈值,如果PMR盘的数量高于设定的第一数量阈值,则执行后续步骤,来将第一盘的存储格式从PMR方式转换为SMR方式,转换出更多的SMR盘,那么由于SMR盘相对于PMR盘来说,存储容量更高,从而提高了存储设备的存储容量。
第一数量阈值可以根据实验、经验或需求设置,本实施例对第一数量阈值的具体数值不做限定。在一些可能的实施例中,第一数量阈值可以预先存储在系统控制器中,例如存储在系统控制器的存储器中。系统控制器可以从存储器中读取该第一数量阈值。在另一些可能的实施例中,用户可以在终端上输入该第一数量阈值,终端可以获取用户输入的第一数量阈值,终端可以向系统控制器发送该第一数量阈值,系统控制器可以从终端接收该第一数量阈值。
可选地,第一数量阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送第一数量阈值,系统控制器每当从终端接收到第一数量阈值时,可以将已存储的第一数量阈值更新为接收到的第一数量阈值。结合这种方式、条件(2)以及后续步骤,系统控制器可以动态地调整第一盘的数量的多少。例如,系统控制器原本设定的第一数量阈值为c,系统控制器通过判断第一盘的数量是否高于c,在第一盘的数量高于c的情况下,执行后续步骤,对第一盘的存储格式进行转换,从而减少第一盘的数量,而得到更多的第二盘。之后终端向系统控制器发送第一数量阈值d,系统控制器通过将第一数量阈值更新为d,重新判断第一盘的数量是否高于d,在第一盘的数量高于d的情况下,执行后续步骤,从而得到更多的第二盘。那么,如果d小于c,则可以在已经转换过硬盘的存储格式后,进一步减少第一盘的数量,来增加第二盘的数量。
条件(3)第二盘的数量是否低于设定的第二数量阈值。
如果预设条件包括条件(3),系统控制器可以获取存储设备中第二盘的数量,判断存储设备中第二盘的数量是否低于设定的第二数量阈值,如果第二盘的数量低于设定的第二数量阈值,则执行下述步骤 1002。
通过根据条件(3)来执行步骤1001,系统控制器可以在第二盘的数量不足的场景下,转换出更多的第二盘以满足存储容量或性能的需求。在一些可能的实施例中,第二盘可以为SMR盘,通过判断存储设备中SMR盘是否低于设定的第二数量阈值,如果SMR盘的数量低于设定的第二数量阈值,则执行后续步骤,可以将PMR盘的存储格式从PMR方式转换为SMR方式,得到SMR盘,从而可以让存储设备包括的SMR盘更多,保证SMR盘的数量可以符合需求。并且,由于SMR盘相对于PMR盘来说,存储容量更高,因此可以提高存储设备的存储容量。在另一些可能的实施例中,第二盘可以为PMR盘,通过判断存储设备中PMR盘是否低于设定的第二数量阈值,如果PMR盘的数量低于设定的第二数量阈值,则执行后续步骤,可以将SMR盘的存储格式从SMR方式转换为PMR方式,从而可以让存储设备包括的PMR盘更多,保证PMR盘的数量可以符合需求。并且,由于PMR盘相对于SMR盘来说,IOPS更高,因此可以提高IOPS,从而可以提高存储设备的性能。
第二数量阈值和第一数量阈值可以相同,也可以不同,本实施例对第二数量阈值与第一数量阈值之间的数值大小关系不做限定。第二数量阈值可以根据实验、经验或需求设置,本实施例对第二数量阈值的具体数值不做限定。在一些可能的实施例中,第二数量阈值可以预先存储在系统控制器中,例如存储在系统控制器的存储器中。系统控制器可以从存储器中读取该第二数量阈值。在另一些可能的实施例中,用户可以在终端上输入该第二数量阈值,终端可以获取用户输入的第二数量阈值,终端可以向系统控制器发送该第二数量阈值,系统控制器可以从终端接收该第二数量阈值。
可选地,第二数量阈值可以表示为存储设备中盘的总数量与比例阈值的乘积,该比例阈值为第二盘的总数量与第一盘的总数量之间的比值,该比例阈值的单位可以为百分比,该比例阈值表示第二盘在存储设备所占的比重。例如,如果该比例阈值记为x,第二数量阈值可以表示为盘的总数量*x%。其中x为正数。
可选地,第二数量阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送第二数量阈值,系统控制器每当从终端接收到第二数量阈值时,可以将已存储的第二数量阈值更新为接收到的第二数量阈值。结合这种方式、条件(2)以及后续步骤,系统控制器可以动态地调整第二盘的数量的多少。例如,系统控制器原本设定的第二数量阈值为c,系统控制器通过判断第二盘的数量是否低于d,在第二盘的数量低于d的情况下,执行后续步骤,对硬盘的存储格式进行转换,以得到更多的第二盘,直至第二盘的数量达到d为止。之后终端向系统控制器发送第二数量阈值e,系统控制器通过将第二数量阈值更新为e,重新判断第二盘的数量是否低于e,在第二盘的数量低于e的情况下,执行后续步骤,以得到更多的第二盘,直至第二盘的数量达到e为止。那么,如果d小于e,则可以将第二盘的数量在d的基础上调整至e,从而进一步增加了第二盘的数量。
条件(4)存储设备中存储的冷数据是否达到设定的第一比例阈值。
如果预设条件包括条件(4),系统控制器可以获取存储设备中存储的冷数据所占的比例,判断存储设备中存储的冷数据是否达到设定的第一比例阈值,如果冷数据达到设定的第一比例阈值,则执行下述步骤1002。其中,冷数据是指访问频率低于温度阈值的数据,该温度阈值可以预先存储在系统控制器中。在一种可能的实现中,系统控制器可以获取每个盘中存储的冷数据的数据量以及每个盘存储的所有数据的数据量,获取冷数据的数据量与所有数据的数据量之间的比值,作为存储设备中存储的冷数据的比例,对冷数据的比例与设定的第一比例阈值进行比较,从而判定冷数据是否达到设定的第一比例阈值。
在一些可能的实施例中,如果采用条件(4)来执行步骤1001,第一盘可以为PMR盘,第二盘可 以为SMR盘。通过条件(4),系统控制器可以在冷数据的比例较大的场景下,通过判断存储设备中冷数据是否达到设定的第一比例阈值,如果冷数据达到设定的第一比例阈值,则将PMR盘转换为SMR盘,从而得到更多的SMR盘。那么一方面,由于存储设备中存储的冷数据的比例较大,则对于该存储设备来说,IOPS的要求较低,因此即使将该PMR盘转换为SMR盘,也不会由于PMR盘的减少,而过多的影响存储设备的整体性能。另一方面,由于SMR盘相对于PMR盘来说,存储容量更高,可以提高整体的存储容量。
第一比例阈值可以根据实验、经验或需求设置,本实施例对第一比例阈值的具体数值不做限定。在一些可能的实施例中,第一比例阈值可以预先存储在系统控制器中,例如存储在系统控制器的存储器中。系统控制器可以从存储器中读取该第一比例阈值。在另一些可能的实施例中,用户可以在终端上输入该第一比例阈值,终端可以获取用户输入的第一比例阈值,终端可以向系统控制器发送该第一比例阈值,系统控制器可以从终端接收该第一比例阈值。
可选地,第一比例阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送第一比例阈值,系统控制器每当从终端接收到第一比例阈值时,可以将已存储的第一比例阈值更新为接收到的第一比例阈值。
在一些可能的实施例中,条件(4)可以包括:存储设备中存储的冷数据是否达到设定的第一比例阈值,且存储设备中存储的冷数据在目标时间段内的增长量是否达到设定的第一增长量阈值。在这种条件下,系统控制器可以获取存储设备中存储的冷数据所占的比例,以及存储设备中存储的冷数据在目标时间段内的增长量;判断存储设备中存储的冷数据是否达到设定的第一比例阈值,且目标时间段内的增长量是否达到设定的第一增长量阈值;如果存储设备中存储的冷数据已经达到设定的第一比例阈值,且预设时长内的增长量已经达到设定的第一增长量阈值,表明存储设备的数据较冷,且数据的温度向更冷的趋势变化,需要更冷一级的存储,则执行下述步骤1002。其中,该目标时间段的时长可以是预设时长,该目标时间段的时间结束点可以是当前时间点。
条件(5)存储设备中存储的热数据是否达到设定的第二比例阈值。
如果预设条件为条件(5),系统控制器可以获取存储设备中存储的热数据所占的比例,判断存储设备中存储的热数据是否达到设定的第二比例阈值,如果热数据达到设定的第二比例阈值,则执行下述步骤1002。其中,热数据也称热点数据,热数据是指访问频率低于温度阈值的数据,温度阈值可以预先存储在存储设备中。在一种可能的实现中,系统控制器可以获取每个盘存储的热数据的数据量以及每个盘存储的所有数据的数据量,获取热数据的数据量与所有数据的数据量之间的比值,作为存储设备中存储的热数据的比例,对热数据的比例与设定的第一比例阈值进行比较,从而判定热数据是否达到设定的第一比例阈值。
在一些可能的实施例中,如果采用条件(5)来执行步骤1001,第一盘可以为SMR盘、第二盘可以为PMR盘。通过条件(5),系统控制器可以在热数据的比例较大的场景下,通过判断存储设备中热数据是否达到设定的第二比例阈值,如果热数据达到设定的第二比例阈值,则将SMR盘转换为PMR盘,从而得到更多的PMR盘。那么由于存储设备中存储的热数据的比例较大,则对于该存储设备来说,IOPS的要求较高,因此将该存储设备的SMR盘转换为PMR盘,由于PMR盘相对于SMR盘来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
第二比例阈值可以根据实验、经验或需求设置,本实施例对第二比例阈值的具体数值不做限定。在一些可能的实施例中,第二比例阈值可以预先存储在系统控制器中,例如存储在系统控制器的存储器中。 系统控制器可以从存储器中读取该第二比例阈值。在另一些可能的实施例中,用户可以在终端上输入该第二比例阈值,终端可以获取用户输入的第二比例阈值,终端可以向系统控制器发送该第二比例阈值,系统控制器可以从终端接收该第二比例阈值。
可选地,第二比例阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送第二比例阈值,系统控制器每当从终端接收到第二比例阈值时,可以将已存储的第二比例阈值更新为接收到的第二比例阈值。
在一些可能的实施例中,条件(05)可以包括:存储设备中存储的热数据是否达到设定的第二比例阈值,且存储设备中存储的热数据在目标时间段内的增长量是否达到设定的第二增长量阈值。在这种条件下,系统控制器可以获取存储设备中存储的热数据所占的比例,以及存储设备中存储的热数据在目标时间段内的增长量;判断存储设备中存储的热数据是否达到设定的第二比例阈值,且目标时间段内的增长量是否达到设定的第二增长量阈值;如果存储设备中存储的热数据已经达到设定的第二比例阈值,且预设时长内的增长量已经达到设定的第二增长量阈值,表明存储设备的数据较热,且数据的温度向更热的趋势变化,需要更高的IOPS,则执行下述步骤1002。
在一些可能的实施例中,可以通过机器学习,即人工智能(英文全称:artificial intelligence,英文简称:AI)的方式,来确定数据是冷数据还是热数据。例如,可以调用分类模型,将数据输入该分类模型,输出数据的温度标签,该温度标签的取值可以包括两种,一种表示冷数据,另一种表示热数据。如果数据的温度标签表示冷数据,则可以确定数据为冷数据,如果数据的温度标签表示热数据,则可以确定数据为热数据。其中,该分类模型可以根据多个样本数据以及每个样本数据的温度标签训练得到。又如,可以调用回归模型,将数据输入该回归模型,输出数据的温度,可以根据数据的温度判断数据是冷数据还是热数据。其中,该回归模型根据多个样本数据以及每个样本数据的温度训练得到。其中,该分类模型或该回归模型可以预先存储在系统控制器中。在一些可能的实施例中,可以通过海量的样本数据以及每个样本数据的温度标签或温度,进行模型训练,得到分类模型或回归模型。其中,样本数据可以包括不同的类型,例如可以包括文字、图片、视频等。可以在该系统控制器上进行模型训练,也可以在其他设备上进行模型训练,将得到的分类模型或回归模型发送给系统控制器。
通过机器学习的方式,可以准确地判断出数据是冷数据还是热数据,那么结合数据的冷热与否以及条件(5)或条件(6),可以让转换硬盘格式的时机更加及时和准确。
条件(6)存储设备的IOPS是否低于设定的读写阈值。
如果预设条件包括条件(6),系统控制器可以获取存储设备的IOPS,判断存储设备的IOPS是否低于设定的读写阈值,如果IOPS低于设定的读写阈值,则执行下述步骤1002。
在一些可能的实施例中,如果采用条件(6)来执行步骤1001,第一盘可以为SMR盘,第二盘可以为PMR盘。在存储设备的IOPS不满足需求的场景下,系统控制器通过判断存储设备的IOPS是否低于设定的读写阈值,如果IOPS低于设定的读写阈值,则将SMR盘转换为PMR盘,从而得到更多的PMR盘。那么由于PMR盘相对于SMR盘来说,IOPS更高,可以提高存储设备的IOPS,从而提高存储设备的性能。
读写阈值可以根据实验、经验或需求设置,本实施例对读写阈值的具体数值不做限定。在一些可能的实施例中,读写阈值可以预先存储在系统控制器中,例如存储在系统控制器的存储器中。系统控制器可以从存储器中读取该读写阈值。在另一些可能的实施例中,用户可以在终端上输入该读写阈值,终端可以获取用户输入的读写阈值,终端可以向系统控制器发送该读写阈值,系统控制器可以从终端接收该 读写阈值。可选地,读写阈值可以动态地进行调整。具体来说,终端可以多次向系统控制器发送读写阈值,系统控制器每当从终端接收到读写阈值时,可以将已存储的读写阈值更新为接收到的读写阈值。
在一些可能的实施例中,上述条件(1)至条件(6)可以采用两种或两种以上的组合方式组合。其中,组合的方式可以为且的方式,也可以为或的方式。示例性地,以上述条件(1)和条件(2)组合为例,系统控制器可以判断存储设备的空闲空间是否低于设定的空间阈值,且PMR盘的数量是否高于设定的第一数量阈值;如果存储设备的空闲空间低于设定的空间阈值,且PMR盘的数量高于设定的第一数量阈值,表明存储设备当前的空闲空间不足,且具有足够的PMR盘可以转换,则执行下述步骤1002。
步骤1002、如果存储设备满足预设条件,系统控制器选取第一盘。
为了区分描述,将存储格式转换前的盘称为第一盘,将存储格式转换后的盘称为第二盘。系统控制器可以从存储设备中的至少两个盘中,选取该第一盘,以便将选取的第一盘转换为第二盘。
其中,该第一盘采用第一存储格式存储数据,第二盘采用第二存储格式存储数据。该第一存储格式和该第二存储格式分别为SMR方式或PMR方式的其中一种,并且该第一存储格式和该第二存储格式不同。
具体来说,在一些可能的实施例中,第一盘可以为SMR盘,第一盘采用SMR方式存储数据,第二盘可以为PMR盘,第二盘采用PMR方式存储数据。在另一些可能的实施例中,第一盘可以为PMR盘,第一盘采用PMR方式存储数据,第二盘可以为SMR盘,第二盘采用SMR方式存储数据。
步骤1003、系统控制器将第一盘中存储的数据迁移至存储设备的其他盘中。
系统控制器可以从存储设备中选取与第一盘不同的其他盘,将第一盘存储的数据迁移至其他盘中,从而预先将第一盘存储的数据整理到其他位置,避免第一盘存储的数据丢失,达到对第一盘存储的数据进行备份的效果。其中,该其他盘可以为一个或多个空闲的盘,该空闲的盘可以为完全空闲或者部分空闲的盘,该其他盘的容量可以大于或等于第一盘的容量。
在一些可能的实施例中,如果系统控制器判断要更冷一级的存储,例如系统控制器判断存储设备满足预设条件(4),则可以选取存储有冷数据的PMR盘,将PMR盘存储的冷数据进行迁移,并将PMR盘转换为SMR盘。如果系统控制器判断需要更高的IOPS,例如系统控制器判断存储设备满足预设条件(5),则可以选取存储有热数据的SMR盘,将SMR盘存储的热数据进行迁移,并将SMR盘转换为PMR盘。
步骤1004、系统控制器指令第一盘将第一存储格式转换为第二存储格式,得到第二盘。
系统控制器可以指令SMR盘将存储格式从SMR方式转换为PMR方式,得到PMR盘。或者,系统控制器可以指令PMR盘将存储格式从PMR方式转换为SMR方式,得到SMR盘。
在一些可能的实施例中,系统控制器可以指令SMR盘将每个SMR区域的存储格式,均从SMR方式转换为PMR方式,则SMR盘的每个SMR区域均变成了PMR区域,从而转换得到PMR盘。当然,系统控制器也可以指令SMR盘,将部分SMR区域转换为PMR区域,而剩余的SMR区域可以保持为SMR区域,从而得到同时包括SMR区域和PMR区域的SMR盘。同理地,系统控制器可以指令PMR盘将每个PMR区域的存储格式,均从PMR方式转换为SMR方式,则PMR盘的每个PMR区域均变成了SMR区域,从而转换为SMR盘。系统控制器也可以指令PMR盘,将部分PMR区域转换为SMR区域,剩余的PMR区域可以保持为PMR区域,从而得到同时包括SMR区域和PMR区域的PMR盘。
在一些可能的实施例中,转换存储格式的功能可以通过使能新的存储格式对应的参数、去使能旧的存储格式对应的参数实现。具体来说,第一盘可以预先配置有第一参数和第二参数。该第一参数用于支 持该第一存储格式,该第二参数用于支持该第二存储格式。系统控制器可以指令第一盘使能第二参数,并且去使能第一参数。通过使能第二参数、去使能第一参数,第一盘的参数会从第一参数更新为第二参数,那么后续使用第一盘存储数据时,第一盘就会采用第二参数所支持的存储格式来存储数据,而不再采用第一参数所支持的存储格式来存储数据,从而实现了转换存储格式的功能。
例如,如果第一盘为SMR盘,第二盘为PMR盘,第一存储格式为SMR方式,第二存储格式为PMR方式,则该第一参数是指用于支持SMR方式的参数,即SMR盘的磁盘格式,第二参数是指用于支持PMR方式的参数,即PMR盘的磁盘格式。系统控制器通过指令SMR盘使能支持PMR方式的参数,去使能支持SMR方式的参数,从而将SMR盘转换为PMR盘。同理地,如果第一盘为PMR盘,第二盘为SMR盘,第一存储格式为PMR方式,第二存储格式为SMR方式,则第一参数是指用于支持PMR方式的参数,即PMR盘的磁盘格式,第二参数是指用于支持SMR方式的参数,即SMR盘的磁盘格式。系统控制器通过指令PMR盘使能支持SMR方式的参数,去使能支持PMR方式的参数,从而将PMR盘转换为SMR盘。
在一些可能的实施例中,系统控制器在指令第一盘将第一存储格式转换为第二存储格式之后,可以继续判断存储设备是否满足预设条件,如果存储设备尚未满足预设条件,则继续选取第一盘,对继续选取的第一盘的存储格式进行转换,得到更多的第二盘,通过重复执行这样的步骤,可以让存储设备趋近于满足预设条件,直至存储设备已经满足预设条件为止,停止执行转换存储格式的步骤,如此,可以将存储设备控制为满足预设条件的状态,从而扩展了对存储设备的控制功能。
例如,如果系统控制器指令PMR盘将存储格式从PMR方式转换为SMR方式后,存储设备的空闲空间仍然低于设定的空间阈值,则系统控制器可以继续指令其他PMR盘也将存储格式从PMR方式转换为SMR方式,从而转换得到更多的SMR盘,来通过更多的SMR盘,继续提高存储设备的空闲空间,直至存储设备的空闲空间达到设定的空间阈值。如此,可以将存储设备的空闲空间的大小控制在空间阈值左右。
又如,如果系统控制器指令第一盘将该第一存储格式转换为第二存储格式后,存储设备的第二盘的数量仍然低于设定的第二数量阈值,则系统控制器可以继续指令其他第一盘将存储格式从第一存储格式转换为第二存储格式,从而转换得到更多的第二盘,以继续提高存储设备的第二盘的数量,直至存储设备的第二盘的数量达到第二数量阈值。如此,可以将存储设备的第二盘的数量控制在第二数量阈值左右,例如,如果第二数量阈值为K,通过执行本实施例提供的方法,可以将SMR盘的数量或PMR盘的数量控制在K左右,K为正整数。
可选地,如果存储设备多次执行选取第一盘以及转换第一盘的存储格式的步骤,存储设备可以将下一次选取的第一盘中存储的数据,迁移至上一次转换出的第二盘中。例如,在从SMR盘向PMR盘转换的场景下,当存储设备将SMR盘1转换为PMR盘1后,当要对SMR盘2的存储格式进行转换时,可以先将SMR盘2中存储的数据迁移至PMR盘1中,再对SMR盘1进行转换。当然,存储设备也可以将继续选取的第一盘中存储的数据迁移至其他盘中,本实施例对此不做限定。
在一些可能的实施例中,在得到第二盘后,系统控制器可以在第二盘中存储数据。在一些可能的实施例中,处理器可以在接收到写请求后,获取写请求中的数据,将写请求中的数据存储在第二盘中。在另一些可能的实施例中,处理器可以将其他盘中存储的数据迁移到第二盘中。示例性地,如果第二盘是SMR盘,可以将其他盘存储的冷数据迁移到该第二盘中;而如果第二盘是PMR盘,可以将其他盘存储的热数据迁移到该第二盘中。如此,可以充分的利用SMR方式存储容量更高、PMR方式IOPS更高的 特性,调整存储设备中冷热数据的分布,从而对存储设备整体的存储资源进行合理的规划,保证整体性能更加优化。
在一些可能的实施例中,存储设备可以存储盘标识与盘类型之间的对应关系,该对应关系包括至少一个盘标识以及每个盘标识对应的盘类型,例如可以如下表2所示。当系统控制器指令第一盘将第一存储格式转换为第二存储格式后,可以根据第一盘的盘标识,查询该对应关系中该盘标识对应的盘类型,将该盘类型更新为第二存储格式对应的盘类型。例如,如果系统控制器指令盘1将存储格式从SMR方式转换为PMR方式,则可以在对盘1的存储格式进行转换后,将下表2中盘1对应的SMR盘更新为PMR盘。其中,盘标识用于标识对应的盘,例如可以是盘的ID、编号等,盘标识可以由系统控制器为每个盘分配得到。盘类型可以包括SMR盘以及PMR盘这两种类型。盘标识与盘类型之间的对应关系可以存储在系统控制器的存储器中,终端可以从系统控制器的存储器中,读取该对应关系,根据对应关系,可以获知存储设备中每个盘分别是哪种类型,另外还可以根据每个盘的类型,确定存储设备当前的SMR盘的数量以及PMR盘的数量,将SMR盘的数量以及PMR盘的数量呈现给上层应用,以便上层应用管理存储设备。
表2
盘标识 盘类型
盘1 SMR盘
盘2 PMR盘
盘3 SMR盘
在一些可能的实施例中,系统控制器可以记录存储设备的SMR盘的数量以及PMR盘的数量。例如可以在上层应用软件中存储记录信息,该记录信息包括SMR盘的数量以及PMR盘的数量,存储设备指令第一盘转换存储格式后,可以根据当前的SMR盘的数量以及PMR盘的数量,更新该记录信息。例如,如果存储设备将k个SMR盘转换为m个PMR盘,可以将记录信息中SMR盘的数量减少k,并且将记录信息中PMR盘的数量增加m。其中k以及m为正整数。
在一些可能的实施例中,参见图11,其示出了存储设备在SMR盘与PMR盘之间切换的流程图,该流程图示出了下述步骤一至步骤六:
步骤一、通过机器学习的方式,确定存储设备中存储的数据的温度。
步骤二、判断数据的温度变化是否大于设定的阈值,如果是,执行步骤三,如果否,则结束。
步骤三、判断是需要更冷一级的存储,还是需要更高的IOPS。如果判断需要更冷一级的存储,则执行下述步骤四,如果判断需要更高的IOPS,则执行下述步骤六。
步骤四、将PMR盘的数据迁移到其他盘。
步骤五、启动从PMR盘向SMR盘转换的机制。
步骤六、将SMR盘的数据迁移到其他盘。
步骤七、启动从SMR盘向PMR盘转换的机制。
步骤八、在上层应用更新PMR盘的信息以及SMR盘的信息。
通过图11所示的方法,对于同时存在SMR盘和PMR盘的存储设备来说,在不同的应用场景,以及不同的时间,数据的温度会有相对变化。若变冷的数据相对较多,则可以通过上述方法,把部分PMR 盘转换成SMR盘。若变热的数据相对较多,则在容量比例允许的情况下,把部分SMR盘转换成PMR盘。
在一个示例性场景中,存储设备可以用于提供海量的数据存储服务,存储设备可以包括存储控制器以及大量的盘。系统控制器通过执行上述方法实施例中的各个步骤,可以控制一个或多个盘在SMR盘与PMR盘之间灵活地进行切换,从而在存储容量和IOPS之间找到平衡,即,如果当前需要更多的存储容量,就将盘转换为SMR盘,如果当前需要提高IOPS,就将盘转换为PMR盘。并且,切换的方向可以是双向的,即,既可以控制盘从SMR盘切换为PMR盘,也可以控制盘从PMR盘切换为SMR盘。另外,还可以控制盘从纯粹的SMR盘或纯粹的PMR盘,切换为混合的盘。其中,这里所说的纯粹的盘是指存储格式单一的盘,存储格式要么是SMR方式,要么是PMR方式,这里所说的混合的盘是指包括两种存储格式的盘,该混合的盘的存储格式包括SMR方式以及PMR方式。
本实施例提供的方法,通过将SMR盘的存储格式从SMR方式转换为PMR方式,来得到PMR盘,由于PMR盘相对于SMR盘来说,IOPS更高,因此在转换存储格式后,可以提高盘的IOPS,并且可以提高存储设备整体的IOPS。或者,通过将PMR盘的存储格式从PMR方式转换为SMR方式,来得到SMR盘,由于SMR盘相对于PMR盘来说,存储容量更高,因此在转换存储格式后,可以提高盘的存储容量,并且可以提高存储设备整体的存储容量。
上述所有可选技术方案,可以采用任意结合形成本申请的可选实施例,在此不再一一赘述。
图12是本申请实施例提供的一种硬盘格式转换装置的结构示意图,如图12所示,该装置包括:选取模块1201,用于选取第一存储单元,例如执行步骤702或执行步骤1002;指令模块1202,用于指令第一存储单元将第一存储格式转换为第二存储格式,得到第二存储单元,例如执行步骤704或执行步骤1004;
在一种可能的实现中,该装置还包括:判断模块,用于执行步骤701或执行步骤1001。
在一种可能的实现中,该预设条件包括步骤702或步骤1002中预设条件(1)至预设条件(6)中的任意一种及其组合:
在一种可能的实现中,该指令模块1202具体用于指令该第一存储单元使能该第二参数,并且去使能该第一参数。
在一种可能的实现中,该装置还包括:迁移模块,用于将第一存储单元中存储的数据迁移至其他存储单元中,例如执行步骤703或步骤1003。
需要说明的一点是,该硬盘格式转换装置可以位于存储设备中,图12实施例涉及的每个步骤,可以由存储设备的处理器调用存储设备的存储器所存储的指令来执行。另外,该硬盘格式转换装置也可以位于盘中,图12实施例涉及的每个步骤,可以由盘的处理芯片来执行。另外,该硬盘格式转换装置可以位于磁盘阵列的系统控制器中,图12实施例涉及的每个步骤,可以由系统控制器的处理器调用系统控制器的存储器所存储的指令来执行。
需要说明的一点是,图12实施例提供的硬盘格式转换装置在转换硬盘格式时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将存储设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的硬盘格式转换装置与硬盘格式转换方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
本申请还提供一种计算机程序,该计算机程序包括用于执行上述硬盘格式转换方法的指令。例如,该计算机程序可以包括用于执行上述图7实施例中处理器所执行的硬盘格式转换方法的指令,又如,该计算机程序可以包括用于执行上述图10实施例中系统控制器所执行的硬盘格式转换方法的指令。
本申请还提供一种计算机可读存储介质,用于存储计算机程序,所述计算机程序包括用于执行上述硬盘格式转换方法的指令。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序指令可以从一个网站站点、计算机、服务器或数据中心通过有线或无线方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD)、或者半导体介质(例如固态硬盘)等。
本申请中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请中术语“多个”的含义是指两个或两个以上,例如,多个数据包是指两个或两个以上的数据包。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (24)

  1. 一种硬盘格式转换方法,其特征在于,所述方法应用于存储设备中,所述方法包括:
    选取第一存储单元,所述第一存储单元采用第一存储格式存储数据;
    指令所述第一存储单元将所述第一存储格式转换为第二存储格式,得到第二存储单元;
    其中,所述第一存储格式和所述第二存储格式分别为叠瓦片式磁记录SMR方式或垂直磁记录PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
  2. 根据权利要求1所述的方法,其特征在于,在所述选取第一存储单元之前,所述方法还包括:
    判断所述存储设备是否满足预设条件。
  3. 根据权利要求2所述的方法,其特征在于,所述预设条件包括以下条件中的任意一种及其组合:
    所述存储设备的空闲空间是否低于设定的空间阈值,或者
    所述第一存储单元的数量是否高于设定的第一数量阈值,或者
    所述第二存储单元的数量是否低于设定的第二数量阈值,或者
    所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
    所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
    所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
  4. 根据权利要求1所述的方法,其特征在于,所述第一存储单元预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
    所述指令所述第一存储单元将所述第一存储格式转换为第二存储格式具体包括:
    指令所述第一存储单元使能所述第二参数,并且去使能所述第一参数。
  5. 根据权利要求4所述的方法,其特征在于,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
  6. 根据权利要求1所述的方法,其特征在于,在所述指令所述第一存储单元将所述第一存储格式转换为第二存储格式之前,所述方法还包括:
    将所述第一存储单元中存储的数据迁移至所述存储设备的其他存储单元中。
  7. 一种硬盘格式转换装置,其特征在于,所述装置应用于存储设备中,所述装置包括:
    选取模块,用于选取第一存储单元,所述第一存储单元采用第一存储格式存储数据;
    指令模块,用于指令所述第一存储单元将所述第一存储格式转换为第二存储格式,得到第二存储单元;
    其中,所述第一存储格式和所述第二存储格式分别为叠瓦片式磁记录SMR方式或垂直磁记录PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    判断模块,用于判断所述存储设备是否满足预设条件。
  9. 根据权利要求8所述的装置,其特征在于,所述预设条件包括以下条件中的任意一种及其组合:
    所述存储设备的空闲空间是否低于设定的空间阈值,或者
    所述第一存储单元的数量是否高于设定的第一数量阈值,或者
    所述第二存储单元的数量是否低于设定的第二数量阈值,或者
    所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈 值的数据,或者
    所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
    所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
  10. 根据权利要求7所述的装置,其特征在于,所述第一存储单元预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
    所述指令模块具体用于:指令所述第一存储单元使能所述第二参数,并且去使能所述第一参数。
  11. 根据权利要求10所述的装置,其特征在于,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
  12. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    迁移模块,用于将所述第一存储单元中存储的数据迁移至所述存储设备的其他存储单元中。
  13. 一种存储设备,其特征在于,所述存储设备包括处理器以及至少两个区域,所述至少两个区域包括叠瓦片式磁记录SMR区域以及垂直磁记录PMR区域;
    所述处理器,用于选取第一区域,所述第一区域采用第一存储格式存储数据;
    所述处理器,用于指令所述第一区域将所述第一存储格式转换为第二存储格式,得到第二区域;其中,所述第一存储格式和所述第二存储格式分别为SMR方式或PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
  14. 根据权利要求13所述的存储设备,其特征在于,所述处理器还用于判断所述存储设备是否满足预设条件。
  15. 根据权利要求14所述的存储设备,其特征在于,所述预设条件包括以下条件中的任意一种及其组合:
    所述存储设备的空闲空间是否低于设定的空间阈值,或者
    所述第一区域的数量是否高于设定的第一数量阈值,或者
    所述第二区域的数量是否低于设定的第二数量阈值,或者
    所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
    所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
    所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
  16. 根据权利要求13所述的存储设备,其特征在于,所述第一区域预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
    所述处理器具体用于指令所述第一区域使能所述第二参数,并且去使能所述第一参数。
  17. 根据权利要求16所述的存储设备,其特征在于,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
  18. 根据权利要求13所述的存储设备,其特征在于,所述处理器还用于将所述第一区域中存储的数据迁移至所述存储设备的其他区域中。
  19. 一种存储设备,其特征在于,所述存储设备包括系统控制器以及至少两个盘,所述至少两个盘 包括叠瓦片式磁记录SMR盘以及垂直磁记录PMR盘;
    所述系统控制器,用于选取第一盘,所述第一盘采用第一存储格式存储数据;
    所述系统控制器,用于指令所述第一盘将所述第一存储格式转换为第二存储格式,得到第二盘;其中,所述第一存储格式和所述第二存储格式分别为SMR方式或PMR方式的其中一种,并且所述第一存储格式和所述第二存储格式不同。
  20. 根据权利要求19所述的存储设备,其特征在于,所述系统控制器还用于判断所述存储设备是否满足预设条件。
  21. 根据权利要求20所述的存储设备,其特征在于,所述预设条件包括以下条件中的任意一种及其组合:
    所述存储设备的空闲空间是否低于设定的空间阈值,或者
    所述第一盘的数量是否高于设定的第一数量阈值,或者
    所述第二盘的数量是否低于设定的第二数量阈值,或者
    所述存储设备中存储的冷数据是否达到设定的第一比例阈值,所述冷数据是指访问频率低于温度阈值的数据,或者
    所述存储设备中存储的热数据是否达到设定的第二比例阈值,所述热数据是指访问频率高于所述温度阈值的数据,或者
    所述存储设备的每秒读写次数IOPS是否低于设定的读写阈值。
  22. 根据权利要求19所述的存储设备,其特征在于,所述第一盘预先配置有第一参数和第二参数,所述第一参数用于支持所述第一存储格式,所述第二参数用于支持所述第二存储格式,
    所述系统控制器具体用于指令所述第一盘使能所述第二参数,并且去使能所述第一参数。
  23. 根据权利要求22所述的存储设备,其特征在于,所述第一参数包括飞行高度、单位英寸位数BPI、单位英寸磁道数TPI、读头和写头在切线上的距离、读头和写头在径向上的距离中的任意一种及其组合。
  24. 根据权利要求19所述的存储设备,其特征在于,所述系统控制器还用于将所述第一盘中存储的数据迁移至所述存储设备的其他盘中。
PCT/CN2020/075158 2019-05-22 2020-02-14 硬盘格式转换方法、装置及存储设备 Ceased WO2020233175A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910427925.7 2019-05-22
CN201910427925.7A CN110275677B (zh) 2019-05-22 2019-05-22 硬盘格式转换方法、装置及存储设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/484,161 Continuation US11682428B2 (en) 2019-05-22 2021-09-24 Hard disk format conversion method and apparatus, and storage device

Publications (1)

Publication Number Publication Date
WO2020233175A1 true WO2020233175A1 (zh) 2020-11-26

Family

ID=67960145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/075158 Ceased WO2020233175A1 (zh) 2019-05-22 2020-02-14 硬盘格式转换方法、装置及存储设备

Country Status (3)

Country Link
US (1) US11682428B2 (zh)
CN (1) CN110275677B (zh)
WO (1) WO2020233175A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275677B (zh) * 2019-05-22 2022-04-12 华为技术有限公司 硬盘格式转换方法、装置及存储设备
JP7667442B2 (ja) * 2021-09-16 2025-04-23 株式会社バッファロー ストレージデバイス、ストレージデバイスの制御方法、及びプログラム
US12373120B2 (en) * 2023-01-12 2025-07-29 Samsung Electronics Co., Ltd. Method, distributed controller, and system for managing sequential storage devices in distributed storage environment
US12504907B2 (en) * 2023-04-25 2025-12-23 Samsung Electronics Co., Ltd. Operating method of non-volatile memory device using bit flipping
US12260105B1 (en) * 2023-09-21 2025-03-25 VMware LLC Converting the format of a distributed object storage with reduced write operations
CN118586599B (zh) * 2024-06-19 2024-11-19 北京毅通信息技术有限公司 一种数字化实验数据的智能分析系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779528A (zh) * 2011-05-06 2012-11-14 日立环球储存科技荷兰有限公司 具有叠瓦写入和宽区域热辅助的磁记录盘驱动器
US20130342929A1 (en) * 2012-06-21 2013-12-26 HGST Netherlands B.V. Method of compensating for repeatable runout error
US20160232168A1 (en) * 2015-02-06 2016-08-11 HGST Netherlands B.V. Indirection data structures to manage file system metadata
CN107229664A (zh) * 2016-03-25 2017-10-03 Hgst荷兰公司 用于管理文件系统元数据的间接数据结构
CN110275677A (zh) * 2019-05-22 2019-09-24 华为技术有限公司 硬盘格式转换方法、装置及存储设备

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102280112B (zh) * 2011-04-13 2013-12-18 华中科技大学 一种用于硬盘驱动器的热飞高控制滑块
EP2549482B1 (en) * 2011-07-22 2018-05-23 SanDisk Technologies LLC Apparatus, system and method for determining a configuration parameter for solid-state storage media
KR101526042B1 (ko) * 2012-03-02 2015-06-04 에이취지에스티 네덜란드 비.브이. 하이브리드 e 영역을 갖는 싱글 기입 자기 기록(smr)장치
US8908312B2 (en) * 2012-11-19 2014-12-09 HGST Netherlands B.V. Dynamic fly height control that is insensitive to off-track motion
WO2015139193A1 (zh) * 2014-03-18 2015-09-24 华为技术有限公司 一种数据存储格式的转换方法及装置
CN104834675B (zh) * 2015-04-02 2018-02-23 浪潮集团有限公司 一种基于用户行为分析的查询性能优化方法
CN106155579A (zh) * 2015-04-27 2016-11-23 广明光电股份有限公司 固态硬盘动态储存转换层数据的方法
US10474579B2 (en) * 2015-04-29 2019-11-12 Dell Products L.P. Dynamic media cache for a data storage drive in an information handling system
CN106548789B (zh) * 2015-09-17 2019-05-17 伊姆西公司 用于操作叠瓦式磁记录设备的方法和装置
US10120582B1 (en) * 2016-03-30 2018-11-06 Amazon Technologies, Inc. Dynamic cache management in storage devices
US10431246B2 (en) * 2016-12-15 2019-10-01 Seagate Technology Llc Dual actuator storage device utilizing multiple disk zones
CN106874213B (zh) * 2017-01-12 2020-03-20 杭州电子科技大学 一种融合多种机器学习算法的固态硬盘热数据识别方法
CN106899660B (zh) * 2017-01-26 2021-05-14 华南理工大学 基于滚动灰色预测模型的云数据中心节能调度实现方法
US10510374B2 (en) * 2017-07-05 2019-12-17 Seagate Technology Llc Self-healing in a storage system
CN109697023B (zh) * 2017-10-24 2022-04-29 宇瞻科技股份有限公司 延长固态硬盘寿命的方法
CN107728952A (zh) * 2017-10-31 2018-02-23 郑州云海信息技术有限公司 一种预测式数据迁移方法及系统
CN108376053B (zh) * 2018-01-23 2020-02-28 中国科学院计算技术研究所 一种支持原地更新的瓦记录写顺序化方法及装置
US10381040B1 (en) * 2018-02-06 2019-08-13 Western Digital Technologies, Inc. Dynamic hybrid shingled magnetic recording device
US10565119B2 (en) * 2018-03-12 2020-02-18 Kabushiki Kaisha Toshiba SMR drive that maintains physical locations of bands via flush/copy operations
US10936498B2 (en) * 2018-03-12 2021-03-02 Kabushiki Kaisha Toshiba Shingled magnetic recording drive that updates media cache data in-place
CN108563730A (zh) * 2018-04-04 2018-09-21 北京蓝杞数据科技有限公司天津分公司 一种冷热数据自动切换方法、装置、电子设备及存储介质
US10754574B1 (en) * 2018-05-18 2020-08-25 Amazon Technologies, Inc. Attribute-driven storage for storage devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779528A (zh) * 2011-05-06 2012-11-14 日立环球储存科技荷兰有限公司 具有叠瓦写入和宽区域热辅助的磁记录盘驱动器
US20130342929A1 (en) * 2012-06-21 2013-12-26 HGST Netherlands B.V. Method of compensating for repeatable runout error
US20160232168A1 (en) * 2015-02-06 2016-08-11 HGST Netherlands B.V. Indirection data structures to manage file system metadata
CN107229664A (zh) * 2016-03-25 2017-10-03 Hgst荷兰公司 用于管理文件系统元数据的间接数据结构
CN110275677A (zh) * 2019-05-22 2019-09-24 华为技术有限公司 硬盘格式转换方法、装置及存储设备

Also Published As

Publication number Publication date
CN110275677A (zh) 2019-09-24
CN110275677B (zh) 2022-04-12
US20220013145A1 (en) 2022-01-13
US11682428B2 (en) 2023-06-20

Similar Documents

Publication Publication Date Title
WO2020233175A1 (zh) 硬盘格式转换方法、装置及存储设备
US10482919B2 (en) Write management of physically coupled storage areas
KR20190018656A (ko) 저장 디바이스 상의 저장 영역들을 관리하기 위한 방법, 컴퓨터-판독가능 저장 매체 및 저장 제어기 모듈
US20150363126A1 (en) Logical zone mapping
JP6476932B2 (ja) ストレージ装置,制御プログラム,ストレージシステム及びデータ転送方法
US20090198748A1 (en) Apparatus, system, and method for relocating storage pool hot spots
US10424328B1 (en) Reduced latency I/O in multi-actuator device
US9460751B2 (en) Binding shingled recording bands
KR20100011698A (ko) 데이터 머지를 수행하는 반도체 스토리지 시스템 및 그제어 방법
CN102215268A (zh) 一种迁移文件数据的方法和装置
JP2012515969A (ja) アロケートオンライトのスナップショットを用いた、ダイナミックストレージ階層化のための方法及びシステム
JP2006024024A (ja) 論理ディスク管理方法及び装置
CN107515827A (zh) Pcie ssd自定义日志的存储方法、装置及ssd
US20190333572A1 (en) Reduced latency i/o in multi-actuator device
JP2011013800A (ja) 記憶装置の制御部及び制御方法
CN111124303B (zh) 一种数据的存储方法、装置及系统
US9990134B2 (en) Command tunneling in a hybrid data storage device
CN117234436B (zh) 一种磁盘阵列的扩容方法、装置、存储系统及产品
US9588898B1 (en) Fullness control for media-based cache operating in a steady state
JP2004127275A (ja) データ記憶アレイを管理する方法およびraidコントローラを備えたコンピュータシステム
US7200771B2 (en) Relocation batch processing for disk drives
US10803893B1 (en) Data transfer scheduling for fairness and balance
CN118642654A (zh) 一种数据管理装置及数据管理方法、数据存储设备
US20180032256A1 (en) Storage device, storage system, and storage control method
US9116637B2 (en) Control device, storage device, and computer-readable recording medium having stored therein control program

Legal Events

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

Ref document number: 20808901

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20808901

Country of ref document: EP

Kind code of ref document: A1