WO2022067686A1 - Data reading method applied to solid state disk (ssd), and related apparatus - Google Patents

Data reading method applied to solid state disk (ssd), and related apparatus Download PDF

Info

Publication number
WO2022067686A1
WO2022067686A1 PCT/CN2020/119447 CN2020119447W WO2022067686A1 WO 2022067686 A1 WO2022067686 A1 WO 2022067686A1 CN 2020119447 W CN2020119447 W CN 2020119447W WO 2022067686 A1 WO2022067686 A1 WO 2022067686A1
Authority
WO
WIPO (PCT)
Prior art keywords
read
ssd
value
pressure value
read operations
Prior art date
Application number
PCT/CN2020/119447
Other languages
French (fr)
Chinese (zh)
Inventor
李君伟
贾学超
余夕亮
梅鸿翔
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2020/119447 priority Critical patent/WO2022067686A1/en
Priority to CN202080103398.5A priority patent/CN116235138A/en
Publication of WO2022067686A1 publication Critical patent/WO2022067686A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present application relates to the field of storage, and in particular, to a data reading method and a related device applied to a solid-state hard disk (SSD).
  • SSD solid-state hard disk
  • Solid State Disk is a widely used storage device, which is mainly composed of a controller and a storage unit.
  • the storage unit generally includes multiple flash memory particles such as NAND Flash, each flash memory particle includes one or more bare chips (die), each die includes multiple physical blocks (block), and the capacity of the block is generally hundreds of Between KB and several MB, each block includes multiple pages (pages), and the capacity of pages is generally a multiple of 4KB (such as 4KB or 16KB).
  • the SSD stores data evenly on each NAND Flash through the Flash Translation Layer (FTL).
  • FTL Flash Translation Layer
  • operations such as read, write, and erase can be performed on NAND Flash to read or store data, but read, write, and erase operations on the same NAND Flash cannot be performed at the same time.
  • Embodiments of the present application provide a data reading method and device applied to a solid-state drive (SSD), and the solid-state drive (SSD), so as to improve the performance of the solid-state drive.
  • SSD solid-state drive
  • SSD solid-state drive
  • an embodiment of the present application provides a data reading method applied to a solid-state drive (SSD), which may include: acquiring a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value , the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; based on the characteristic value , dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is the currently executed write operation or erase operation.
  • SSD solid-state drive
  • the characteristic value of the SSD is first obtained, and the characteristic value includes at least one of a read-write ratio value or a pressure value. Since the read-write ratio value is the number of read operations performed by the SSD and the write operation performed by the SSD The ratio of the number of operations, the pressure value is used to indicate the number of read operations waiting to be performed in the SSD. Therefore, through the eigenvalues, it is possible to determine the current efficiency and pressure of the SSD to perform read, write or erase operations. If the efficiency is low and the pressure is high, according to at least one of the read-write ratio value or the pressure value obtained, the number of inserting read operations allowed in a first operation can be dynamically adjusted to improve the performance of read, write and read operations of NAND Flash. Efficiency of erase operations, which in turn improves the performance of SSDs.
  • the dynamically adjusting the number of allowable insert read operations in a first operation process based on the characteristic value includes: determining, based on the characteristic value, the allowable insert read operation during the first operation process The first threshold value of the read operation; according to the first threshold value, dynamically adjust the number of read operations that are allowed to be inserted during a first operation.
  • the first threshold value may be the maximum number
  • the number of inserted read operations is counted. After the maximum number of read operations, it is forbidden to insert read operations again, so as to achieve the purpose of adjusting the number of read operations. In this way, the number of allowable insert read operations can be adjusted intuitively and conveniently, thereby improving the performance of the SSD.
  • the dynamically adjusting the number of read operations allowed to be performed in a first operation process based on the characteristic value includes: acquiring, based on the characteristic value, a pause operation corresponding to the characteristic value strategy, the suspend operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on The suspend operation strategy dynamically adjusts the number of allowable insert read operations in a first operation process.
  • the suspend operation is used to suspend the first operation during a first operation, and then insert a read operation into the first operation after the suspend operation is used.
  • the embodiments of the present application can dynamically adjust the maximum number of read operations allowed to insert after using the pause operation by adjusting the constraints of the pause operation, such as: adjusting the use frequency of the pause operation, adjusting the number of use of the pause operation, etc.
  • the obtaining the pause operation policy corresponding to the feature value based on the feature value includes: obtaining, based on the feature value, from a pre-stored mapping table The suspend operation strategy corresponding to the characteristic value, and the mapping relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy.
  • the manner of acquiring the suspending operation policy may be determined directly according to the characteristic value from a pre-stored mapping table. Determining the pause operation strategy from the pre-stored mapping table can quickly and conveniently save calculation steps, greatly shorten the time to obtain the pause operation strategy, and improve the efficiency of adjusting the number of inserted read operations allowed by the settings, thereby improving the the performance of the SSD.
  • the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
  • the embodiment of the present application directly restricts the second threshold used by the pause operation, and the second threshold may be the maximum number, that is, by restricting the number of times of interrupting the execution of a first operation, thereby restricting the allowable The maximum number of insert read operations, thereby improving the performance of the SSD. For example, by limiting the maximum number of insert read operations, read operations will not frequently interrupt the execution of write operations or erase operations, because performance (Input/Output Operations Per Second, IOPS) is the main factor at this time. The bottleneck is write IOPS, so reducing the threshold can reduce the interruption of write operations, and the IOPS performance of the SSD will be higher.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
  • This embodiment of the present application controls the number of read operations that are allowed to be sent during a first operation by configuring a third threshold for allowing insertion of read operations after the pause operation is sent once, where the third threshold may be the maximum number. That is, by controlling each suspend operation, the maximum number of inserted read operations is controlled, and then the total execution time of the read operation suspended once is controlled, thereby reducing the time that each suspend operation interrupts the first operation, thereby improving the performance of the SSD. .
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the larger the pressure value the more the number of degree operations waiting to be performed. At this time, it is necessary to reduce the maximum number of allowable insert read operations to prevent excessive read operations from interrupting the execution of write operations. If the pressure value is small, it means that the read latency of the read operation is more focused on the computing device. At this time, a larger threshold value of the maximum number of suspended operations allowed to be sent should be configured to allow the read operation to interrupt the write operation as much as possible. Or erase operation, let the read operation complete as soon as possible.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the one first operation process is allowed to insert read/write
  • the first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
  • the pressure value is greater than the first pressure value (for example, the pressure value is large enough)
  • the first pressure value for example, the pressure value is large enough
  • the pressure value is less than the first pressure value (the pressure value is small enough)
  • the first threshold of the operation allowing the read operation to interrupt the write operation or erase operation as much as possible, so that the read operation can be completed as soon as possible.
  • the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
  • the larger the read-write ratio value is the higher the proportion of read operations is performed. Therefore, at this time, the main bottleneck of the IOPS performance of the SSD is the write IOPS, and the maximum number of suspended operations allowed to be sent at this time. Set a smaller threshold, so that read operations will not frequently interrupt the execution of write operations. Therefore, reducing the threshold can reduce the interruption of write operations, and the IOPS performance will be higher.
  • the read operation will not disturb the write operation, and the focus is on the write operation at this time.
  • the performance of the SSD is more dependent on the execution of read operations. Therefore, a larger threshold is set for the maximum number of suspended operations that are allowed to be sent, so that read operations can frequently interrupt the execution of write operations, allowing The faster the read operation is performed, the higher the performance of the SSD.
  • a second threshold value that allows sending the pause operation during the one first operation process is inversely proportional to the pressure value.
  • a larger pressure value indicates that the computing device pays more attention to IOPS performance. Therefore, when the pressure value is larger, the maximum number of the suspend operations sent may be correspondingly reduced. If the pressure value is small, it means that the read delay of more focused read operations on the computing device should be configured. At this time, a larger maximum number of suspended operations allowed to be sent should be configured to allow read operations to interrupt write operations or erase operations as much as possible.
  • the division operation allows the read operation to complete as soon as possible.
  • the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
  • the pressure value if the pressure value is greater than the second pressure value, it means that the computing device pays more attention to the IOPS performance of the SSD. Therefore, when the pressure value is high, the ratio of read I/O to write I/O on the SSD is calculated.
  • Configuring a second threshold that allows sending of the suspended operation reduces interruption of the first operation by the read operation. If the pressure value is less than the second pressure value, it means that the computing device is more focused on the read delay of the read operation. At this time, a larger second threshold value that allows the suspension operation to be sent should be configured to allow as many read operations as possible. Interrupt the write or erase operation to allow the read operation to complete as soon as possible.
  • the SSD includes a controller, the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the SSD performs write operations The number of operations corresponds to the number of read operations generated by the controller; the characteristic value includes the read/write ratio value; the acquiring the characteristic value of the SSD includes: counting the number of first read operations performed by the SSD; a number, where the first read operation is a read operation generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller; The ratio of the first quantity and the second quantity is used as a read/write ratio value of the SSD.
  • the read/write ratio of the SSD is determined according to the number of read operations performed by the SSD and the number of write operations performed by the SSD, because it is not easy to directly count the number of write operations performed by the SSD. Therefore, the number of write operations performed by the SSD here may be indicated by the number of read operations (second read operations) generated by the controller in the SSD (read operations generated by the computing device are not counted). Also, the number of read operations performed by the SSD may be indicated by the number of read operations (first read operations) generated by the performing computing device (read operations generated by the SSD itself are not counted). Therefore, the read/write ratio value of the SSD may be determined by the ratio of the number of first read operations to the number of second read operations, which is more convenient to obtain.
  • each read operation has a flag bit, which can record whether the read operation is generated by the computing device or by the controller in the SSD. Therefore, the controller can easily and accurately identify and count the numbers of the first read operation and the second read operation respectively when performing the read operation.
  • the counting the first number of the first read operations performed by the SSD includes: counting the first number of the first read operations in the first cache queue performed by the SSD;
  • the counting the second number of the second read operations performed by the SSD includes: counting the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the second The number of the first read operations in the cache queue waiting to be performed by the SSD, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, And the second read operation does not exist in the second cache queue.
  • the acquiring the characteristic value of the SSD includes: periodically recording and storing the characteristic value of the SSD; acquiring the target characteristic value of the most recent period at the current time point; and dynamically adjusting the number of allowable insert read operations in a first operation process, including: dynamically adjusting the number of allowable insert read operations in a first operation process based on the target characteristic value.
  • periodically record the read/write ratio value and pressure value in the SSD and adjust the number of read operations that are allowed to be inserted according to the latest read/write ratio value and pressure value, so as to adjust the adaptability of the SSD in time and improve the SSD storage performance.
  • an embodiment of the present application provides a solid-state disk (SSD), including a controller and a storage array; the controller is coupled to the storage array, and is configured to: acquire a characteristic value of the SSD, where the characteristic value includes At least one of a read-write ratio value or a pressure value, the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates that the SSD is waiting for execution The number of read operations; based on the characteristic value, dynamically adjust the number of allowable insertion read operations during a first operation, where the first operation is the current write operation or erase performed by the controller on the storage array operate.
  • SSD solid-state disk
  • the controller is specifically configured to: determine, based on the characteristic value, a first threshold for allowing an insert read operation during the first operation; and dynamically adjust the The number of insert read operations allowed during a first operation.
  • the controller is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy, dynamically adjust the allowable read insertion during a first operation process the number of operations.
  • suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy, dynamically adjust the allowable read insertion during a first operation process the number of operations.
  • the controller is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
  • the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the one first operation process is allowed to insert read/write
  • the first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
  • the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
  • a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
  • the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
  • the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control
  • the characteristic value includes the read-write ratio value;
  • the controller is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is: read operations generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller; combine the first number and the second read operation
  • the ratio of the numbers is used as the read-write ratio of the SSD.
  • the controller is specifically configured to: count the first number of the first read operations in the first cache queue performed by the SSD; the controller is specifically configured to: count the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, The first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue.
  • the controller is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the latest period at the current time point; based on the target characteristic value, dynamically Adjusts the number of insert read operations allowed during a first operation.
  • an embodiment of the present application provides a computing device, where the computing device may include a processor; the computing device is connected to a solid-state hard disk (SSD); the processor is configured to: acquire a feature value of the SSD, and the feature The value includes at least one of a read-write ratio value or a pressure value, the read-write ratio value being the ratio of the number of read operations performed by the SSD to the number of write operations performed by the SSD, the pressure value indicating the number of The number of read operations waiting to be performed; based on the characteristic value, dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is a write operation or an erase operation currently performed in the SSD.
  • SSD solid-state hard disk
  • the processor is specifically configured to: determine, based on the characteristic value, a first threshold that allows insert read operations during the first operation; and dynamically adjust the The number of insert read operations allowed during a first operation.
  • the processor is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; send the suspend policy to the SSD, so that the SSD is based on
  • the suspend operation strategy dynamically adjusts the number of allowable insert read operations in a first operation process.
  • the processor is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
  • the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the one first operation process is allowed to insert read/write
  • the first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
  • the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
  • a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
  • the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
  • the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device
  • the number of write operations performed by the SSD corresponds to the number of read operations generated by the controller
  • the characteristic value includes the read-write ratio value
  • the controller is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is a read operation generated by the computing device ; Count the second quantity of the second read operation performed by the SSD, and the second read operation is a read operation generated by the controller; take the ratio of the first quantity and the second quantity as the value of the SSD Read and write scale values.
  • the processor is specifically configured to: count the first number of the first read operations in the first cache queue executed by the SSD; the processor is specifically configured to: count the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, The first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue.
  • the processor is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; based on the target characteristic value, dynamically Adjusts the number of insert read operations allowed during a first operation.
  • an embodiment of the present application provides a data reading device applied to a solid-state disk (SSD), which may include: an acquisition unit configured to acquire a characteristic value of the SSD, where the characteristic value includes a read-write ratio value or a pressure At least one of the values, the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; An adjustment unit, configured to dynamically adjust the number of allowable insertion read operations in a first operation process based on the characteristic value, where the first operation is a currently executed write operation or an erase operation.
  • SSD solid-state disk
  • the adjustment unit is specifically configured to: determine, based on the characteristic value, a first threshold that allows inserting a read operation during the first operation; dynamically adjust the The number of insert read operations allowed during a first operation.
  • the adjustment unit is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy, dynamically adjust the allowable read insertion during a first operation process the number of operations.
  • the adjustment unit is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
  • the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the one first operation process is allowed to insert read/write
  • the first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
  • the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
  • a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
  • the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
  • the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control
  • the characteristic value includes the read-write ratio value;
  • the acquisition unit is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is: read operations generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller; combine the first number and the second read operation
  • the ratio of the numbers is used as the read-write ratio of the SSD.
  • the acquiring unit is further specifically configured to: count the first number of the first read operations in the first cache queue performed by the SSD; the acquiring unit is further specifically configured to: : count the second number of the second read operations in the first cache queue executed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be executed by the SSD number, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue .
  • the acquisition unit is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; the adjustment unit is specifically configured to: Based on the target characteristic value, dynamically adjust the number of allowable insert read operations during a first operation.
  • an embodiment of the present application provides a controller, the controller includes a processing component, a storage component, and a communication interface, the processing component reads an instruction stored on the storage component through the communication interface, and executes the above The method described in the first aspect.
  • an embodiment of the present application provides a computer program, where the computer program includes instructions, when the computer program is executed by a computer, the computer can execute the process performed by the solid-state hard disk SSD in the second aspect.
  • an embodiment of the present application provides a computer storage medium for storing computer software instructions used for the solid-state hard disk SSD provided in the second aspect, including a program for executing the program involved in the first aspect.
  • FIG. 1 is a schematic diagram of an architecture of a data reading system applied to a solid-state disk (SSD) provided by an embodiment of the present application.
  • SSD solid-state disk
  • FIG. 2 is a schematic flowchart of a method for reading data through a pause operation provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a logic module of an SSD provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a logic module of a computing device provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a logic module of another computing device provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a data reading method applied to a solid-state disk SSD according to an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of an SSD obtaining a read/write ratio value according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a first read operation and a second read operation of an SSD according to an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of obtaining a suspension operation policy based on a pre-stored mapping relationship table provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a data reading device applied to a solid-state disk (SSD) provided by an embodiment of the present application.
  • SSD solid-state disk
  • a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
  • an application running on a computing device and the computing device may be components.
  • One or more components may reside within a process and/or thread of execution, and a component may be localized on one computer and/or distributed between 2 or more computers.
  • these components can execute from various computer readable media having various data structures stored thereon.
  • a component may, for example, be based on data with one or more data packets (eg, data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet interacting with other systems via signals). Signals are communicated through local and/or remote processes.
  • data packets eg, data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet interacting with other systems via signals.
  • Signals are communicated through local and/or remote processes.
  • SSD Solid State Drive
  • flash chip flash chip
  • DRAM dynamic random access memory
  • flash chip flash memory
  • DRAM dynamic random access memory
  • the solid-state hard disk involved in the embodiments of the present application is a flash-based solid-state hard disk, that is, an SSD using a Flash chip as a storage medium. Its appearance can be made into a variety of styles, such as: notebook hard disk, micro hard disk, memory card, U disk and other styles.
  • NAND Flash is a non-volatile storage technology.
  • the storage units of NAND Flash are divided into cell, die, block, page, cell, etc.
  • a cell is the smallest memory unit. Multiple cells form a page (page); multiple pages form a block (block); multiple blocks form a die.
  • NAND Flash can still save data after a power failure, it also has the following hardware features: After a memory cell is programmed, the data represented can be changed from logic 1 to logic 0, but it cannot be written to this cell anymore. To return to logic 1, it needs to be erased to return to logic 1.
  • the smallest unit of erasure in flash memory is called a block.
  • the operation time for erasing is generally greater than the operation time for reading and writing.
  • the flash memory particles of most SSDs are mainly divided into single-level storage cells (Single-Level Cell, SLC), double-layer storage cells (Multi-Level Cell, MLC), three-layer storage cells (Trinary-Level Cell, TLC) and Quadruple-Level Cell (QLC), and even multi-layer memory cells may appear; among them, TLC includes 3D-TLC and 2D-TLC; 3D-TLC can be subdivided into 32-layer 3D-TLC, 64-layer 3D-TLC and 96-layer 3D-TLC.
  • I/O interface can be the link for information exchange between the control object and the controlled object.
  • the computing device of the present application performs data exchange with the solid-state hard disk through an I/O interface.
  • I/O interface At present, most of the specific programs involved in the I/O interface are programmable, that is, their working methods can be controlled by the program.
  • the Host interface, or data bus may include SATA, SAS, and PCIe.
  • Serial ATA Serial Advanced Technology Attachment, Serial ATA
  • Serial ATA is a computer bus, responsible for data transmission between the motherboard and mass storage devices (such as hard disks and CD-ROM drives), mainly used for personal computers
  • Serial ATA and Both serial SCSI (Serial Attached SCSI, SAS) cables are compatible, and SATA hard drives can be connected to the SAS interface.
  • SAS Serial Attached SCSI
  • SAS Serial Attached SCSI
  • PCI Express bus is a high-speed serial replacement for the older PCI/PCI-X bus; PCI Express is based on a point-to-point topology, with a separate serial link connecting each device to the root system (host). Due to its shared bus topology, the PCI bus can be arbitrated in a single direction (in the case of multiple hosts) and is limited to one host at a time; in addition, the PCI Express bus link supports full-duplexing between any two endpoints There are no inherent limitations to concurrent access across multiple endpoints at the same time.
  • IOPS Input/Output Operations Per Second
  • HDD hard disk drives
  • SSD solid state drives
  • SAN storage area networks
  • FPGA Field Programmable Gate Array
  • FIG. 1 is a schematic diagram of the architecture of a data reading system applied to a solid-state drive (SSD) provided by an embodiment of the present application.
  • the architecture shown in FIG. 1 mainly takes the solid-state drive SSD as the main body, and is described from the perspective of data reading .
  • the data reading method of the solid-state hard disk proposed in this application can be applied to the system architecture.
  • the system architecture includes a computing device 10 (Host, in the figure, the processor 101 is used as an example for illustration, which is equivalent to a host) and a solid-state disk (SSD) 20; wherein, in FIG.
  • the controller 201 and the memory 202 are integrated in the solid-state
  • the interior of the hard disk 20 is described as an example.
  • the solid-state hard disk 20 may include a controller 201 and a memory 202; optionally, the controller 201 may be a processing device independent of the solid-state hard disk 20. operations such as data writing, data reading, and data erasing; and the memory 202 can also be an independent storage device, which will not be repeated here.
  • the memory 202 may also include multiple Flash storage areas, such as Flash 0, Flash 1, . . . , Flash N, etc., where N is an integer greater than 0.
  • the memory is equivalent to the storage array in the embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for reading data through a pause operation provided by an embodiment of the present application.
  • the controller of the SSD processes the read operation, if it is determined that the first operation is being performed on the NAND Flash to be accessed by the read operation, the first operation is In the write operation or erase operation performed by the controller 201 on the storage array, the controller waits for the current read operation, first issues a Suspend operation to the NAND Flash, suspends the first operation being performed, and then executes the first operation on the NAND Flash.
  • a read operation is performed on the Flash (issue sequence 1 in Figure 2).
  • the controller directly sends the read operation to the NAND Flash for execution (distribution sequence 2 in Figure 2). If there is no read operation for a period of time, the controller will issue a resume (Resume) operation to the NAND Flash to resume the execution of the first suspended operation (as shown in the order of delivery 3 in Figure 2).
  • the processor 101 when it processes a data command, it can send a data read command to the solid state drive 20, and the read command instructs the solid state drive 20 to read the data in the storage area of the solid state drive 20 according to preset rules. It is also possible to send a data write command to the solid state drive 20, and the write command instructs the solid state drive 20 to write the data into a storage area in the solid state drive 20 according to a preset rule.
  • a data erasing command may also be sent to the solid-state hard disk 20, and the erasing command instructs the solid-state hard disk 20 to erase the data originally stored in the storage area of the solid-state hard disk 20 according to preset rules, so as to write new data.
  • the processor 101 may also acquire data information in the solid-state hard disk 20, so that the solid-state hard disk adjusts the maximum number of allowable insertion and read operations during a first operation.
  • the controller 201 in the solid state disk 20 can obtain the characteristic value of the SSD, the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is the number of read operations performed by the SSD and the total number of read operations performed by the SSD.
  • the ratio of the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; based on the characteristic value, dynamically adjust the number of allowable insertion read operations in a first operation process, the The first operation is a write or erase operation currently being performed in the storage array (equivalent to memory 202).
  • the solid state hard disk may be configured in different devices, and correspond to different main control forms in different devices.
  • the embodiment of the present application does not limit the main control form, such as a server or a computer.
  • the solid-state hard disk 20 When the aforementioned solid-state hard disk is configured in a computer (that is, the computing device 10 is a computer), the solid-state hard disk 20 performs data interaction with the central processing unit CPU of the computer through a data bus. Specific data is written to the SSD.
  • the server When the aforementioned solid-state hard disk is configured in a server (that is, the computing device 10 is a server, the server is the main server of the entire server network, and handles all transactions in the server network), the server is connected through Wi-Fi, mobile network, etc. or wired connection. Communicate and process the data. For example, the server sends a read command to the SSD 20 through the data bus. After the SSD receives the read command, the controller waits for the current read operation, and first issues a pause operation to the NAND Flash. , suspend the first operation being performed, and then perform a read operation on the NAND Flash to read data from the storage area.
  • Other structures and functions are similar to the aforementioned electronic devices, and the specific data reading scenarios after the solid-state hard disk is configured are also applicable to the application scenarios illustrated in the embodiments of the present application, which will not be repeated here.
  • the suspend operation involved in the embodiments of the present application is equivalent to the Suspend operation, which is used to insert a certain number of read operations after suspending the write operation during a write operation; or, during an erase operation , after suspending the erase operation, insert a certain number of read operations.
  • the suspend operation is sent to the NAND Flash.
  • the NAND Flash After the NAND Flash receives the suspend operation, it will suspend the ongoing write or erase operation (ie, the first operation), and then execute the read operation.
  • the computing device can issue the resume operation to the NAND Flash, and the suspended write or erase operation will be resumed.
  • the restore operation is equivalent to the Resume operation.
  • the embodiments of the present application also provide several related device diagrams of data reading in the SSD involving the interaction between the Host and the SSD, which can be applied to the system architecture shown in FIG. 1 .
  • FIG. 3 is a schematic diagram of a logic module of an SSD provided by an embodiment of the present application; as shown in FIG. 3, the built-in logic module of the SSD in the embodiment of the present application may include: an SSD controller 201, which is also the aforementioned FIG. 1 The controller 201 in the SSD of the system architecture shown; and the storage module 202, which can include a flash memory NAND Flash array, which is also the memory 202 in the aforementioned system architecture shown in FIG. 1; and an interface module 203 for communicating with external devices communication.
  • the controller 201 includes a sensing module 2011 and a feedback control module 2012 .
  • the sensing module 2011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value.
  • the controller module 201 is the control unit (ie, the controller) of the SSD; it can be understood that the controller (or the controller unit) is the brain of the SSD device, and is responsible for the processing and data processing of the SSD read and write commands. Distribution management and NAND Flash management and other functions.
  • the controller in this embodiment of the present application includes a perception module 2011 and a feedback control module 2012 , and may also include an interface module 203 .
  • the sensing module 2011 can be used to obtain characteristic values, and the characteristic values include at least one of a read-write ratio value or a pressure value.
  • the sensing module 2011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value.
  • the module for obtaining the read-write ratio value is used for obtaining the read-write ratio value of the SSD; the module for obtaining the pressure value is used for obtaining the pressure value of the SSD.
  • the module for obtaining the read-write ratio value may obtain the read-write ratio value based on the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD.
  • the obtaining pressure value module may obtain the pressure value based on the number of read operations waiting to be performed in the SSD. For example, the number of read operations waiting in the SSD is 10, and the pressure value can be 10, or the pressure value corresponding to 10 read operations based on a preset mapping relationship.
  • the feedback control module 2012 can dynamically adjust the number of allowable insertion read operations in a first operation process based on the characteristic value obtained by the sensing module 2011 , such as at least one of a read-write ratio value or a pressure value.
  • an interface (Interface) module 203 which is used to connect to the Host 10 and undertake the functions of read and write command reception and data transmission.
  • the obtaining pressure value module obtains the pressure value within a certain period.
  • the module obtains the read-write ratio value within a certain period.
  • the feedback control module reads the above pressure value and read/write ratio value.
  • the feedback control module obtains a suspend operation strategy through the obtained pressure value and read/write ratio value index, and adjusts the number of allowable insertion read operations in a first operation process based on the suspend operation strategy. Alternatively, the feedback control module directly adjusts the number of allowable insertion read operations in a first operation process through the obtained pressure value and read/write ratio value.
  • FIG. 4 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
  • the sensing module 2011 includes a module for obtaining read/write ratio value, but does not include a module for obtaining pressure value. Therefore, compared with the execution flow shown in FIG. 3 above, the SSD can obtain the read-write ratio value, and the feedback control module can adjust the read-write ratio value obtained by the sensing module 2011 to allow insertion of read operations in a first operation process. quantity.
  • FIG. 5 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
  • the sensing module 2011 does not include a module for obtaining read/write ratio value, but includes a module for obtaining pressure value. Therefore, compared with the execution flow shown in FIG. 3 above, the SSD can obtain the pressure value, and the feedback control module adjusts the number of allowable insert read operations in a first operation process based on the pressure value obtained by the sensing module 2011 .
  • the sensing module and the feedback control module in the SSD and each module therein may be implemented by hardware (eg, FPGA, hardware acceleration unit, etc.), or may be implemented by software.
  • the embodiments of the present application also provide schematic diagrams of several other computer devices involving the interaction between the Host and the SSD, which can be applied to the system architecture shown in FIG. 1 , please refer to FIG. 6 , which is an implementation of the present application
  • the example provides a schematic diagram of a logic module of a computing device.
  • the built-in logic module of the computing device in this embodiment of the present application may include: a processor 101 , which is also the processor 101 in the computing device with the system architecture shown in the foregoing FIG. 1 .
  • the processor 101 includes: a perception module 1011 and a feedback control module 1012 .
  • the sensing module 1011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value.
  • a solid-state hard disk SSD Connected to the computing device is a solid-state hard disk SSD, and the SSD includes: a controller 201, which is also the controller 201 in the SSD and SSD of the system architecture shown in FIG. 1; and a storage module 202, which is also the memory 202 in the system architecture shown in FIG. 1. ; may also include an interface (Interface) module 203, which may be used to communicate with the computing device.
  • an interface (Interface) module 203 which may be used to communicate with the computing device.
  • the processor 101 in this embodiment of the present application involves a sensing module 1011, and the sensing module 1011 may further include a module for obtaining a read-write ratio value and a module for obtaining a pressure value.
  • the sensing module 1011 may be used to obtain characteristic values, where the characteristic values include at least one of a read-write ratio value or a pressure value.
  • the module for obtaining the read-write ratio value in the sensing module 1011 is used to obtain the read-write ratio value of the SSD; the module for obtaining the pressure value in the sensing module 1011 is used to obtain the pressure value of the SSD.
  • the module for obtaining the read-write ratio value may obtain the read-write ratio value based on the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD.
  • the obtaining pressure value module may obtain the pressure value based on the number of read operations waiting to be performed in the SSD. For example, the number of read operations waiting in the SSD is 10, and the pressure value can be 10, or the pressure value corresponding to 10 read operations based on a preset mapping relationship.
  • the feedback control module 1012 can obtain the pause operation policy based on the data acquired by the sensing module 1011, and send the pause operation policy to the SSD, so that the SSD adjusts the allowable insertion read operation in a first operation process based on the pause operation policy. maximum quantity.
  • the feedback control module 1012 can also obtain a suspension operation strategy based on the characteristic value obtained by the sensing module 1011; generate a target instruction according to the suspension operation strategy and send it to the SSD, so that the SSD adjusts a first operation based on the target instruction.
  • the number of insert read operations allowed in the process can also obtain a suspension operation strategy based on the characteristic value obtained by the sensing module 1011; generate a target instruction according to the suspension operation strategy and send it to the SSD, so that the SSD adjusts a first operation based on the target instruction. The number of insert read operations allowed in the process.
  • the obtaining pressure value module obtains the pressure value within a certain period.
  • the module calculates the read-write ratio value within a certain period.
  • the feedback control module reads the pressure value and the read-write proportional value.
  • the feedback control module obtains the suspend operation strategy through the obtained pressure value and the read/write ratio value index, and sends the suspend operation strategy to the SSD, so that the SSD adjusts a first operation process based on the suspend operation strategy to allow insertion of read operations quantity.
  • the sensing module 1011 includes a module for obtaining read/write ratio values, but does not include a module for obtaining pressure values. Therefore, compared with the execution flow of the computing device shown in FIG. 6, the computing device can obtain the read-write ratio value, and the feedback control module can obtain the pause operation strategy based on the read-write ratio value obtained by the sensing module 1011, and use the The suspend operation policy is sent to the SSD, so that the SSD can adjust the number of allowable insert read operations in a first operation process based on the suspend operation policy.
  • the sensing module 1011 does not include a module for obtaining read/write ratio value, but includes a module for obtaining pressure value. Therefore, compared with the above-mentioned execution flow of the computing device shown in FIG. 6 , the computing device can obtain the pressure value. Moreover, the feedback control module can obtain the pause operation strategy based on the pressure value obtained by the sensing module 1011, and send the pause operation strategy to the SSD, so that the SSD can adjust the allowable insertion read during a first operation based on the pause operation strategy. the number of operations.
  • FIG. 7 is a schematic diagram of a logic module of another computing device provided by an embodiment of the present application.
  • the processor 201 of the computing device shown in FIG. 7 includes a perception module 1011 and does not include a feedback control module.
  • the sensing module 1011 includes a module for obtaining read-write ratio value and a module for obtaining pressure value.
  • the controller 201 of the SSD connected to the computing device includes a feedback control module 2012 . Therefore, compared with the execution flow of the computing device shown in FIG. 6 above, the computing device can execute:
  • the obtaining pressure value module obtains the pressure value within a certain period.
  • the module calculates the read-write ratio value within a certain period.
  • the controller of the SSD receives the pressure value and the read/write ratio value; and then the feedback control module in the SSD passes the obtained pressure value and read/write ratio value.
  • the write ratio value acquires the pause operation policy, and adjusts the maximum number of insert read operations allowed in a first operation process based on the pause operation policy.
  • the sensing module 1011 includes a module for obtaining read/write ratio values, but does not include a module for obtaining pressure values. Therefore, compared with the execution flow of the computing device shown in FIG. 7 above, the computing device obtains the read-write ratio value, and sends the obtained read-write ratio value to the SSD.
  • the controller of the SSD receives the read-write ratio value; and then the feedback control module of the SSD obtains the pause operation strategy through the obtained read-write ratio value, and adjusts the maximum number of inserted read operations allowed in a first operation process based on the pause operation strategy .
  • the sensing module 1011 does not include a module for obtaining a read-write ratio value, but includes a module for obtaining a pressure value. Therefore, compared with the above-mentioned execution flow of the computing device shown in FIG. 7 , the computing device acquires the pressure value, and sends the acquired pressure value to the SSD.
  • the controller of the SSD receives the pressure value; further, the feedback control module of the SSD can obtain a suspend operation strategy based on the obtained pressure value, and adjust the maximum number of allowable insert read operations in a first operation process based on the suspend operation strategy.
  • the sensing module and the feedback control module in the computing device and each module therein may be implemented by hardware (eg, FPGA, hardware acceleration unit, etc.), or may be implemented by software.
  • FIG. 8 is a schematic flowchart of a data reading method applied to a solid-state hard disk SSD provided by an embodiment of the present application, and the method can be applied to the data reading applied to the solid-state hard disk SSD described in FIG. 1 .
  • the solid-state hard disk SSD20 can be used to support and execute the data reading method shown in FIG. The following description will be made from the controller side of the solid-state hard disk with reference to FIG. 8 , and the solid-state hard disk is connected to the computing device.
  • the method may include the following steps S301-S305.
  • Step S301 Count the number of read operations performed by the SSD.
  • the SSD can obtain the number of read operations performed by the SSD, so as to obtain the read-write ratio value of the SSD.
  • the acquisition method may be direct statistics by the controller in the SSD, or acquired after statistics by other counting devices or modules connected to the SSD.
  • the read operation is to read out the data stored in the memory, and the time for the SSD to perform a read operation is shorter than the time for performing a write operation, and also shorter than the time for performing an erase operation.
  • an SSD performs a read operation it can record the number of read operations performed so far.
  • the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device. That is, the read-write ratio value obtained by the SSD is the ratio between the number of read operations generated by the executing computing device and the number of write operations generated by the computing device. Therefore, the SSD may count the first number of first read operations performed by the SSD, where the first read operation is a read operation generated by the computing device. Since each read operation performed by the SSD has a flag bit, the flag bit can be used to identify whether the read operation is generated by the computing device or by the controller in the SSD. Therefore, the SSD can identify the first read operation according to the identifier on the read operation, and then the SSD can count the first number of the first read operation performed.
  • the SSD may count the first number of the first read operations in the first cache queue performed by the SSD.
  • the first cache queue is a message queue that stores the first read operation and the second read operation in the SSD.
  • Step S302 Count the number of write operations performed by the SSD.
  • the SSD needs to obtain the number of write operations performed by the SSD before obtaining the read-write ratio value.
  • the way of obtaining the data can also be directly counted by the controller in the SSD, or obtained after counting by other counting devices or modules connected to the SSD.
  • the time for the SSD to perform a write operation is generally much longer than the time for the SSD to perform a read operation.
  • the number of write operations performed by the SSD corresponds to the number of read operations generated by the controller. That is, when the SSD obtains the number of write operations performed by the SSD, it may count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller.
  • the SSD updates the data in the written position, it will write the data to the new position, and mark the data in the original written position as garbage (invalid data).
  • garbage invalid data
  • the storage space of the SSD is written to a certain proportion, it will trigger the background garbage collection to release the storage space (after the valid data is read and moved to the new storage location, the data in the original location is erased). Therefore, when writing new data A corresponding amount of storage space must be freed. Therefore, the number of write operations generated by the executing computing device may correspond to the number of read operations generated by the executing controller itself. Therefore, in this embodiment of the present application, the read operations generated by the controller may be used to refer to the count of the executed write operations. .
  • the number of write operations performed by the SSD may be the number of read operations generated by the execution controller.
  • the number of read operations generated by the execution controller is directly used as the number of write operations.
  • the number of write operations performed by the SSD is linear in the number of read operations generated by the execution controller. For example: 10 times the number of read operations generated by the execution controller is taken as the number of executed write operations. This application does not specifically limit this.
  • the controller counts the second number of the second read operations in the first cache queue performed by the SSD.
  • the second read operation is a read operation generated by the controller.
  • the first buffer queue includes a first read operation and a second read operation.
  • Step S303 Obtain the read/write ratio value.
  • the SSD obtains a characteristic value
  • the characteristic value includes a read-write ratio value
  • the read-write ratio value is a ratio of the number of read operations performed by the SSD to the number of write operations performed by the SSD.
  • the read-write ratio value is a value corresponding to the ratio between the number of read operations performed by the SSD and the number of write operations performed by the SSD.
  • the read/write ratio value may also be 1/10.
  • FIG. 9 is a schematic flowchart of an SSD obtaining a read-write ratio value provided by an embodiment of the present application.
  • the controller in the SSD can periodically record and store the read/write ratio with the SSD. First, in the first preset period, the read-write ratio value is calculated.
  • the controller processes the read operation in the first buffer queue, and the read operation in the first buffer queue includes the first read operation and the second read operation. By judging the values of these two counters, the proportional relationship between read I/O and write I/O can be calculated.
  • the controller may include a counter A and a counter B, and the counter A records the number of read operations (first read operations) generated from the computing device.
  • the counter B records the number of read operations (second read operations) not generated by the computing device but by the controller itself. It should be noted that the counter A and the counter B are counted every time a read operation is performed according to a corresponding policy, and the read operations waiting in the first cache queue are not counted. Therefore, the first number and the second number are respectively the first read operation and the second read operation that the controller is performing or has performed.
  • the SSD may periodically record and store the read/write ratio value with the SSD, and obtain the target read/write ratio value of the most recent period at the current time point. For example, if the read/write ratio value is recorded every 10 minutes, in the fifth cycle, when the SSD needs to obtain the read/write ratio value, the read/write ratio value calculated in the fourth cycle is the read/write ratio value to be obtained by the SSD scale value.
  • Step S304 Acquire a pressure value.
  • the SSD obtains characteristic values, and the characteristic values include pressure values.
  • the pressure value indicates the number of read operations waiting to be performed in the SSD.
  • the pressure value can be directly equal to the number of read operations waiting to be performed. For example: when the number of read operations waiting to be performed in the SSD is 10, the pressure value can be 10.
  • the number of read operations waiting to be executed in the SSD may also be divided into multiple levels, and each level in the multiple levels corresponds to a different pressure value.
  • the SSD obtains the number of the first read operations waiting for the SSD to perform in the second cache queue.
  • the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue. It can be understood that the first read operation waiting to be executed in the SSD will be entered into the first cache queue from the second cache queue for execution.
  • the number of the first read operations waiting for the SSD to be executed by the SSD in the second cache queue is the acquisition pressure value.
  • the SSD can periodically record and store the pressure value, and obtain the target pressure value of the most recent period at the current time point. For example, if the pressure value is recorded every 15 minutes, in the fifth cycle, when the SSD needs to obtain the pressure value, the calculated pressure value in the fourth cycle is the pressure value to be obtained by the SSD.
  • the SSD can also periodically record and store the pressure value, and the SSD obtains the target pressure value after a preset rule operation. Therefore, based on the target pressure value, the SSD dynamically adjusts the number of allowable insert read operations during a first operation. It should be noted that there is no direct connection between the period of statistical read-write ratio value and the period of statistical pressure value.
  • the target pressure value is the target pressure value among the pressure values corresponding to the first M cycles including the current cycle, and the pressure value with the largest pressure value is the target pressure value.
  • FIG. 10 is a schematic diagram of a first read operation and a second read operation of an SSD according to an embodiment of the present application.
  • the service sensing device reads the number of first read operations queued in the second buffer queue Y_i (i is the count value of the counter C, starts from 0, and is expressed as the i-th cycle) every timing period T2 ), Y_i represents the number of first read operations waiting to be executed in the second cache queue of the i-th cycle.
  • the maximum value Y_max of a total of M (M is greater than 1) values from Y_(i-m+1) to Y_i can be used as the target pressure value (M is the default value), if i is less than M , the maximum value of the i business pressure values is used as the target pressure value.
  • Step S305 Based on the characteristic value, dynamically adjust the number of allowable insert read operations in a first operation process.
  • the SSD may dynamically adjust the number of allowable insert read operations in a first operation process based on the characteristic value.
  • the characteristic value includes at least one of a read-write ratio value or a pressure value
  • the first operation is a currently executed write operation or erase operation.
  • the characteristic value can be used to indicate the efficiency of performing the read operation in the SSD (eg, the read/write ratio value), or the size of the pressure (eg, the pressure value) waiting for the read operation to be performed. Therefore, the SSD can dynamically adjust the number of inserted read operations during a currently executed write operation or erase operation according to the read-write ratio value, or the pressure value, or the read-write ratio value and the pressure value.
  • the read-write ratio value when the read-write ratio value is too large, it means that the efficiency of executing the read operation is high, and the first operation currently being executed will be frequently interrupted. Therefore, on the basis of the current number of allowable insert read operations, the number of allowable insert read operations during a write operation or erase operation can be reduced to prevent read operations from frequently interrupting the execution of write operations or erase operations, so as to improve system performance. performance.
  • the dynamically adjusting the number of insert read operations allowed in a first operation process based on the characteristic value includes: determining, based on the characteristic value, a first insert read operation allowed in the first operation process. Threshold; according to the first threshold, dynamically adjust the number of allowable insert read operations during a first operation.
  • the first threshold is the maximum number of insert read operations allowed during the first operation, that is, it means that the number of insert read operations during the first operation can be less than the first threshold but not greater than the first threshold, and then can be adjusted in the The number of insert read operations allowed during a first operation.
  • the SSD Because in the process of executing a first operation, every time the SSD interrupts the first operation and performs a read operation, it can record the number once to record the number of read operations inserted so far. Therefore, when implementing this embodiment of the present application, after directly configuring a first threshold for allowing insertion of read operations during the first operation, the number of inserted read operations is counted, and after the maximum number of allowable insertions is reached, re-insertion of read operations is prohibited. , in order to achieve the purpose of adjusting the number of read operations. In this way, the number of allowable insert read operations can be adjusted intuitively and conveniently, thereby improving the performance of the SSD.
  • the dynamically adjusting the number of read operations allowed to be performed in a first operation process based on the characteristic value includes: acquiring, based on the characteristic value, a suspension operation policy corresponding to the characteristic value, and the suspension
  • the operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy , which dynamically adjusts the number of insert read operations allowed during a first operation.
  • the suspend operation is used to suspend the first operation during a first operation, and then insert a read operation into the first operation after the suspend operation is used.
  • the embodiments of the present application can dynamically adjust the number of read operations allowed to be inserted after using the pause operation by adjusting the constraints of the pause operation, such as: adjusting the frequency of use of the pause operation, adjusting the number of use of the pause operation, etc.
  • the obtaining the pause operation policy corresponding to the feature value based on the feature value includes: obtaining, based on the feature value, from a pre-stored mapping table The suspend operation strategy corresponding to the characteristic value, and the mapping relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy.
  • the manner of acquiring the suspending operation policy may be determined directly according to the characteristic value from a pre-stored mapping table. Determining the pause operation strategy from the pre-stored mapping table can quickly and conveniently save calculation steps, greatly shorten the time to obtain the pause operation strategy, and improve the efficiency of adjusting the number of inserted read operations allowed by the settings, thereby improving the the performance of the SSD.
  • Table 1 is a mapping relationship table provided by an embodiment of the present application, which is used to obtain a pause operation policy corresponding to the characteristic value based on the characteristic value.
  • the characteristic value includes a read-write ratio value and a pressure value.
  • the pressure value interval indicates that the pressure value is divided into P intervals according to a certain strategy, and each interval has its corresponding pause operation strategy.
  • the read/write ratio value interval indicates that the read/write ratio value is divided into Q intervals according to a certain strategy, and each interval has its corresponding pause operation strategy.
  • the pause operation strategies are respectively expressed as: the maximum number of pause operations that the controller can issue during a write operation, R1, and the number of read operations that the controller can issue after each pause operation during a write operation.
  • R2 the total number of read operations that the controller can issue during a write operation, R3, the maximum number of suspend operations that the controller can issue during an erase operation, R4, and each time the controller passes a suspend operation during an erase operation.
  • FIG. 11 is a schematic flowchart of obtaining a pause operation policy based on a pre-stored mapping relationship table according to an embodiment of the present application.
  • the SSD in a preset period, can obtain the read/write ratio value, and determine the interval in which it is located according to the read/write ratio value; the SSD can also obtain the pressure value, and determine the interval in which it is located according to the pressure value. Further, according to the interval where the read/write ratio value is located and/or the interval where the pressure value is located, the pause operation strategy corresponding to the current cycle is determined.
  • the controller can issue a maximum number of suspend operations during a write operation.
  • the number of read operations that can be issued after a write operation is suspended by one pause operation is 5, the total number of read operations that the controller can issue during a write operation is 30, and the controller can issue a pause operation during an erase operation.
  • the maximum number of read operations is 8.
  • the number of read operations that can be issued by the controller after suspending the erase operation through a pause operation during an erase operation is 3.
  • the total number of read operations that can be issued by the controller during an erase operation. The number is 20.
  • the corresponding pause operation strategy in the table includes one or more of R1, R2, R3, R4, R5, and R6, it means that the table 1 does not impose too many restrictions on the other strategies that are not included. Alternatively, it is a preset default value, which is not specifically limited in the comparison of the embodiments of the present application.
  • the product of R1 and R2 in Table 1 is not less than R3, and the product of R4 and R5 is not less than R6.
  • the pressure value obtained by the SSD is in the pressure value range 1
  • the read-write ratio value obtained by the SSD is in the read-write ratio value range Q
  • the product of R1 and R2 is less than R3 or the product of R4 and R5 is less than R6, it is meaningless to limit R3 or R6 at this time.
  • the division methods and division quantities of the pressure value interval and the read/write ratio value interval may be different.
  • the pre-stored mapping table may include the target obtained by performing correlation operations on the eigenvalues. value, and the pause operation strategy corresponding to the target value.
  • the pre-stored mapping table also includes the read/write ratio value, or the pressure value, or the pause operation strategy corresponding to the read/write ratio value and the pressure value, which is not specifically limited in this application.
  • the suspension operation policy is a second threshold for allowing the suspension operation to be sent during the first operation.
  • the second threshold is the maximum number of the suspend operations allowed to be sent during a first operation
  • the suspend operation is used to insert a read operation in the first operation after suspending the first operation.
  • the embodiment of the present application directly limits the maximum number of suspend operations used, that is, by limiting the number of times that a first operation is interrupted, thereby limiting the maximum number of allowable insert read operations, thereby improving the SSD performance. performance.
  • the ongoing write operation or erase operation will not be suspended frequently to perform read operations, because performance (Input/Output Operations Per Second, IOPS))
  • the main bottleneck is write IOPS, so reducing the threshold can reduce the interruption of write operations, and the IOPS performance of SSD will be higher.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation in a first operation process.
  • the third threshold is the maximum number of read operations allowed to be inserted after each transmission of the pause operation in a first operation process, that is, the upper limit of the number of read operations allowed to be inserted after each transmission of the pause operation.
  • the maximum number of read operations allowed to be inserted after the pause operation is sent once, the maximum number of the pause operations allowed to be sent during a first operation is controlled. That is, by controlling each suspend operation, the maximum number of inserted read operations is controlled, and then the total execution time of the read operation suspended once is controlled, thereby reducing the time that each suspend operation interrupts the first operation, thereby improving the performance of the SSD.
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • the suspend operation strategy involved in Table 1 above can be referred to accordingly.
  • the first threshold for allowing insert read operations is set to a smaller threshold. , then there will not be too many read operations frequently interrupting the execution of write operations. Therefore, reducing the first threshold of the insert read operation can reduce the interruption of the write operation, thereby improving the performance of the SSD.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the suspend operation strategy involved in Table 1 above can be referred to accordingly.
  • the higher the pressure value the higher the number of read operations waiting to be performed.
  • the pressure value is small, it means that the read delay of the read operation is more focused on the computing device.
  • a larger threshold value that allows the first threshold of the suspended operation to be sent should be configured to allow the read operation to interrupt the write as much as possible. operation or erase operation, let the read operation complete as soon as possible.
  • the characteristic value includes the read-write ratio value and the pressure value
  • the first threshold value that allows insertion of a read operation during the one first operation process Inversely proportional to the read/write ratio value, if the pressure value is smaller than the first pressure value, the first threshold value that allows insert read operations in the one first operation process is inversely proportional to the pressure value.
  • the pressure value is greater than the first pressure value (for example, the pressure value is large enough)
  • the first pressure value for example, the pressure value is large enough
  • the pressure value is less than the first pressure value (the pressure value is small enough)
  • the first threshold of the operation allowing the read operation to interrupt the first operation as much as possible, so that the read operation can be executed as soon as possible.
  • a second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value.
  • the suspend operation strategy involved in Table 1 above can be referred to accordingly.
  • the larger the read-write ratio the higher the proportion of read operations. Therefore, at this time, the main bottleneck of SSD IOPS performance is write IOPS.
  • the second threshold that allows sending pause operations is set to a smaller threshold. , then the read operation will not frequently interrupt the execution of the first operation. Therefore, reducing the threshold can reduce the interruption of write operations, and the IOPS performance will be higher.
  • the second threshold of the allow-transmission suspension operation when the second threshold of the allow-transmission suspension operation is set to 0, the read operation will not disturb the first operation. At this time, the focus is on the write operation. On the contrary, the ratio of the read operation to the write operation is smaller, indicating that The higher the proportion of write operations, the performance of the SSD is more dependent on the execution of read operations. Therefore, a larger threshold is set for the second threshold that allows sending pause operations, so that read operations can frequently interrupt the execution of the first operation. , the read operation can be performed faster, and the performance of the SSD will be higher.
  • a second threshold value that allows sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
  • the suspend operation strategy involved in Table 1 above can be referred to accordingly.
  • a larger pressure value indicates that the computing device pays more attention to IOPS performance. Therefore, when the pressure value is larger, the second threshold for sending the suspend operation can be correspondingly reduced. If the pressure value is small, it means that the read delay of the read operation is more focused on the computing device.
  • a larger second threshold value that allows the suspension operation to be sent should be configured to allow the read operation to interrupt the first operation as much as possible. , so that the read operation is executed as soon as possible.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the first operation process of the first operation is allowed to send the second information of the pause operation.
  • the second threshold value is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value that allows sending the pause operation during the first operation is inversely proportional to the pressure value .
  • the pressure value is greater than the second pressure value, it means that the computing device pays more attention to the IOPS performance of the SSD. Therefore, when the pressure value is high, the ratio of read I/O to write I/O on the SSD is calculated.
  • a second threshold at which the pause operation is allowed to be sent If the pressure value is less than the second pressure value, it means that the computing device is more focused on the read delay of the read operation. At this time, a larger second threshold value that allows the suspension operation to be sent should be configured to allow as many read operations as possible. Interrupt the first operation and let the read operation complete as soon as possible.
  • the first pressure value and the second pressure value may be the same or different; the first pressure value may be greater than or smaller than the second pressure value.
  • the above two pressure values can be specifically set by the user according to the actual performance of the SSD, which is not specifically limited in this embodiment of the present application.
  • a characteristic value of the SSD may be obtained first, where the characteristic value includes at least one of a read-write ratio value or a pressure value. Since the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, the pressure value is used to indicate the number of read operations waiting to be performed in the SSD. Therefore, through the acquired characteristic values, the current efficiency and pressure of the SSD to perform read, write or erase operations can be determined. If the efficiency is low and the pressure is high, according to at least one of the read-write ratio value or the pressure value obtained, the number of inserting read operations allowed in a first operation can be dynamically adjusted to improve the performance of read, write and read operations of NAND Flash. Efficiency of erase operations, which in turn improves the performance of SSDs.
  • FIG. 12 is a schematic structural diagram of a data reading device applied to a solid-state drive (SSD) provided by an embodiment of the present application.
  • the data reading device 10 may include an acquisition unit 401 and an adjustment unit 402 , wherein each unit is The detailed description is as follows.
  • the obtaining unit 401 is configured to obtain a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is the number of read operations performed by the SSD and the SSD. A ratio of the number of write operations performed, the pressure value indicating the number of read operations waiting to be performed in the SSD;
  • the adjustment unit 402 is configured to dynamically adjust the number of allowable insert read operations in a first operation process based on the characteristic value, where the first operation is a currently executed write operation or an erase operation.
  • the adjusting unit 402 is specifically configured to: determine, based on the characteristic value, a first threshold that allows an insert read operation during the first operation; and dynamically adjust according to the first threshold The number of insert read operations allowed during a first operation.
  • the adjustment unit 402 is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send in a first operation process Constraints of a Suspend operation, which is used to insert a read operation in the first operation after suspending the first operation; dynamically adjust the allowable insertion during a first operation based on the suspension operation strategy The number of read operations.
  • the adjusting unit 402 is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relationship table, and the mapping The relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy.
  • the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
  • the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
  • a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
  • a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  • the characteristic value includes the read/write ratio value and the pressure value
  • the one first operation process is allowed to insert read/write
  • the first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
  • the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
  • a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
  • the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
  • the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control
  • the characteristic value includes the read-write ratio value;
  • the obtaining unit 401 is specifically configured to: count the first number of first read operations performed by the SSD, and the first read operation A read operation generated for the computing device; count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller; The ratio of the two numbers is used as the read-write ratio of the SSD.
  • the acquiring unit 401 is further specifically configured to: count the first number of the first read operations in the first cache queue executed by the SSD; the acquiring unit 401 is further specifically configured to: Used to: count the second number of the second read operations in the first cache queue executed by the SSD; the pressure value indicates the first read in the second cache queue waiting for the SSD to execute The number of operations, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second cache queue does not exist in the second cache queue read operation.
  • the acquiring unit 401 is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; the adjusting unit 402, specifically for dynamically adjusting the number of allowable insert read operations in a first operation process based on the target characteristic value.
  • An embodiment of the present application further provides a controller, where the controller includes a processing component, a storage component, and a communication interface, and the processing component reads an instruction stored on the storage component through the communication interface, so as to execute the above-mentioned
  • the controller includes a processing component, a storage component, and a communication interface
  • the processing component reads an instruction stored on the storage component through the communication interface, so as to execute the above-mentioned
  • Any one of the embodiments relates to a management method and function for data read in a solid-state disk SSD.
  • Embodiments of the present application also provide a computer program product including instructions, which, when running on a computer, enables the computer to execute the management method and function of data reading in a solid-state hard disk in any of the foregoing embodiments.
  • An embodiment of the present application provides a computer storage medium for storing computer software instructions used for the solid-state hard disk SSD provided in the second aspect, including a program for executing the program involved in the first aspect.
  • the disclosed apparatus may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the above-mentioned units is only a logical function division.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated units are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device) to execute all or part of the steps of the above methods in various embodiments of the present application.
  • a computer device which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device
  • the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, Read-Only Memory (Read-Only Memory, abbreviation: ROM) or Random Access Memory (Random Access Memory, abbreviation: RAM), etc.
  • a medium that can store program code may include: U disk, mobile hard disk, magnetic disk, optical disk, Read-Only Memory (Read-Only Memory, abbreviation: ROM) or Random Access Memory (Random Access Memory, abbreviation: RAM), etc.

Abstract

Disclosed in the embodiments of the present application are a data reading method and apparatus applied to a solid state disk (SSD), and an SSD, for improving the performance of the SSD. Provided is a data reading method, comprising: obtaining the feature value of the SSD, the feature value comprising at least one of a read-write ratio value or a pressure value, the read-write ratio value being a ratio of the number of read operations executed by the SSD to the number of write operations executed by the SSD, and the pressure value indicating the number of read operations waiting to be executed in the SSD; and according to the feature value, dynamically adjusting the number of read operations that are allowed to be inserted during one first operation, the first operation being a write operation or an erasing operation that is currently executed. The present application improves the performance of the SSD.

Description

一种应用于固态硬盘SSD的数据读取方法及相关装置A data reading method and related device applied to solid-state hard disk SSD 技术领域technical field
本申请涉及存储领域,尤其涉及一种应用于固态硬盘SSD的数据读取方法及相关装置。The present application relates to the field of storage, and in particular, to a data reading method and a related device applied to a solid-state hard disk (SSD).
背景技术Background technique
固态硬盘(Solid State Disk,SSD)是一种广泛应用的存储设备,主要由控制器和存储单元构成。其中,存储单元一般包括NAND Flash等多个闪存颗粒,每个闪存颗粒内部包括一个或者多个裸片(die),每个die包括多个物理块(block),block的容量大小一般在数百KB至数MB之间,每个block包括多个页(page),page的容量大小一般为4KB的倍数(如4KB或者16KB)。SSD通过闪存转换层(Flash Translation Layer,FTL)将数据均匀分布存储在各个NAND Flash上。一般情况下,在NAND Flash上可以执行读、写、擦等操作用于读取或存入数据,但是在同一个NAND Flash上读、写、擦除操作不能同时执行。Solid State Disk (SSD) is a widely used storage device, which is mainly composed of a controller and a storage unit. Among them, the storage unit generally includes multiple flash memory particles such as NAND Flash, each flash memory particle includes one or more bare chips (die), each die includes multiple physical blocks (block), and the capacity of the block is generally hundreds of Between KB and several MB, each block includes multiple pages (pages), and the capacity of pages is generally a multiple of 4KB (such as 4KB or 16KB). The SSD stores data evenly on each NAND Flash through the Flash Translation Layer (FTL). In general, operations such as read, write, and erase can be performed on NAND Flash to read or store data, but read, write, and erase operations on the same NAND Flash cannot be performed at the same time.
如果NAND Flash上正在执行一个写或擦除操作,那么如果一个新的读操作要执行时,可以:1)等待NAND Flash上写或擦除操作执行完;2)将暂停(Suspend)操作下发到NAND Flash上,NAND Flash接收到暂停操作后,会暂停正在执行的写或擦除操作,然后执行读操作。被暂停执行的写或擦除操作要恢复执行,主机可以下发恢复(Resume)操作到NAND Flash上,会恢复执行被暂停执行的写或擦操作。但是,由于这些操作的执行时间差异较大,所以如果对一个写或擦除操作过程中下发的读操作总数量不作限制,只关注到对读时延的影响,这样对写和擦除操作的影响较大。又如果对一个写或擦除操作过程中下发的读操作总数量只限定一个固定的阈值,只关注到对写和擦除操作的影响,这样若等待执行的读操作数量较多时,对读操作的影响较大。If a write or erase operation is being performed on the NAND Flash, then if a new read operation is to be performed, you can: 1) Wait for the write or erase operation on the NAND Flash to complete; 2) Issue the Suspend operation On the NAND Flash, after the NAND Flash receives the suspend operation, it suspends the ongoing write or erase operation, and then executes the read operation. To resume the suspended write or erase operation, the host can issue a Resume operation to the NAND Flash, and the suspended write or erase operation will be resumed. However, due to the large difference in the execution time of these operations, if there is no limit to the total number of read operations issued during a write or erase operation, only the impact on the read delay is concerned. greater impact. In addition, if only a fixed threshold is limited for the total number of read operations issued during a write or erase operation, only the impact on write and erase operations is concerned. Operation has a greater impact.
因此,如何提升NAND Flash执行读、写和擦除操作的效率,提高SSD的性能,是本申请亟需解决的问题。Therefore, how to improve the efficiency of reading, writing and erasing operations performed by NAND Flash and improve the performance of SSD is an urgent problem to be solved in this application.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种应用于固态硬盘SSD的数据读取方法、装置及固态硬盘SSD,以提高固态硬盘的性能。Embodiments of the present application provide a data reading method and device applied to a solid-state drive (SSD), and the solid-state drive (SSD), so as to improve the performance of the solid-state drive.
第一方面,本申请实施例提供了一种应用于固态硬盘SSD的数据读取方法,可包括:获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前执行的写操作或擦除操作。In a first aspect, an embodiment of the present application provides a data reading method applied to a solid-state drive (SSD), which may include: acquiring a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value , the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; based on the characteristic value , dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is the currently executed write operation or erase operation.
在本申请实施例中,首先获取SSD的特征值,该特征值包括读写比例值或压力值中的至少一个,由于读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值用于指示所述SSD中等待执行的读操作的数量。因此,通过特征值,可以确定SSD当前执行读、写或擦除操作的效率和压力。若效率较低,压力较大,可以根据获取到的读写比例值或压力值中的至少一个,动态调整一个第一操作过程中允许插入读操 作的数量,以提升NAND Flash执行读、写和擦除操作的效率,进而提高SSD的性能。In the embodiment of the present application, the characteristic value of the SSD is first obtained, and the characteristic value includes at least one of a read-write ratio value or a pressure value. Since the read-write ratio value is the number of read operations performed by the SSD and the write operation performed by the SSD The ratio of the number of operations, the pressure value is used to indicate the number of read operations waiting to be performed in the SSD. Therefore, through the eigenvalues, it is possible to determine the current efficiency and pressure of the SSD to perform read, write or erase operations. If the efficiency is low and the pressure is high, according to at least one of the read-write ratio value or the pressure value obtained, the number of inserting read operations allowed in a first operation can be dynamically adjusted to improve the performance of read, write and read operations of NAND Flash. Efficiency of erase operations, which in turn improves the performance of SSDs.
在一种可能实现的方式中,所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。在一个写操作或者擦除操作过程中,SSD每执行一个读操作后,都可以记一次数,以记录到此为止插入的读操作数量。因此,在实施本申请实施例时,通过直接配置一个第一操作过程中允许插入读操作的第一阈值(第一阈值可以为最大数量)后,统计被插入的读操作数量,在达到允许插入的最大数量后,禁止再次插入读操作,以此实现调整读操作数量的目的。通过这种方式可以直观方便的调整允许插入读操作数量,进而提高了SSD的性能。In a possible implementation manner, the dynamically adjusting the number of allowable insert read operations in a first operation process based on the characteristic value includes: determining, based on the characteristic value, the allowable insert read operation during the first operation process The first threshold value of the read operation; according to the first threshold value, dynamically adjust the number of read operations that are allowed to be inserted during a first operation. During a write operation or an erase operation, each time the SSD performs a read operation, it can record the number once to record the number of read operations inserted so far. Therefore, when implementing this embodiment of the present application, after directly configuring a first threshold value (the first threshold value may be the maximum number) that allows insertion of read operations during the first operation, the number of inserted read operations is counted. After the maximum number of read operations, it is forbidden to insert read operations again, so as to achieve the purpose of adjusting the number of read operations. In this way, the number of allowable insert read operations can be adjusted intuitively and conveniently, thereby improving the performance of the SSD.
在一种可能实现的方式中,所述基于所述特征值,动态调整一个第一操作过程中允许执行读操作的数量,包括:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。在本申请实施例中,暂停操作用于在一个第一操作过程中,暂停该第一操作,然后暂停操作使用后在第一操作中插入读操作。因此,本申请实施例可以通过调整暂停操作的约束条件,如:调整暂停操作的使用频率、调整暂停操作的使用数量等,从而动态的调整使用暂停操作后,允许插入读操作的最大数量。In a possible implementation manner, the dynamically adjusting the number of read operations allowed to be performed in a first operation process based on the characteristic value includes: acquiring, based on the characteristic value, a pause operation corresponding to the characteristic value strategy, the suspend operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on The suspend operation strategy dynamically adjusts the number of allowable insert read operations in a first operation process. In this embodiment of the present application, the suspend operation is used to suspend the first operation during a first operation, and then insert a read operation into the first operation after the suspend operation is used. Therefore, the embodiments of the present application can dynamically adjust the maximum number of read operations allowed to insert after using the pause operation by adjusting the constraints of the pause operation, such as: adjusting the use frequency of the pause operation, adjusting the number of use of the pause operation, etc.
在一种可能实现的方式中,所述基于所述特征值,获取与所述特征值对应的暂停操作策略,包括:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。在本申请实施例中,获取该暂停操作策略的方式可以是从预先存储的映射表中,直接根据该特征值确定。从预存储的映射关系表中确定暂停操作策略,可以快捷方便的节省计算步骤,大大的缩短了获取到暂停操作策略的时间,同时也提高了调整设置允许插入读操作数量时的效率,进而提高了SSD的性能。In a possible implementation manner, the obtaining the pause operation policy corresponding to the feature value based on the feature value includes: obtaining, based on the feature value, from a pre-stored mapping table The suspend operation strategy corresponding to the characteristic value, and the mapping relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy. In this embodiment of the present application, the manner of acquiring the suspending operation policy may be determined directly according to the characteristic value from a pre-stored mapping table. Determining the pause operation strategy from the pre-stored mapping table can quickly and conveniently save calculation steps, greatly shorten the time to obtain the pause operation strategy, and improve the efficiency of adjusting the number of inserted read operations allowed by the settings, thereby improving the the performance of the SSD.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。在一个第一操作过程中,本申请实施例通过直接限制暂停操作使用的第二阈值,该第二阈值可以为最大数量,即,通过限制打断一个第一操作执行的次数,进而可以限制允许插入读操作最大数量,从而提高了SSD的性能。例如:限制允许插入读操作最大数量,读操作就不会频繁打断写操作或者擦除操作的执行,因为这时性能(每秒读写次数(Input/Output Operations Per Second,IOPS))主要的瓶颈是写IOPS,所以减小阈值,就能够减少对写操作的打断,SSD的IOPS性能就会较高。In a possible implementation manner, the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation. During a first operation, the embodiment of the present application directly restricts the second threshold used by the pause operation, and the second threshold may be the maximum number, that is, by restricting the number of times of interrupting the execution of a first operation, thereby restricting the allowable The maximum number of insert read operations, thereby improving the performance of the SSD. For example, by limiting the maximum number of insert read operations, read operations will not frequently interrupt the execution of write operations or erase operations, because performance (Input/Output Operations Per Second, IOPS) is the main factor at this time. The bottleneck is write IOPS, so reducing the threshold can reduce the interruption of write operations, and the IOPS performance of the SSD will be higher.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。本申请实施例通过配置发送一次所述暂停操作后允许插入读操作的第三阈值,该第三阈值可以为最大数量,从而控制一个第一操作过程中允许发送所述读操作数量。即通过控制每下发一次暂停操作,控制插入的读操作最大数量,进而控制暂停一次的读操作总的执行时间,进而减少每次暂停操作对第一操作打断的时间,从而提高SSD的性能。In a possible implementation manner, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation. This embodiment of the present application controls the number of read operations that are allowed to be sent during a first operation by configuring a third threshold for allowing insertion of read operations after the pause operation is sent once, where the third threshold may be the maximum number. That is, by controlling each suspend operation, the maximum number of inserted read operations is controlled, and then the total execution time of the read operation suspended once is controlled, thereby reducing the time that each suspend operation interrupts the first operation, thereby improving the performance of the SSD. .
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。实施本申请实施例,在读写比例值越大情况下,说明执行读操作的占比越高,因此,这时SSD的IOPS性能主要的瓶颈是写IOPS,此时允许插入读操作的最大数量设置较小的阈值,那么不会有过多的读操作频繁打断写操作的执行。所以减小插入读操作的最大数量,可以能够减少对写操作的打断,从而提高SSD的性能。In a possible implementation manner, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value. Implementing the embodiment of the present application, the larger the read-write ratio value is, the higher the proportion of read operations is performed. Therefore, at this time, the main bottleneck of the IOPS performance of the SSD is the write IOPS, and the maximum number of insert read operations is allowed at this time. Set a smaller threshold, so that there will not be too many read operations frequently interrupting the execution of write operations. Therefore, reducing the maximum number of insert read operations can reduce the interruption of write operations, thereby improving the performance of the SSD.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。在本申请实施例中,压力值越大,说明等待执行的度操作数量越多。此时,需要降低允许插入读操作的最大数量,防止过多的读操作会打扰写操作的执行。如果压力值较小,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的最大数量的阈值,允许读操作尽可能多的打断写操作或擦除操作,让读操作尽快执行完成。In a possible implementation manner, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value. In the embodiment of the present application, the larger the pressure value, the more the number of degree operations waiting to be performed. At this time, it is necessary to reduce the maximum number of allowable insert read operations to prevent excessive read operations from interrupting the execution of write operations. If the pressure value is small, it means that the read latency of the read operation is more focused on the computing device. At this time, a larger threshold value of the maximum number of suspended operations allowed to be sent should be configured to allow the read operation to interrupt the write operation as much as possible. Or erase operation, let the read operation complete as soon as possible.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。在本申请实施例中,同时获取到读写比例值和压力值的情况下,若压力值大于第一压力值(如:压力值足够大),此时若想快速提高NAND Flash执行读、写和擦除操作的效率,还需要根据SSD执行的读写比例值,适应性的降低允许插入读操作的第一阈值,减少读操作对第一操作的打断,以便提高SSD的IOPS性能。如果压力值小于第一压力值(压力值足够小),说明此时正在等待的读操作数量不多,计算设备上更专注读操作的读延时,这时可以配置一个较大的允许插入读操作的第一阈值,允许读操作尽可能多的打断写操作或擦除操作,让读操作尽快执行完成。In a possible implementation manner, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process is allowed to insert read/write The first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional. In the embodiment of the present application, when the read/write ratio value and the pressure value are obtained at the same time, if the pressure value is greater than the first pressure value (for example, the pressure value is large enough), if you want to quickly increase the NAND Flash to perform read and write In order to improve the IOPS performance of the SSD, it is also necessary to adaptively lower the first threshold for allowing insertion and read operations to reduce the interruption of the first operation by the read operation according to the read-write ratio value performed by the SSD. If the pressure value is less than the first pressure value (the pressure value is small enough), it means that there are not many read operations waiting at this time, and the calculation device is more focused on the read delay of read operations. The first threshold of the operation, allowing the read operation to interrupt the write operation or erase operation as much as possible, so that the read operation can be completed as soon as possible.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。实施本申请实施例,在读写比例值越大情况下,说明执行读操作的占比越高,因此,这时SSD的IOPS性能主要的瓶颈是写IOPS,此时允许发送暂停操作的最大数量设置较小的阈值,那么读操作就不会频繁打断写操作的执行。所以减小阈值,就能够减少对写操作的打断,IOPS性能就会较高。例如,当许发送暂停操作的最大数量设置为0时,读操作就不会打扰写操作的进行,此时专注与写操作,反之,读操作和写操作的比例关系比值越小,说明写操作的占比越高,此时SSD的性能更依赖于读操作的执行,所以将允许发送暂停操作的最大数量设置较大的阈值,那么读操作就可以频繁打断写操作的执行,就能够让读操作更快的执行,SSD的性能就会较高。In a possible implementation manner, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value . Implementing the embodiment of the present application, the larger the read-write ratio value is, the higher the proportion of read operations is performed. Therefore, at this time, the main bottleneck of the IOPS performance of the SSD is the write IOPS, and the maximum number of suspended operations allowed to be sent at this time. Set a smaller threshold, so that read operations will not frequently interrupt the execution of write operations. Therefore, reducing the threshold can reduce the interruption of write operations, and the IOPS performance will be higher. For example, when the maximum number of allowable sending pause operations is set to 0, the read operation will not disturb the write operation, and the focus is on the write operation at this time. At this time, the performance of the SSD is more dependent on the execution of read operations. Therefore, a larger threshold is set for the maximum number of suspended operations that are allowed to be sent, so that read operations can frequently interrupt the execution of write operations, allowing The faster the read operation is performed, the higher the performance of the SSD.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。在本申请实施例中,压力值越大,说明计算设备上更关注IOPS性能,因此在压力值较大的时候,发送所述暂停操作的最大数量可以相应的减小。如果压力值较小,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的最大数量,允许读操作尽可能多的打断写操作或擦除操作,让读操作尽快执行完成。In a possible implementation manner, when the characteristic value includes the pressure value, a second threshold value that allows sending the pause operation during the one first operation process is inversely proportional to the pressure value. In this embodiment of the present application, a larger pressure value indicates that the computing device pays more attention to IOPS performance. Therefore, when the pressure value is larger, the maximum number of the suspend operations sent may be correspondingly reduced. If the pressure value is small, it means that the read delay of more focused read operations on the computing device should be configured. At this time, a larger maximum number of suspended operations allowed to be sent should be configured to allow read operations to interrupt write operations or erase operations as much as possible. The division operation allows the read operation to complete as soon as possible.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。在本申请实施例中,如果压力值大于第二压力值,说明计算设备上更关注SSD的IOPS性能,因此在压力值较大的时候按照SSD上读I/O和写I/O的比例来配置允许发送所述暂停操作的第二阈值,减少读操作对第一操作的打断。如果压力值小于所述第二压力值,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的第二阈值,允许读操作尽可能多的打断写操作或擦除操作,让读操作尽快执行完成。In a possible implementation manner, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional. In the embodiment of the present application, if the pressure value is greater than the second pressure value, it means that the computing device pays more attention to the IOPS performance of the SSD. Therefore, when the pressure value is high, the ratio of read I/O to write I/O on the SSD is calculated. Configuring a second threshold that allows sending of the suspended operation reduces interruption of the first operation by the read operation. If the pressure value is less than the second pressure value, it means that the computing device is more focused on the read delay of the read operation. At this time, a larger second threshold value that allows the suspension operation to be sent should be configured to allow as many read operations as possible. Interrupt the write or erase operation to allow the read operation to complete as soon as possible.
在一种可能实现的方式中,所述SSD包括控制器,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;所述获取所述SSD的特征值包括:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。在本申请实施例中,SSD的读写比例是根据SSD执行的读操作数量和SSD执行的写操作数量确定的,由于并不好直接统计SSD执行的写操作数量。所以,此处SSD执行写操作数量可以用执行SSD中控制器生成的读操作(第二读操作)的数量(计算设备生成的读操作并不计算在内)指示。而且,SSD执行读操作数量可以用执行计算设备生成的读操作(第一读操作)的数量(SSD自己生成的读操作并不计算在内)指示。因此,所述SSD的读写比例值可以由第一读操作的数量和第二读操作数量的比值确定,这种方式更加方便获取。其中,每个读操作均有一个标记位,可以记录该读操作是计算设备生成的还是SSD中控制器自己产生。所以,控制器可以在执行读操作时,简便又精确的分别识别并统计第一读操作和第二读操作的数量。In a possible implementation manner, the SSD includes a controller, the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the SSD performs write operations The number of operations corresponds to the number of read operations generated by the controller; the characteristic value includes the read/write ratio value; the acquiring the characteristic value of the SSD includes: counting the number of first read operations performed by the SSD; a number, where the first read operation is a read operation generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller; The ratio of the first quantity and the second quantity is used as a read/write ratio value of the SSD. In the embodiment of the present application, the read/write ratio of the SSD is determined according to the number of read operations performed by the SSD and the number of write operations performed by the SSD, because it is not easy to directly count the number of write operations performed by the SSD. Therefore, the number of write operations performed by the SSD here may be indicated by the number of read operations (second read operations) generated by the controller in the SSD (read operations generated by the computing device are not counted). Also, the number of read operations performed by the SSD may be indicated by the number of read operations (first read operations) generated by the performing computing device (read operations generated by the SSD itself are not counted). Therefore, the read/write ratio value of the SSD may be determined by the ratio of the number of first read operations to the number of second read operations, which is more convenient to obtain. Among them, each read operation has a flag bit, which can record whether the read operation is generated by the computing device or by the controller in the SSD. Therefore, the controller can easily and accurately identify and count the numbers of the first read operation and the second read operation respectively when performing the read operation.
在一种可能实现的方式中,所述统计所述SSD执行第一读操作的第一数量包括:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;所述统计所述SSD执行第二读操作的第二数量包括:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。实施本申请实施例,通过统计第一缓存队列中的执行的第一读操作数量和执行的第二读操作数量,以及第二缓存队列中正在等待的读操作数量,可以更加快捷的确定读写比例值和压力值,及时的反馈SSD内的读写比例值和压力值的变化,以便及时调整一个第一操作过程中允许插入读操作的最大数量,保障且进一步的提高SSD的性能。In a possible implementation manner, the counting the first number of the first read operations performed by the SSD includes: counting the first number of the first read operations in the first cache queue performed by the SSD; The counting the second number of the second read operations performed by the SSD includes: counting the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the second The number of the first read operations in the cache queue waiting to be performed by the SSD, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, And the second read operation does not exist in the second cache queue. By implementing the embodiment of the present application, by counting the number of executed first read operations and the number of executed second read operations in the first cache queue, and the number of waiting read operations in the second cache queue, it is possible to more quickly determine read and write Proportion value and pressure value, timely feedback the change of read/write ratio value and pressure value in SSD, so as to adjust the maximum number of insert read operations in a first operation process in time, to ensure and further improve the performance of SSD.
在一种可能实现的方式中,所述获取所述SSD的特征值,包括:周期性的记录并存储与所述SSD的特征值;获取当前时间点最近周期的目标特征值;所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。实施本申请实施例,周期性的记录SSD中 读写比例值和压力值,根据最新的读写比例值和压力值,调整允许插入的读操作的数量,可以及时的调整SSD的适应能力,提高SSD的存储性能。In a possible implementation manner, the acquiring the characteristic value of the SSD includes: periodically recording and storing the characteristic value of the SSD; acquiring the target characteristic value of the most recent period at the current time point; and dynamically adjusting the number of allowable insert read operations in a first operation process, including: dynamically adjusting the number of allowable insert read operations in a first operation process based on the target characteristic value. Implement the embodiment of the present application, periodically record the read/write ratio value and pressure value in the SSD, and adjust the number of read operations that are allowed to be inserted according to the latest read/write ratio value and pressure value, so as to adjust the adaptability of the SSD in time and improve the SSD storage performance.
第二方面,本申请实施例提供了一种固态硬盘SSD,包括控制器和存储阵列;所述控制器耦合至所述存储阵列,用于:获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前所述控制器对所述存储阵列进行的写操作或擦除操作。In a second aspect, an embodiment of the present application provides a solid-state disk (SSD), including a controller and a storage array; the controller is coupled to the storage array, and is configured to: acquire a characteristic value of the SSD, where the characteristic value includes At least one of a read-write ratio value or a pressure value, the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates that the SSD is waiting for execution The number of read operations; based on the characteristic value, dynamically adjust the number of allowable insertion read operations during a first operation, where the first operation is the current write operation or erase performed by the controller on the storage array operate.
在一种可能实现的方式中,所述控制器具体用于:基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the controller is specifically configured to: determine, based on the characteristic value, a first threshold for allowing an insert read operation during the first operation; and dynamically adjust the The number of insert read operations allowed during a first operation.
在一种可能实现的方式中,所述控制器具体用于:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the controller is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy, dynamically adjust the allowable read insertion during a first operation process the number of operations.
在一种可能实现的方式中,所述控制器具体用于:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。In a possible implementation manner, the controller is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。In a possible implementation manner, the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。In a possible implementation manner, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process is allowed to insert read/write The first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
在一种可能实现的方式中,当所述特征值包括所述压力值的情况下,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允 许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
在一种可能实现的方式中,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;所述控制器具体用于:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。In a possible implementation manner, the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control The characteristic value includes the read-write ratio value; the controller is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is: read operations generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller; combine the first number and the second read operation The ratio of the numbers is used as the read-write ratio of the SSD.
在一种可能实现的方式中,所述控制器具体用于:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;所述控制器具体用于:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。In a possible implementation manner, the controller is specifically configured to: count the first number of the first read operations in the first cache queue performed by the SSD; the controller is specifically configured to: count the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, The first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue.
在一种可能实现的方式中,所述控制器具体用于:周期性的记录并存储与所述SSD的特征值;获取当前时间点最近周期的目标特征值;基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the controller is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the latest period at the current time point; based on the target characteristic value, dynamically Adjusts the number of insert read operations allowed during a first operation.
第三方面,本申请实施例提供一种计算设备,所述计算设备可包括处理器;所述计算设备与固态硬盘SSD连接;所述处理器用于:获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前在所述SSD中执行的写操作或擦除操作。In a third aspect, an embodiment of the present application provides a computing device, where the computing device may include a processor; the computing device is connected to a solid-state hard disk (SSD); the processor is configured to: acquire a feature value of the SSD, and the feature The value includes at least one of a read-write ratio value or a pressure value, the read-write ratio value being the ratio of the number of read operations performed by the SSD to the number of write operations performed by the SSD, the pressure value indicating the number of The number of read operations waiting to be performed; based on the characteristic value, dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is a write operation or an erase operation currently performed in the SSD.
在一种可能实现的方式中,所述处理器具体用于:基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the processor is specifically configured to: determine, based on the characteristic value, a first threshold that allows insert read operations during the first operation; and dynamically adjust the The number of insert read operations allowed during a first operation.
在一种可能实现的方式中,所述处理器具体用于:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;将所述暂停策略发送至所述SSD中,以使所述SSD基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the processor is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; send the suspend policy to the SSD, so that the SSD is based on The suspend operation strategy dynamically adjusts the number of allowable insert read operations in a first operation process.
在一种可能实现的方式中,所述处理器具体用于:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。In a possible implementation manner, the processor is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。In a possible implementation manner, the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。In a possible implementation manner, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作 过程中允许插入读操作的第一阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process is allowed to insert read/write The first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
在一种可能实现的方式中,当所述特征值包括所述压力值的情况下,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
在一种可能实现的方式中,所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;所述控制器具体用于:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。In a possible implementation manner, the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD corresponds to the number of read operations generated by the controller ; The characteristic value includes the read-write ratio value; the controller is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is a read operation generated by the computing device ; Count the second quantity of the second read operation performed by the SSD, and the second read operation is a read operation generated by the controller; take the ratio of the first quantity and the second quantity as the value of the SSD Read and write scale values.
在一种可能实现的方式中,所述处理器具体用于:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;所述处理器具体用于:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。In a possible implementation manner, the processor is specifically configured to: count the first number of the first read operations in the first cache queue executed by the SSD; the processor is specifically configured to: count the second number of the second read operations in the first cache queue performed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, The first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue.
在一种可能实现的方式中,所述处理器具体用于:周期性的记录并存储与所述SSD的特征值;获取当前时间点最近周期的目标特征值;基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the processor is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; based on the target characteristic value, dynamically Adjusts the number of insert read operations allowed during a first operation.
第四方面,本申请实施例提供了一种应用于固态硬盘SSD的数据读取装置,可包括:获取单元,用于获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;调整单元,用于基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前执行的写操作或擦除操作。In a fourth aspect, an embodiment of the present application provides a data reading device applied to a solid-state disk (SSD), which may include: an acquisition unit configured to acquire a characteristic value of the SSD, where the characteristic value includes a read-write ratio value or a pressure At least one of the values, the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; An adjustment unit, configured to dynamically adjust the number of allowable insertion read operations in a first operation process based on the characteristic value, where the first operation is a currently executed write operation or an erase operation.
在一种可能实现的方式中,所述调整单元具体用于:基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过 程中允许插入读操作的数量。In a possible implementation manner, the adjustment unit is specifically configured to: determine, based on the characteristic value, a first threshold that allows inserting a read operation during the first operation; dynamically adjust the The number of insert read operations allowed during a first operation.
在一种可能实现的方式中,所述调整单元具体用于:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the adjustment unit is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send a suspension during a first operation process (Suspend) Constraints of the operation, the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy, dynamically adjust the allowable read insertion during a first operation process the number of operations.
在一种可能实现的方式中,所述调整单元具体用于:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。In a possible implementation manner, the adjustment unit is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relation table, the mapping relation The table includes the correspondence between the characteristic value and the pause operation strategy.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。In a possible implementation manner, the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。In a possible implementation manner, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process is allowed to insert read/write The first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
在一种可能实现的方式中,当所述特征值包括所述压力值的情况下,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
在一种可能实现的方式中,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;所述获取单元具体用于:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。In a possible implementation manner, the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control The characteristic value includes the read-write ratio value; the acquisition unit is specifically configured to: count the first number of the first read operation performed by the SSD, and the first read operation is: read operations generated by the computing device; count the second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller; combine the first number and the second read operation The ratio of the numbers is used as the read-write ratio of the SSD.
在一种可能实现的方式中,所述获取单元还具体用于:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;所述获取单元还具体用于:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由 所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。In a possible implementation manner, the acquiring unit is further specifically configured to: count the first number of the first read operations in the first cache queue performed by the SSD; the acquiring unit is further specifically configured to: : count the second number of the second read operations in the first cache queue executed by the SSD; the pressure value indicates the number of the first read operations in the second cache queue waiting to be executed by the SSD number, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue .
在一种可能实现的方式中,所述获取单元具体用于:周期性的记录并存储与所述SSD的特征值;获取当前时间点最近周期的目标特征值;所述调整单元,具体用于基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the acquisition unit is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; the adjustment unit is specifically configured to: Based on the target characteristic value, dynamically adjust the number of allowable insert read operations during a first operation.
第五方面,本申请实施例提供一种控制器,所述控制器包括处理组件、存储组件和通信接口,所述处理组件通过所述通信接口读取所述存储组件上存储的指令,执行上述第一方面所述的方法。In a fifth aspect, an embodiment of the present application provides a controller, the controller includes a processing component, a storage component, and a communication interface, the processing component reads an instruction stored on the storage component through the communication interface, and executes the above The method described in the first aspect.
第六方面,本申请实施例提供了一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述第二方面中的固态硬盘SSD所执行的流程。In a sixth aspect, an embodiment of the present application provides a computer program, where the computer program includes instructions, when the computer program is executed by a computer, the computer can execute the process performed by the solid-state hard disk SSD in the second aspect.
第七方面,本申请实施例提供一种计算机存储介质,用于储存为上述第二方面提供的一种固态硬盘SSD所用的计算机软件指令,其包含用于执行上述第一方面所涉及的程序。In a seventh aspect, an embodiment of the present application provides a computer storage medium for storing computer software instructions used for the solid-state hard disk SSD provided in the second aspect, including a program for executing the program involved in the first aspect.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对本申请实施例中所需要使用的附图进行说明。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the accompanying drawings required in the embodiments of the present application will be described below.
图1是本申请实施例提供的一种应用于固态硬盘SSD的数据读取系统架构示意图。FIG. 1 is a schematic diagram of an architecture of a data reading system applied to a solid-state disk (SSD) provided by an embodiment of the present application.
图2是本申请实施例提供的一种通过暂停操作进行数据读取的方法流程示意图。FIG. 2 is a schematic flowchart of a method for reading data through a pause operation provided by an embodiment of the present application.
图3是本申请实施例提供的一种SSD的逻辑模块示意图。FIG. 3 is a schematic diagram of a logic module of an SSD provided by an embodiment of the present application.
图4是本申请实施例提供的另一种SSD的逻辑模块示意图。FIG. 4 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
图5是本申请实施例提供的又一种SSD的逻辑模块示意图。FIG. 5 is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application.
图6是本申请实施例提供的一种计算设备的逻辑模块示意图。FIG. 6 is a schematic diagram of a logic module of a computing device provided by an embodiment of the present application.
图7是本申请实施例提供的另一种计算设备的逻辑模块示意图。FIG. 7 is a schematic diagram of a logic module of another computing device provided by an embodiment of the present application.
图8是本申请实施例提供的一种应用于固态硬盘SSD的数据读取方法的流程示意图。FIG. 8 is a schematic flowchart of a data reading method applied to a solid-state disk SSD according to an embodiment of the present application.
图9是本申请实施例提供的一种SSD获取读写比例值的流程示意图。FIG. 9 is a schematic flowchart of an SSD obtaining a read/write ratio value according to an embodiment of the present application.
图10是本申请实施例提供的一种SSD统计第一读操作和第二读操作的示意图。FIG. 10 is a schematic diagram of a first read operation and a second read operation of an SSD according to an embodiment of the present application.
图11是本申请实施例提供的一种基于预存储的映射关系表中获取暂停操作策略的流程示意图。FIG. 11 is a schematic flowchart of obtaining a suspension operation policy based on a pre-stored mapping relationship table provided by an embodiment of the present application.
图12是本申请实施例提供的一种应用于固态硬盘SSD的数据读取装置的结构示意图。FIG. 12 is a schematic structural diagram of a data reading device applied to a solid-state disk (SSD) provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例进行描述。The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
本申请中的术语“第一”和“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设 备固有的其它步骤或单元。The terms "first" and "second" and the like in this application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或计算机。通过图示,在计算设备上运行的应用和计算设备都可以是部件。一个或多个部件可驻留在进程和/或执行线程中,部件可位于一个计算机上和/或分布在2个或更多个计算机之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。部件可例如根据具有一个或多个数据分组(例如来自与本地系统、分布式系统和/或网络间的另一部件交互的二个部件的数据,例如,通过信号与其它系统交互的互联网)的信号通过本地和/或远程进程来通信。The terms "component", "module", "system" and the like are used in this specification to refer to a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computing device and the computing device may be components. One or more components may reside within a process and/or thread of execution, and a component may be localized on one computer and/or distributed between 2 or more computers. In addition, these components can execute from various computer readable media having various data structures stored thereon. A component may, for example, be based on data with one or more data packets (eg, data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet interacting with other systems via signals). Signals are communicated through local and/or remote processes.
首先,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。First, some terms in this application will be explained so as to facilitate the understanding of those skilled in the art.
(1)固态驱动器(Solid State Drive,SSD),或称固态硬盘,是用固态电子存储芯片阵列而制成的硬盘。SSD由控制单元和存储单元(Flash芯片、DRAM芯片)组成,其芯片的工作温度范围很宽,应用领域广泛。固态硬盘的存储介质通常为两种,一种是采用闪存(Flash芯片)作为存储介质,另外一种是采用DRAM作为存储介质。本申请实施例涉及的固态硬盘为基于闪存的固态硬盘,即采用Flash芯片作为存储介质的SSD。它的外观可以被制作成多种模样,例如:笔记本硬盘、微硬盘、存储卡、U盘等样式。(1) Solid State Drive (SSD), or solid-state hard drive, is a hard drive made of solid-state electronic storage chip arrays. SSD consists of a control unit and a storage unit (Flash chip, DRAM chip), the chip has a wide operating temperature range and a wide range of applications. There are usually two types of storage media for solid-state drives, one is using flash memory (Flash chip) as the storage medium, and the other is using DRAM as the storage medium. The solid-state hard disk involved in the embodiments of the present application is a flash-based solid-state hard disk, that is, an SSD using a Flash chip as a storage medium. Its appearance can be made into a variety of styles, such as: notebook hard disk, micro hard disk, memory card, U disk and other styles.
(2)NAND闪存(NAND Flash),是一种非失性存储技术。NAND Flash的存储单元划分有cell,die,block,page,cell等。cell是最小的记忆单元,多个cell组成一个page(页);多个page组成一个block(块);多个block组成一个die。NAND Flash除了具有断电后仍能保存数据的特性,还具有以下硬件特性:一个记忆单元经过写入(program),表示的数据可由逻辑1变成逻辑0,但无法再经由写入将此单元回复到逻辑1,需经过擦除(erase)才可回复逻辑1。一般快闪存储器中抹除的最小单位称为块(block)。擦除的操作时间一般大于读取和写入的操作时间。目前,大多数SSD的闪存颗粒主要分为单层存储单元(Single-Level Cell,SLC)、双层存储单元(Multi-Level Cell,MLC)、三层存储单元(Trinary-Level Cell,TLC)和四层存储单元(Quadruple-Level Cell,QLC),甚至还可能会出现多层存储单元;其中,TLC包括3D-TLC与2D-TLC;3D-TLC可以细分为32层3D-TLC、64层3D-TLC和96层3D-TLC。(2) NAND Flash (NAND Flash) is a non-volatile storage technology. The storage units of NAND Flash are divided into cell, die, block, page, cell, etc. A cell is the smallest memory unit. Multiple cells form a page (page); multiple pages form a block (block); multiple blocks form a die. In addition to the feature that NAND Flash can still save data after a power failure, it also has the following hardware features: After a memory cell is programmed, the data represented can be changed from logic 1 to logic 0, but it cannot be written to this cell anymore. To return to logic 1, it needs to be erased to return to logic 1. Generally, the smallest unit of erasure in flash memory is called a block. The operation time for erasing is generally greater than the operation time for reading and writing. At present, the flash memory particles of most SSDs are mainly divided into single-level storage cells (Single-Level Cell, SLC), double-layer storage cells (Multi-Level Cell, MLC), three-layer storage cells (Trinary-Level Cell, TLC) and Quadruple-Level Cell (QLC), and even multi-layer memory cells may appear; among them, TLC includes 3D-TLC and 2D-TLC; 3D-TLC can be subdivided into 32-layer 3D-TLC, 64-layer 3D-TLC and 96-layer 3D-TLC.
(3)I/O接口,或IO接口,可以是控制对象与被控对象进行信息交换的纽带。本申请的计算设备通过I/O接口与固态硬盘进行数据交换。目前,绝大部分I/O接口涉及的具体程序都是可编程的,即它们的工作方式可由程序进行控制。(3) I/O interface, or IO interface, can be the link for information exchange between the control object and the controlled object. The computing device of the present application performs data exchange with the solid-state hard disk through an I/O interface. At present, most of the specific programs involved in the I/O interface are programmable, that is, their working methods can be controlled by the program.
(4)Host接口,或数据总线,可以包括SATA、SAS和PCIe等。其中,串行ATA(Serial Advanced Technology Attachment,Serial ATA)是一种计算机总线,负责主板和大容量存储 设备(如硬盘及光盘驱动器)之间的数据传输,主要用于个人计算机;串行ATA与串列SCSI(Serial Attached SCSI,SAS)的两者排线兼容,SATA硬盘可接上SAS接口。SAS(Serial Attached SCSI),是串行连接SCSI接口,即串行连接小型计算机系统接口;与SATA硬盘相同,都是采用串行技术以获得更高的传输速度,并通过缩短连结线改善内部空间等。SAS是并行SCSI接口之后开发出的全新接口,为了改善存储系统的效能、可用性和扩充性,提供与SATA硬盘的兼容性。PCI Express总线(即PCIe)是较旧的PCI/PCI-X总线的高速串行替换;PCI Express基于点到点拓扑,单独的串行链路将每个设备连接到根系统(主机)。由于其共享总线拓扑,可以对单个方向上的PCI总线进行仲裁(在多个主机的情况下),并且一次限制为一个主机;此外,PCI Express总线链路支持任何两个端点之间的全双工通信,同时跨多个端点的并发访问没有固有的限制。(4) The Host interface, or data bus, may include SATA, SAS, and PCIe. Among them, Serial ATA (Serial Advanced Technology Attachment, Serial ATA) is a computer bus, responsible for data transmission between the motherboard and mass storage devices (such as hard disks and CD-ROM drives), mainly used for personal computers; Serial ATA and Both serial SCSI (Serial Attached SCSI, SAS) cables are compatible, and SATA hard drives can be connected to the SAS interface. SAS (Serial Attached SCSI), is a serially attached SCSI interface, that is, a serially attached small computer system interface; same as SATA hard disks, serial technology is used to obtain higher transmission speed, and the internal space is improved by shortening the connection line Wait. SAS is a new interface developed after the parallel SCSI interface. In order to improve the performance, usability and expandability of the storage system, it provides compatibility with SATA hard disks. The PCI Express bus, or PCIe, is a high-speed serial replacement for the older PCI/PCI-X bus; PCI Express is based on a point-to-point topology, with a separate serial link connecting each device to the root system (host). Due to its shared bus topology, the PCI bus can be arbitrated in a single direction (in the case of multiple hosts) and is limited to one host at a time; in addition, the PCI Express bus link supports full-duplexing between any two endpoints There are no inherent limitations to concurrent access across multiple endpoints at the same time.
(5)IOPS(Input/Output Operations Per Second),每秒读写次数,也可被称为每秒输入/输出次数。是一个用于计算机存储设备(如硬盘(HDD)、固态硬盘(SSD)或存储区域网络(SAN))性能测试的量测方式,可以视为是每秒的读写次数。(5) IOPS (Input/Output Operations Per Second), the number of reads and writes per second, also known as the number of input/output per second. It is a measurement method used for performance testing of computer storage devices (such as hard disk drives (HDD), solid state drives (SSD) or storage area networks (SAN)), which can be regarded as the number of reads and writes per second.
(6)现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA),是一种数字集成电路芯片,FPGA是数字电路的物理实现方式之一。(6) Field Programmable Gate Array (FPGA) is a digital integrated circuit chip, and FPGA is one of the physical implementations of digital circuits.
下面先对本申请实施例所基于的其中一种系统架构进行描述。请参见图1,图1是本申请实施例提供的一种应用于固态硬盘SSD的数据读取系统架构示意图,图1所示的架构主要以固态硬盘SSD为主体,从数据读取角度进行描述。本申请提出的固态硬盘的数据读取方法可以应用于该系统架构。该系统架构中包含了计算设备10(Host,图中以包含处理器101为例进行说明,相当于主机)和固态硬盘(SSD)20;其中,图1以控制器201和存储器202集成在固态硬盘20内部为例进行说明,固态硬盘20可以包括控制器201和存储器202;可选地,控制器201可以为独立于固态硬盘20的处理器件,通过与固态硬盘20中的存储器202连接,执行数据写入、数据读取以及数据擦除等操作;而存储器202也可以为独立的存储器件,在此不再赘述。如图1所示,存储器202还可以包括多个Flash存储区域,如Flash 0、Flash 1、…、Flash N等,N为大于0的整数。其中,所述存储器相当于本申请实施例中的存储阵列。One of the system architectures on which the embodiments of the present application are based is first described below. Please refer to FIG. 1. FIG. 1 is a schematic diagram of the architecture of a data reading system applied to a solid-state drive (SSD) provided by an embodiment of the present application. The architecture shown in FIG. 1 mainly takes the solid-state drive SSD as the main body, and is described from the perspective of data reading . The data reading method of the solid-state hard disk proposed in this application can be applied to the system architecture. The system architecture includes a computing device 10 (Host, in the figure, the processor 101 is used as an example for illustration, which is equivalent to a host) and a solid-state disk (SSD) 20; wherein, in FIG. 1, the controller 201 and the memory 202 are integrated in the solid-state The interior of the hard disk 20 is described as an example. The solid-state hard disk 20 may include a controller 201 and a memory 202; optionally, the controller 201 may be a processing device independent of the solid-state hard disk 20. operations such as data writing, data reading, and data erasing; and the memory 202 can also be an independent storage device, which will not be repeated here. As shown in FIG. 1 , the memory 202 may also include multiple Flash storage areas, such as Flash 0, Flash 1, . . . , Flash N, etc., where N is an integer greater than 0. The memory is equivalent to the storage array in the embodiment of the present application.
在上述固态硬盘SSD的数据读取系统中,计算设备10可以下发读操作、写操作、擦除操作到SSD中,固态硬盘中控制器201可以向处理器101返回操作结果。在固态硬盘中,控制器向NAND Flash下发读、写、擦等操作,NAND Flash向控制器返回操作结果。请参考附图2,图2是本申请实施例提供的一种通过暂停操作进行数据读取的方法流程示意图。在图2所示的应用场景中,为了降低计算设备的读时延,固态硬盘的控制器处理读操作时,如果判断该读操作要访问的NAND Flash上正在执行第一操作,第一操作为所述控制器201对存储阵列进行的写操作或擦除操作,控制器让当前读操作等待,先下发暂停(Suspend)操作到该NAND Flash上,暂停正在执行的第一操作,然后在NAND Flash上执行读操作(图2中下发顺序1)。对于已经下发暂停操作后的读操作,控制器直接下发读操作到NAND Flash上执行(图2中下发顺序2)。如果一段时间内没有读操作,控制器会下发恢复(Resume)操作到NAND Flash上恢复执行被暂停的第一操作(如图2中下发顺序3)。In the data reading system of the solid-state hard disk SSD, the computing device 10 can issue read operations, write operations, and erase operations to the SSD, and the controller 201 in the solid-state hard disk can return the operation results to the processor 101 . In a solid-state drive, the controller sends operations such as read, write, and erase to the NAND Flash, and the NAND Flash returns the operation results to the controller. Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of a method for reading data through a pause operation provided by an embodiment of the present application. In the application scenario shown in Figure 2, in order to reduce the read delay of the computing device, when the controller of the SSD processes the read operation, if it is determined that the first operation is being performed on the NAND Flash to be accessed by the read operation, the first operation is In the write operation or erase operation performed by the controller 201 on the storage array, the controller waits for the current read operation, first issues a Suspend operation to the NAND Flash, suspends the first operation being performed, and then executes the first operation on the NAND Flash. A read operation is performed on the Flash (issue sequence 1 in Figure 2). For the read operation after the pause operation has been issued, the controller directly sends the read operation to the NAND Flash for execution (distribution sequence 2 in Figure 2). If there is no read operation for a period of time, the controller will issue a resume (Resume) operation to the NAND Flash to resume the execution of the first suspended operation (as shown in the order of delivery 3 in Figure 2).
具体地,当处理器101处理数据指令时,可以向固态硬盘20发送数据的读取命令,通过读取命令指示固态硬盘20根据预设的规则读取该固态硬盘20中存储区域的数据。也可以向固态硬盘20发送数据的写命令,通过写命令指示固态硬盘20根据预设的规则将该数据写入该固态硬盘20中的存储区域。还可以向固态硬盘20发送数据的擦除命令,通过擦除命令指示固态硬盘20根据预设的规则擦除该固态硬盘20中存储区域原有存储的数据,以便写入新的数据。Specifically, when the processor 101 processes a data command, it can send a data read command to the solid state drive 20, and the read command instructs the solid state drive 20 to read the data in the storage area of the solid state drive 20 according to preset rules. It is also possible to send a data write command to the solid state drive 20, and the write command instructs the solid state drive 20 to write the data into a storage area in the solid state drive 20 according to a preset rule. A data erasing command may also be sent to the solid-state hard disk 20, and the erasing command instructs the solid-state hard disk 20 to erase the data originally stored in the storage area of the solid-state hard disk 20 according to preset rules, so as to write new data.
在本申请实施例中,处理器101还可以获取固态硬盘20中的数据信息,以便固态硬盘调整一个第一操作过程中允许插入读操作的最大数量。In this embodiment of the present application, the processor 101 may also acquire data information in the solid-state hard disk 20, so that the solid-state hard disk adjusts the maximum number of allowable insertion and read operations during a first operation.
固态硬盘20中控制器201可以获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前在所述存储阵列(相当于存储器202)中执行的写操作或擦除操作。The controller 201 in the solid state disk 20 can obtain the characteristic value of the SSD, the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is the number of read operations performed by the SSD and the total number of read operations performed by the SSD. The ratio of the number of write operations performed by the SSD, and the pressure value indicates the number of read operations waiting to be performed in the SSD; based on the characteristic value, dynamically adjust the number of allowable insertion read operations in a first operation process, the The first operation is a write or erase operation currently being performed in the storage array (equivalent to memory 202).
可以理解的是,固态硬盘可以配置在不同的设备中,在不同的设备中对应不同主控的形式,本申请实施例对主控的形式不作限定,比如服务器或者计算机等。It can be understood that the solid state hard disk may be configured in different devices, and correspond to different main control forms in different devices. The embodiment of the present application does not limit the main control form, such as a server or a computer.
当前述固态硬盘配置在计算机中(即计算设备10为计算机)中,固态硬盘20通过数据总线与电脑的中央处理器CPU进行数据交互,例如,电脑通过数据总线向固态硬盘20发送写命令,将特定的数据写入固态硬盘。When the aforementioned solid-state hard disk is configured in a computer (that is, the computing device 10 is a computer), the solid-state hard disk 20 performs data interaction with the central processing unit CPU of the computer through a data bus. Specific data is written to the SSD.
当前述固态硬盘配置在服务器(即:计算设备10为服务器,该服务器为整个服务器网络的主服务器,处理服务器网络中所有的事务)中,服务器通过Wi-Fi、移动网络等或者有线连接的方式进行通信并对数据进行处理,例如,服务器通过数据总线向固态硬盘20发送读取命令,固态硬盘接收到读取命令后,控制器让当前读操作等待,先下发暂停操作到该NAND Flash上,暂停正在执行的第一操作,然后在NAND Flash上执行读操作从存储区域中读取数据。其他结构以及功能类似前述提及的电子设备,在配置了固态硬盘之后的具体数据读取场景也适用本申请实施例图示的应用场景,在此不再赘述。When the aforementioned solid-state hard disk is configured in a server (that is, the computing device 10 is a server, the server is the main server of the entire server network, and handles all transactions in the server network), the server is connected through Wi-Fi, mobile network, etc. or wired connection. Communicate and process the data. For example, the server sends a read command to the SSD 20 through the data bus. After the SSD receives the read command, the controller waits for the current read operation, and first issues a pause operation to the NAND Flash. , suspend the first operation being performed, and then perform a read operation on the NAND Flash to read data from the storage area. Other structures and functions are similar to the aforementioned electronic devices, and the specific data reading scenarios after the solid-state hard disk is configured are also applicable to the application scenarios illustrated in the embodiments of the present application, which will not be repeated here.
需要说明的是,本申请实施例中涉及的暂停操作相当于Suspend操作,是用于在一个写操作过程中,暂停该写操作后,插入一定数量的读操作;或者,一个擦除操作过程中,暂停该擦除操作后,插入一定数量的读操作。例如:将暂停操作下发到NAND Flash上,NAND Flash接收到暂停操作后,会暂停正在执行的写或擦除操作(即,第一操作),然后执行读操作。被暂停执行的写或擦除操作要恢复执行,计算设备可以下发恢复操作到NAND Flash上,会恢复执行被暂停执行的写或擦操作。其中,恢复操作相当于Resume操作。It should be noted that the suspend operation involved in the embodiments of the present application is equivalent to the Suspend operation, which is used to insert a certain number of read operations after suspending the write operation during a write operation; or, during an erase operation , after suspending the erase operation, insert a certain number of read operations. For example, the suspend operation is sent to the NAND Flash. After the NAND Flash receives the suspend operation, it will suspend the ongoing write or erase operation (ie, the first operation), and then execute the read operation. To resume the suspended write or erase operation, the computing device can issue the resume operation to the NAND Flash, and the suspended write or erase operation will be resumed. Among them, the restore operation is equivalent to the Resume operation.
结合图1所示的系统架构,本申请实施例还提供了几种涉及Host与SSD交互的SSD中数据读取的相关设备图示,可以应用于图1所示系统架构。With reference to the system architecture shown in FIG. 1 , the embodiments of the present application also provide several related device diagrams of data reading in the SSD involving the interaction between the Host and the SSD, which can be applied to the system architecture shown in FIG. 1 .
请参见图3,图3是本申请实施例提供的一种SSD的逻辑模块示意图;如图3所示,本申请实施例中SSD的内置逻辑模块可以包括:SSD控制器201,也是前述图1所示系统架构SSD中控制器201;以及存储模块202,即可包括闪存NAND Flash阵列,也是前述图1所示系统架构中存储器202;还可以包括接口(Interface)模块203,用于与外部设备通 信。其中,控制器201中包括感知模块2011和反馈控制模块2012。该感知模块2011还可以包括获取读写比例值模块和获取压力值模块。Referring to FIG. 3, FIG. 3 is a schematic diagram of a logic module of an SSD provided by an embodiment of the present application; as shown in FIG. 3, the built-in logic module of the SSD in the embodiment of the present application may include: an SSD controller 201, which is also the aforementioned FIG. 1 The controller 201 in the SSD of the system architecture shown; and the storage module 202, which can include a flash memory NAND Flash array, which is also the memory 202 in the aforementioned system architecture shown in FIG. 1; and an interface module 203 for communicating with external devices communication. The controller 201 includes a sensing module 2011 and a feedback control module 2012 . The sensing module 2011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value.
具体的,控制(controller)模块201,为SSD的控制单元(即控制器);可以理解的是,控制器(或称控制器单元)是SSD设备的大脑,承担SSD读写命令的处理、数据分布管理以及NAND Flash管理等等功能。Specifically, the controller module 201 is the control unit (ie, the controller) of the SSD; it can be understood that the controller (or the controller unit) is the brain of the SSD device, and is responsible for the processing and data processing of the SSD read and write commands. Distribution management and NAND Flash management and other functions.
本申请实施例的控制器中包括感知模块2011和反馈控制模块2012,还可以包括接口(Interface)模块203。其中,该感知模块2011可以用于获取特征值,所述特征值包括读写比例值或压力值中的至少一个。该感知模块2011还可以包括获取读写比例值模块和获取压力值模块。该获取读写比例值模块用于获取SSD的读写比例值;该获取压力值模块用于获取SSD的压力值。例如,获取读写比例值模块可以基于所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值获得读写比例值。获取压力值模块可以基于SSD中等待执行的读操作的数量,获得压力值。如:SSD中等待的读操作数量为10,压力值可以为10,或者是基于预设的映射关系,10个读操作对应的压力值。The controller in this embodiment of the present application includes a perception module 2011 and a feedback control module 2012 , and may also include an interface module 203 . Wherein, the sensing module 2011 can be used to obtain characteristic values, and the characteristic values include at least one of a read-write ratio value or a pressure value. The sensing module 2011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value. The module for obtaining the read-write ratio value is used for obtaining the read-write ratio value of the SSD; the module for obtaining the pressure value is used for obtaining the pressure value of the SSD. For example, the module for obtaining the read-write ratio value may obtain the read-write ratio value based on the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD. The obtaining pressure value module may obtain the pressure value based on the number of read operations waiting to be performed in the SSD. For example, the number of read operations waiting in the SSD is 10, and the pressure value can be 10, or the pressure value corresponding to 10 read operations based on a preset mapping relationship.
反馈控制模块2012可以基于感知模块2011获取到的特征值,如:读写比例值或压力值中的至少一个,动态的调整一个第一操作过程中允许插入读操作的数量。The feedback control module 2012 can dynamically adjust the number of allowable insertion read operations in a first operation process based on the characteristic value obtained by the sensing module 2011 , such as at least one of a read-write ratio value or a pressure value.
还可以包括:接口(Interface)模块203,用以连接Host 10而承担读写命令接收和数据传输的功能。It can also include: an interface (Interface) module 203, which is used to connect to the Host 10 and undertake the functions of read and write command reception and data transmission.
例如:通过如图3所示SSD,可以执行:For example: With the SSD shown in Figure 3, you can execute:
1,获取压力值模块在一定的周期内获取压力值。1. The obtaining pressure value module obtains the pressure value within a certain period.
2,获取读写比例值模块在一定的周期内获取读写比例值。2. Obtain the read-write ratio value The module obtains the read-write ratio value within a certain period.
3,反馈控制模块读取上述压力值和读写比例值。3. The feedback control module reads the above pressure value and read/write ratio value.
4,反馈控制模块通过获取的压力值和读写比例值索引得到暂停操作策略,并基于该暂停操作策略调整一个第一操作过程中允许插入读操作的数量。或者,反馈控制模块通过获取的压力值和读写比例值直接调整一个第一操作过程中允许插入读操作的数量。4. The feedback control module obtains a suspend operation strategy through the obtained pressure value and read/write ratio value index, and adjusts the number of allowable insertion read operations in a first operation process based on the suspend operation strategy. Alternatively, the feedback control module directly adjusts the number of allowable insertion read operations in a first operation process through the obtained pressure value and read/write ratio value.
在一种可能实现的方式中,请参见图4,图4是本申请实施例提供的另一种SSD的逻辑模块示意图。与上述图3所示的SSD不同,图4所示的SSD的控制器201中,感知模块2011包含获取读写比例值模块,不包含获取压力值模块。因此,与上述图3所示执行流程相比,该SSD可以获取读写比例值,而且反馈控制模块可以基于感知模块2011获取到的读写比例值,调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, please refer to FIG. 4 , which is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application. Different from the above-mentioned SSD shown in FIG. 3 , in the controller 201 of the SSD shown in FIG. 4 , the sensing module 2011 includes a module for obtaining read/write ratio value, but does not include a module for obtaining pressure value. Therefore, compared with the execution flow shown in FIG. 3 above, the SSD can obtain the read-write ratio value, and the feedback control module can adjust the read-write ratio value obtained by the sensing module 2011 to allow insertion of read operations in a first operation process. quantity.
在一种可能实现的方式中,请参见图5,图5是本申请实施例提供的又一种SSD的逻辑模块示意图。与上述图3所示的SSD不同,图5所示的SSD的控制器201中,感知模块2011不包含获取读写比例值模块,包含获取压力值模块。因此,与上述图3所示执行流程相比,该SSD可以获取压力值,而且反馈控制模块基于感知模块2011获取到的压力值,调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, please refer to FIG. 5 , which is a schematic diagram of a logic module of another SSD provided by an embodiment of the present application. Different from the above-mentioned SSD shown in FIG. 3 , in the controller 201 of the SSD shown in FIG. 5 , the sensing module 2011 does not include a module for obtaining read/write ratio value, but includes a module for obtaining pressure value. Therefore, compared with the execution flow shown in FIG. 3 above, the SSD can obtain the pressure value, and the feedback control module adjusts the number of allowable insert read operations in a first operation process based on the pressure value obtained by the sensing module 2011 .
在申请本实施例中,SSD中的感知模块和反馈控制模块及其中的各模块可以由硬件(如FPGA、硬件加速单元等)实现,也可以由软件实现。In this embodiment of the application, the sensing module and the feedback control module in the SSD and each module therein may be implemented by hardware (eg, FPGA, hardware acceleration unit, etc.), or may be implemented by software.
本申请实施例对Host、Host包含的处理器以及Host中的其他内容相关描述,可对应参考下述实施例,所以在本申请实施例中不具体描述和标识。For the description of the Host, the processors included in the Host, and other contents in the Host in the embodiments of the present application, reference may be made to the following embodiments, so no specific description and identification are provided in the embodiments of the present application.
结合图1所示的系统架构,本申请实施例还提供了另外几种涉及Host与SSD交互的计算机设备示意图,可以应用于图1所示系统架构,请参见图6,图6是本申请实施例提供的一种计算设备的逻辑模块示意图。如图6所示,本申请实施例中计算设备的内置逻辑模块可以包括:处理器101,也是前述图1所示系统架构计算设备中的处理器101。其中,处理器101中包括:感知模块1011和反馈控制模块1012。该感知模块1011还可以包括获取读写比例值模块和获取压力值模块。与计算设备连接的是固态硬盘SSD,SSD包括:控制器201,也是前述图1所示系统架构SSD以及SSD中的控制器201;以及存储模块202,也是前述图1所示系统架构中存储器202;还可以包括接口(Interface)模块203,可以用于与计算设备通信。In conjunction with the system architecture shown in FIG. 1 , the embodiments of the present application also provide schematic diagrams of several other computer devices involving the interaction between the Host and the SSD, which can be applied to the system architecture shown in FIG. 1 , please refer to FIG. 6 , which is an implementation of the present application The example provides a schematic diagram of a logic module of a computing device. As shown in FIG. 6 , the built-in logic module of the computing device in this embodiment of the present application may include: a processor 101 , which is also the processor 101 in the computing device with the system architecture shown in the foregoing FIG. 1 . The processor 101 includes: a perception module 1011 and a feedback control module 1012 . The sensing module 1011 may further include a module for obtaining read-write ratio value and a module for obtaining pressure value. Connected to the computing device is a solid-state hard disk SSD, and the SSD includes: a controller 201, which is also the controller 201 in the SSD and SSD of the system architecture shown in FIG. 1; and a storage module 202, which is also the memory 202 in the system architecture shown in FIG. 1. ; may also include an interface (Interface) module 203, which may be used to communicate with the computing device.
本申请实施例的处理器101中涉及了感知模块1011,该感知模块1011还可以包括获取读写比例值模块和获取压力值模块。该感知模块1011可以用于获取特征值,所述特征值包括读写比例值或压力值中的至少一个。其中,感知模块1011中获取读写比例值模块用于获取SSD的读写比例值;感知模块1011中获取压力值模块用于获取SSD的压力值。例如,获取读写比例值模块可以基于所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值获得读写比例值。获取压力值模块可以基于SSD中等待执行的读操作的数量,获得压力值。如:SSD中等待的读操作数量为10,压力值可以为10,或者是基于预设的映射关系,10个读操作对应的压力值。The processor 101 in this embodiment of the present application involves a sensing module 1011, and the sensing module 1011 may further include a module for obtaining a read-write ratio value and a module for obtaining a pressure value. The sensing module 1011 may be used to obtain characteristic values, where the characteristic values include at least one of a read-write ratio value or a pressure value. Wherein, the module for obtaining the read-write ratio value in the sensing module 1011 is used to obtain the read-write ratio value of the SSD; the module for obtaining the pressure value in the sensing module 1011 is used to obtain the pressure value of the SSD. For example, the module for obtaining the read-write ratio value may obtain the read-write ratio value based on the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD. The obtaining pressure value module may obtain the pressure value based on the number of read operations waiting to be performed in the SSD. For example, the number of read operations waiting in the SSD is 10, and the pressure value can be 10, or the pressure value corresponding to 10 read operations based on a preset mapping relationship.
反馈控制模块1012可以基于感知模块1011获取到的数据,获取暂停操作策略,并将该暂停操作策略发送至SSD中,使得该SSD基于该暂停操作策略调整一个第一操作过程中允许插入读操作的最大数量。The feedback control module 1012 can obtain the pause operation policy based on the data acquired by the sensing module 1011, and send the pause operation policy to the SSD, so that the SSD adjusts the allowable insertion read operation in a first operation process based on the pause operation policy. maximum quantity.
可选的,反馈控制模块1012还可以基于感知模块1011获取到的特征值,获取暂停操作策略;根据该暂停操作策略生成目标指令并向SSD发送,使得该SSD基于该目标指令调整一个第一操作过程中允许插入读操作的数量。Optionally, the feedback control module 1012 can also obtain a suspension operation strategy based on the characteristic value obtained by the sensing module 1011; generate a target instruction according to the suspension operation strategy and send it to the SSD, so that the SSD adjusts a first operation based on the target instruction. The number of insert read operations allowed in the process.
例如:通过如图6所示计算设备,可以执行:For example, through the computing device shown in Figure 6, it is possible to execute:
1,获取压力值模块在一定的周期内获取压力值。1. The obtaining pressure value module obtains the pressure value within a certain period.
2,获取读写比例值模块在一定的周期内计算读写比例值。2. Obtain the read-write ratio value The module calculates the read-write ratio value within a certain period.
3,反馈控制模块读取压力值和读写比例值。3. The feedback control module reads the pressure value and the read-write proportional value.
4,反馈控制模块通过获取的压力值和读写比例值索引得到暂停操作策略,并将该暂停操作策略发送至SSD中,使得SSD基于该暂停操作策略调整一个第一操作过程中允许插入读操作的数量。4. The feedback control module obtains the suspend operation strategy through the obtained pressure value and the read/write ratio value index, and sends the suspend operation strategy to the SSD, so that the SSD adjusts a first operation process based on the suspend operation strategy to allow insertion of read operations quantity.
在一种可能实现的方式中,与上述图6所示的计算设备不同,该计算设备的处理器101中,感知模块1011包含获取读写比例值模块,不包含获取压力值模块。因此,与上述图6所示的计算设备执行流程相比,该计算设备可以获取读写比例值,而且反馈控制模块可以基于感知模块1011获取到的读写比例值,获取暂停操作策略,并将该暂停操作策略发送至SSD中,使得该SSD可以基于该暂停操作策略调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, different from the computing device shown in FIG. 6 above, in the processor 101 of the computing device, the sensing module 1011 includes a module for obtaining read/write ratio values, but does not include a module for obtaining pressure values. Therefore, compared with the execution flow of the computing device shown in FIG. 6, the computing device can obtain the read-write ratio value, and the feedback control module can obtain the pause operation strategy based on the read-write ratio value obtained by the sensing module 1011, and use the The suspend operation policy is sent to the SSD, so that the SSD can adjust the number of allowable insert read operations in a first operation process based on the suspend operation policy.
在一种可能实现的方式中,与上述图6所示的SSD不同,该计算设备的处理器101中, 感知模块1011不包含获取读写比例值模块,包含获取压力值模块。因此,与上述图6所示的计算设备执行流程相比,该计算设备可以获取压力值。而且反馈控制模块可以基于感知模块1011获取到的压力值,获取暂停操作策略,并将该暂停操作策略发送至SSD中,使得该SSD可以基于该暂停操作策略调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, different from the SSD shown in FIG. 6 above, in the processor 101 of the computing device, the sensing module 1011 does not include a module for obtaining read/write ratio value, but includes a module for obtaining pressure value. Therefore, compared with the above-mentioned execution flow of the computing device shown in FIG. 6 , the computing device can obtain the pressure value. Moreover, the feedback control module can obtain the pause operation strategy based on the pressure value obtained by the sensing module 1011, and send the pause operation strategy to the SSD, so that the SSD can adjust the allowable insertion read during a first operation based on the pause operation strategy. the number of operations.
在一种可能实现的方式中,请参见图7,图7是本申请实施例提供的另一种计算设备的逻辑模块示意图。与上述图6所示的计算设备不同,图7所示计算设备的处理器201中,包含感知模块1011,不包含反馈控制模块。其中,感知模块1011包含获取读写比例值模块和获取压力值模块。而与计算设备连接的SSD的控制器201中包含反馈控制模块2012。因此,与上述图6所示计算设备执行流程相比,该计算设备可以执行:In a possible implementation manner, please refer to FIG. 7 , which is a schematic diagram of a logic module of another computing device provided by an embodiment of the present application. Different from the computing device shown in FIG. 6 above, the processor 201 of the computing device shown in FIG. 7 includes a perception module 1011 and does not include a feedback control module. Wherein, the sensing module 1011 includes a module for obtaining read-write ratio value and a module for obtaining pressure value. The controller 201 of the SSD connected to the computing device includes a feedback control module 2012 . Therefore, compared with the execution flow of the computing device shown in FIG. 6 above, the computing device can execute:
1,获取压力值模块在一定的周期内获取压力值。1. The obtaining pressure value module obtains the pressure value within a certain period.
2,获取读写比例值模块在一定的周期内计算读写比例值。2. Obtain the read-write ratio value The module calculates the read-write ratio value within a certain period.
3,向SSD发送压力值和的读写比例值。3. Send the pressure value and the read/write ratio value to the SSD.
需要说明的是,该计算设备向SSD发送压力值和的读写比例值后,SSD的控制器接收到压力值和读写比例值;进而SSD中的反馈控制模块通过获取到的压力值和读写比例值获取暂停操作策略,并基于该暂停操作策略调整一个第一操作过程中允许插入读操作的最大数量。It should be noted that after the computing device sends the pressure value and the read/write ratio value to the SSD, the controller of the SSD receives the pressure value and the read/write ratio value; and then the feedback control module in the SSD passes the obtained pressure value and read/write ratio value. The write ratio value acquires the pause operation policy, and adjusts the maximum number of insert read operations allowed in a first operation process based on the pause operation policy.
在一种可能实现的方式中,与上述图7所示的计算设备不同,该计算设备的处理器101中,感知模块1011包含获取读写比例值模块,不包含获取压力值模块。因此,与上述图7所示计算设备执行流程相比,该计算设备获取读写比例值,并将获取到的读写比例值发送至SSD中。SSD的控制器接收到读写比例值;进而SSD的反馈控制模块通过获取到的读写比例值获取暂停操作策略,并基于该暂停操作策略调整一个第一操作过程中允许插入读操作的最大数量。In a possible implementation manner, different from the computing device shown in FIG. 7 , in the processor 101 of the computing device, the sensing module 1011 includes a module for obtaining read/write ratio values, but does not include a module for obtaining pressure values. Therefore, compared with the execution flow of the computing device shown in FIG. 7 above, the computing device obtains the read-write ratio value, and sends the obtained read-write ratio value to the SSD. The controller of the SSD receives the read-write ratio value; and then the feedback control module of the SSD obtains the pause operation strategy through the obtained read-write ratio value, and adjusts the maximum number of inserted read operations allowed in a first operation process based on the pause operation strategy .
在一种可能实现的方式中,与上述图7所示的SSD不同,该计算设备的处理器101中,感知模块1011不包含获取读写比例值模块,包含获取压力值模块。因此,与上述图7所示计算设备执行流程相比,该计算设备获取压力值,并将获取到的压力值发送至SSD中。SSD的控制器接收到压力值;进而SSD的反馈控制模块可以通过获取到的压力值获取暂停操作策略,并基于该暂停操作策略调整一个第一操作过程中允许插入读操作的最大数量。In a possible implementation manner, different from the above-mentioned SSD shown in FIG. 7 , in the processor 101 of the computing device, the sensing module 1011 does not include a module for obtaining a read-write ratio value, but includes a module for obtaining a pressure value. Therefore, compared with the above-mentioned execution flow of the computing device shown in FIG. 7 , the computing device acquires the pressure value, and sends the acquired pressure value to the SSD. The controller of the SSD receives the pressure value; further, the feedback control module of the SSD can obtain a suspend operation strategy based on the obtained pressure value, and adjust the maximum number of allowable insert read operations in a first operation process based on the suspend operation strategy.
本申请实施例对SSD、SSD包含的控制器以及SSD中的其他内容相关描述,可对应参考上述实施例和下述方法实施例,所以在本申请实施例中不具体描述和标识。For the description of the SSD, the controller included in the SSD, and other contents in the SSD in the embodiments of the present application, reference may be made to the above-mentioned embodiments and the following method embodiments, so no specific description and identification are provided in the embodiments of the present application.
在本申请实施例中,计算设备中的感知模块和反馈控制模块及其中的各模块可以由硬件(如FPGA、硬件加速单元等)实现,也可以由软件实现。In the embodiments of the present application, the sensing module and the feedback control module in the computing device and each module therein may be implemented by hardware (eg, FPGA, hardware acceleration unit, etc.), or may be implemented by software.
基于上述图1提供的系统架构,以及上述图3提供的固态硬盘的结构,结合本申请中提供的固态硬盘SSD中数据读取的管理方法,对本申请中提出的技术问题进行具体分析和解决。Based on the system architecture provided in FIG. 1 and the structure of the solid-state hard disk provided in FIG. 3 above, combined with the data read management method in the solid-state hard disk SSD provided in this application, the technical problems raised in this application are specifically analyzed and solved.
参见图8,图8是本申请实施例提供的一种应用于固态硬盘SSD的数据读取方法的流程示意图,该方法可应用于上述图1中所述的应用于固态硬盘SSD的数据读取系统架构中,其中的固态硬盘SSD20可以用于支持并执行图8中所示的应用于固态硬盘SSD的数据读取 方法流程步骤S301-步骤S305。下面将结合附图8从固态硬盘中控制器侧进行描述,所述固态硬盘与计算设备相连接。该方法可以包括以下步骤S301-步骤S305。Referring to FIG. 8 , FIG. 8 is a schematic flowchart of a data reading method applied to a solid-state hard disk SSD provided by an embodiment of the present application, and the method can be applied to the data reading applied to the solid-state hard disk SSD described in FIG. 1 . In the system architecture, the solid-state hard disk SSD20 can be used to support and execute the data reading method shown in FIG. The following description will be made from the controller side of the solid-state hard disk with reference to FIG. 8 , and the solid-state hard disk is connected to the computing device. The method may include the following steps S301-S305.
步骤S301:统计SSD执行读操作的数量。Step S301: Count the number of read operations performed by the SSD.
具体地,SSD可以获取SSD执行读操作的数量,以便用于获取SSD的读写比例值。其获取的方式可以是SSD中的控制器直接统计,或者,通过其他与SSD相连接的计数装置或模块统计后获取。其中,读操作是将保存在存储器中的数据读取出来,SSD执行一个读操作时间要小于执行一个写操作的时间,也小于执行一个擦除操作的时间。而且,SSD在执行一次读操作时都可以记录至此为止执行读操作的数量。Specifically, the SSD can obtain the number of read operations performed by the SSD, so as to obtain the read-write ratio value of the SSD. The acquisition method may be direct statistics by the controller in the SSD, or acquired after statistics by other counting devices or modules connected to the SSD. Among them, the read operation is to read out the data stored in the memory, and the time for the SSD to perform a read operation is shorter than the time for performing a write operation, and also shorter than the time for performing an erase operation. Moreover, when an SSD performs a read operation, it can record the number of read operations performed so far.
可选的,SSD执行读操作的数量与所述计算设备生成的读操作数量相对应。即,SSD获取的读写比例值为执行计算设备生成的读操作数量与计算设备生成的写操作数量之间的比值。因此,SSD可以统计该SSD执行第一读操作的第一数量,其中,第一读操作为所述计算设备生成的读操作。由于SSD执行的每个读操作均有一个标记位,该标记位可以用于标识该读操作是计算设备生成,还是SSD中的控制器自己产生。所以,SSD可以根据读操作上的标识,识别出第一读操作,进而可以SSD统计执行第一读操作的第一数量。Optionally, the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device. That is, the read-write ratio value obtained by the SSD is the ratio between the number of read operations generated by the executing computing device and the number of write operations generated by the computing device. Therefore, the SSD may count the first number of first read operations performed by the SSD, where the first read operation is a read operation generated by the computing device. Since each read operation performed by the SSD has a flag bit, the flag bit can be used to identify whether the read operation is generated by the computing device or by the controller in the SSD. Therefore, the SSD can identify the first read operation according to the identifier on the read operation, and then the SSD can count the first number of the first read operation performed.
可选的,SSD可以统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量。其中,第一缓存队列是在SSD中保存有第一读操作和第二读操作的消息队列。Optionally, the SSD may count the first number of the first read operations in the first cache queue performed by the SSD. The first cache queue is a message queue that stores the first read operation and the second read operation in the SSD.
步骤S302:统计SSD执行写操作的数量。Step S302: Count the number of write operations performed by the SSD.
具体的,SSD在获取读写比例值之前需要获取所述SSD执行写操作的数量。其获取的方式也可以是SSD中的控制器直接统计,或者,通过其他与SSD相连接的计数装置或模块统计后获取。其中,SSD执行写操作的时间一般情况下要远大于SSD执行一个读操作的时间。Specifically, the SSD needs to obtain the number of write operations performed by the SSD before obtaining the read-write ratio value. The way of obtaining the data can also be directly counted by the controller in the SSD, or obtained after counting by other counting devices or modules connected to the SSD. Among them, the time for the SSD to perform a write operation is generally much longer than the time for the SSD to perform a read operation.
可选的,SSD执行写操作的数量与所述控制器生成的读操作数量相对应。即,SSD获取所述SSD执行写操作的数量时,可以统计该SSD执行第二读操作的第二数量,其中,第二读操作为所述控制器生成的读操作。由于一般情况下,SSD更新已写入位置的数据时,都会向新位置写入数据,而将原先已写入位置的数据标记为垃圾(无效数据)。当SSD的存储空间写入到一定比例后会触发后台的垃圾回收来释放存储空间(读取有效数据聚合起来搬移到新的存储位置后,擦除原位置的数据),因此在写入新数据时必须有相对应数量的存储空间被释放。所以执行计算设备生成写操作的数量可以和执行控制器自己产生的读操作的数量相对应,因此,在本申请实施例中,可以用控制器生成的读操作来指代执行的写操作的计数。Optionally, the number of write operations performed by the SSD corresponds to the number of read operations generated by the controller. That is, when the SSD obtains the number of write operations performed by the SSD, it may count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller. In general, when the SSD updates the data in the written position, it will write the data to the new position, and mark the data in the original written position as garbage (invalid data). When the storage space of the SSD is written to a certain proportion, it will trigger the background garbage collection to release the storage space (after the valid data is read and moved to the new storage location, the data in the original location is erased). Therefore, when writing new data A corresponding amount of storage space must be freed. Therefore, the number of write operations generated by the executing computing device may correspond to the number of read operations generated by the executing controller itself. Therefore, in this embodiment of the present application, the read operations generated by the controller may be used to refer to the count of the executed write operations. .
需要说明的是,本申请实施例并不限制,执行控制器生成的读操作的数量与执行写操作的数量之间的对应关系。SSD执行写操作的数量可以为执行控制器生成的读操作的数量,例如:直接将执行控制器生成的读操作的数量作为执行写操作的数量。或者,SSD执行写操作的数量与执行控制器生成的读操作的数量的呈线性关系。例如:将执行控制器生成的读操作的数量的10倍作为执行写操作的数量。本申请对此并不作具体的限定。It should be noted that the embodiment of the present application does not limit the corresponding relationship between the number of read operations generated by the execution controller and the number of executed write operations. The number of write operations performed by the SSD may be the number of read operations generated by the execution controller. For example, the number of read operations generated by the execution controller is directly used as the number of write operations. Alternatively, the number of write operations performed by the SSD is linear in the number of read operations generated by the execution controller. For example: 10 times the number of read operations generated by the execution controller is taken as the number of executed write operations. This application does not specifically limit this.
可选的,控制器统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量。其中,第二读操作为所述控制器生成的读操作。第一缓存队列包含有第一读操作和第二读操作。Optionally, the controller counts the second number of the second read operations in the first cache queue performed by the SSD. The second read operation is a read operation generated by the controller. The first buffer queue includes a first read operation and a second read operation.
步骤S303:获取读写比例值。Step S303: Obtain the read/write ratio value.
具体地,SSD获取特征值,所述特征值包括读写比例值,读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值。例如:SSD执行读操作的数量为10,SSD执行写操作的数量为1时,读写比例值为10。可选的,还可以基于预先存储的对应关系,读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量之间比值对应的数值。又例如:SSD执行读操作的数量为10,SSD执行写操作的数量为1时,读写比例值还可以为1/10。Specifically, the SSD obtains a characteristic value, the characteristic value includes a read-write ratio value, and the read-write ratio value is a ratio of the number of read operations performed by the SSD to the number of write operations performed by the SSD. For example, when the number of read operations performed by the SSD is 10 and the number of write operations performed by the SSD is 1, the read-write ratio is 10. Optionally, based on a pre-stored correspondence, the read-write ratio value is a value corresponding to the ratio between the number of read operations performed by the SSD and the number of write operations performed by the SSD. Another example: when the number of read operations performed by the SSD is 10, and the number of write operations performed by the SSD is 1, the read/write ratio value may also be 1/10.
请参考附图9,图9是本申请实施例提供的一种SSD获取读写比例值的流程示意图。如图9所示,SSD中的控制器可以周期性的记录并存储与所述SSD的读写比例值。首先在第一预设周期内,计算读写比例值。其中在计算读写比例值时,控制器处理第一缓存队列中的读操作,第一缓存队列中的读操作包括第一读操作和第二读操作。通过判断这两个计数器的数值,就可以计算读I/O和写I/O的比例关系。计算比值并保存后,可以分别将计数器A和计数器B清零,结束该周期的统计,可以开启下一周期的计算。其中,在控制器里可以包括计数器A和计数器B,计数器A记录的是从计算设备生成的读操作(第一读操作)的数量。计数器B记录的是非计算设备生成的、而是由控制器自己产生的读操作(第二读操作)的数量。需要说明的是,计数器A和计数器B是每执行一个读操作根据相应的策略记一次数,而在第一缓存队列中正在等待的读操作并不统计在内。因此,第一数量和第二数量分别是控制器正在执行或已经执行了的第一读操作和第二读操作。Please refer to FIG. 9 . FIG. 9 is a schematic flowchart of an SSD obtaining a read-write ratio value provided by an embodiment of the present application. As shown in FIG. 9 , the controller in the SSD can periodically record and store the read/write ratio with the SSD. First, in the first preset period, the read-write ratio value is calculated. When calculating the read-write ratio value, the controller processes the read operation in the first buffer queue, and the read operation in the first buffer queue includes the first read operation and the second read operation. By judging the values of these two counters, the proportional relationship between read I/O and write I/O can be calculated. After the ratio is calculated and saved, the counter A and the counter B can be cleared to zero respectively, the statistics of this cycle can be ended, and the calculation of the next cycle can be started. The controller may include a counter A and a counter B, and the counter A records the number of read operations (first read operations) generated from the computing device. The counter B records the number of read operations (second read operations) not generated by the computing device but by the controller itself. It should be noted that the counter A and the counter B are counted every time a read operation is performed according to a corresponding policy, and the read operations waiting in the first cache queue are not counted. Therefore, the first number and the second number are respectively the first read operation and the second read operation that the controller is performing or has performed.
可选的,SSD可以周期性的记录并存储与所述SSD的读写比例值,获取当前时间点最近周期的目标读写比例值。例如:若每10分钟记录一次读写比例值,则在第5个周期内,SSD需要获取到读写比例值时,第四周期统计好的读写比例值就为SSD要获取到的读取比例值。Optionally, the SSD may periodically record and store the read/write ratio value with the SSD, and obtain the target read/write ratio value of the most recent period at the current time point. For example, if the read/write ratio value is recorded every 10 minutes, in the fifth cycle, when the SSD needs to obtain the read/write ratio value, the read/write ratio value calculated in the fourth cycle is the read/write ratio value to be obtained by the SSD scale value.
步骤S304:获取压力值。Step S304: Acquire a pressure value.
具体的,SSD获取特征值,所述特征值包括压力值。其中,所述压力值指示所述SSD中等待执行的读操作的数量。压力值可以直接等于等待执行的读操作的数量。例如:当SSD中等待执行的读操作的数量为10时,压力值可以为10。还可以将SSD中等待执行的读操作的数量划分为多个等级,该多个等级中的每个等级分别对应不同的压力值。例如:将SSD中等待执行的读操作的数量划分为三个等级,其中,等待执行的读操作的数量小于10,对应的压力值为1;等待执行的读操作的数量10-50,对应的压力值为2;等待执行的读操作的数量大于50,对应的压力值为3。还可以基于预先存储的对应关系,压力值为所述SSD中等待执行的读操作的数量对应的值。例如:根据预先存储的对应关系,压力值=等待执行的读操作的数量*k+b,其中,k、b可以为常数。Specifically, the SSD obtains characteristic values, and the characteristic values include pressure values. Wherein, the pressure value indicates the number of read operations waiting to be performed in the SSD. The pressure value can be directly equal to the number of read operations waiting to be performed. For example: when the number of read operations waiting to be performed in the SSD is 10, the pressure value can be 10. The number of read operations waiting to be executed in the SSD may also be divided into multiple levels, and each level in the multiple levels corresponds to a different pressure value. For example: divide the number of read operations waiting to be performed in the SSD into three levels, where the number of read operations waiting to be performed is less than 10, and the corresponding pressure value is 1; the number of read operations waiting to be performed is 10-50, the corresponding The pressure value is 2; the number of read operations waiting to be performed is greater than 50, and the corresponding pressure value is 3. The pressure value may also be a value corresponding to the number of read operations waiting to be performed in the SSD based on a pre-stored correspondence. For example, according to a pre-stored corresponding relationship, pressure value=number of read operations waiting to be performed*k+b, where k and b may be constants.
可选的,SSD获取第二缓存队列中等待所述SSD执行的所述第一读操作的数量。其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。可以理解的是,SSD中等待执行的第一读操作会由第二缓存队列进入到第一缓存队列中执行。SSD获取第二缓存队列中等待所述SSD执行的所述第一读操作的数量即是获取压力值。Optionally, the SSD obtains the number of the first read operations waiting for the SSD to perform in the second cache queue. The first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second read operation does not exist in the second cache queue. It can be understood that the first read operation waiting to be executed in the SSD will be entered into the first cache queue from the second cache queue for execution. The number of the first read operations waiting for the SSD to be executed by the SSD in the second cache queue is the acquisition pressure value.
可选的,SSD可以周期性的记录并存储压力值,获取当前时间点最近周期的目标压力 值。例如:若每15分钟记录一次压力值,则在第5个周期内,SSD需要获取到压力值时,第四周期统计好的压力值就为SSD要获取到的压力值。SSD还可以周期性的记录并存储压力值,SSD获取经过预设规则运算后的目标压力值。以便SSD基于所述目标压力值,动态调整一个第一操作过程中允许插入读操作的数量。需要说明的是,统计读写比例值的周期和统计压力值的周期没有直接的联系。Optionally, the SSD can periodically record and store the pressure value, and obtain the target pressure value of the most recent period at the current time point. For example, if the pressure value is recorded every 15 minutes, in the fifth cycle, when the SSD needs to obtain the pressure value, the calculated pressure value in the fourth cycle is the pressure value to be obtained by the SSD. The SSD can also periodically record and store the pressure value, and the SSD obtains the target pressure value after a preset rule operation. Therefore, based on the target pressure value, the SSD dynamically adjusts the number of allowable insert read operations during a first operation. It should be noted that there is no direct connection between the period of statistical read-write ratio value and the period of statistical pressure value.
例如:在本申请实施例中,目标压力值为包括当前周期在内的前M个周期对应的压力值中,压力值最大的为目标压力值。请参考附图10,图10是本申请实施例提供的一种SSD统计第一读操作和第二读操作的示意图。如图10所示,业务感知装置每个定时周期T2读取一次第二缓存队列中排队的第一读操作的数量Y_i(i为计数器C的计数值,从0开始,表示为第i个周期),Y_i表征第i个周期的第二缓存队列中等待执行的第一读操作的数量,由于单个读操作执行时间很短,会造成一个周期内的Y_i波动性比较大,因此,为了更好地确定SSD中的压力值,可以使用Y_(i-m+1)到Y_i一共最多M(M大于1)个值的最大值Y_max作为目标压力值(M是预设值),如果i小于M,则使用i个业务压力值的最大值作为目标压力值。例如:M=5,5个周期的压力值分别为15、20、17、16、10,则目标压力值为20。若还没有统计到5个周期,只有3个周期的情况下,且3个周期分别对应的压力值为13、15、8时,则目标压力值为15。For example, in the embodiment of the present application, the target pressure value is the target pressure value among the pressure values corresponding to the first M cycles including the current cycle, and the pressure value with the largest pressure value is the target pressure value. Please refer to FIG. 10 . FIG. 10 is a schematic diagram of a first read operation and a second read operation of an SSD according to an embodiment of the present application. As shown in Figure 10, the service sensing device reads the number of first read operations queued in the second buffer queue Y_i (i is the count value of the counter C, starts from 0, and is expressed as the i-th cycle) every timing period T2 ), Y_i represents the number of first read operations waiting to be executed in the second cache queue of the i-th cycle. Since the execution time of a single read operation is very short, the volatility of Y_i in one cycle will be relatively large. Therefore, in order to better To determine the pressure value in the SSD, the maximum value Y_max of a total of M (M is greater than 1) values from Y_(i-m+1) to Y_i can be used as the target pressure value (M is the default value), if i is less than M , the maximum value of the i business pressure values is used as the target pressure value. For example: M=5, the pressure values of 5 cycles are 15, 20, 17, 16, and 10, respectively, and the target pressure value is 20. If 5 cycles have not been counted, but only 3 cycles have been counted, and the pressure values corresponding to the 3 cycles are 13, 15, and 8, the target pressure value is 15.
步骤S305:基于特征值,动态调整一个第一操作过程中允许插入读操作的数量。Step S305: Based on the characteristic value, dynamically adjust the number of allowable insert read operations in a first operation process.
具体的,SSD可以基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量。其中,所述特征值包括读写比例值或压力值中的至少一个,所述第一操作为当前执行的写操作或擦除操作。该特征值可以用于指示SSD中执行读操作的效率大小(如:读写比例值),或者等待执行读操作的压力大小(如压力值)。因此,SSD可以根据读写比例值、或压力值、或读写比例值和压力值,动态调整一个当前执行的写操作或擦除操作过程中允许插入读操作的数量。例如:当所述读写比例值过大时,说明执行读操作的效率高,会频繁打断当前正在执行的第一操作。所以可以在当前允许插入读操作的数量的基础上,降低一个写操作或擦除操作过程中允许插入读操作的数量,以防止读操作频繁打断写操作或擦除操作的执行,以提高系统性能。Specifically, the SSD may dynamically adjust the number of allowable insert read operations in a first operation process based on the characteristic value. Wherein, the characteristic value includes at least one of a read-write ratio value or a pressure value, and the first operation is a currently executed write operation or erase operation. The characteristic value can be used to indicate the efficiency of performing the read operation in the SSD (eg, the read/write ratio value), or the size of the pressure (eg, the pressure value) waiting for the read operation to be performed. Therefore, the SSD can dynamically adjust the number of inserted read operations during a currently executed write operation or erase operation according to the read-write ratio value, or the pressure value, or the read-write ratio value and the pressure value. For example, when the read-write ratio value is too large, it means that the efficiency of executing the read operation is high, and the first operation currently being executed will be frequently interrupted. Therefore, on the basis of the current number of allowable insert read operations, the number of allowable insert read operations during a write operation or erase operation can be reduced to prevent read operations from frequently interrupting the execution of write operations or erase operations, so as to improve system performance. performance.
可选的,所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。其中,第一阈值为第一操作过程中允许插入读操作的最大数量,即,说明在第一操作过程中插入读操作的数量可以小于第一阈值但是不能大于该第一阈值,进而可以调整在一个第一操作过程中允许插入读操作的数量。由于在执行一个第一操作过程中,SSD每打断第一操作并执行一个读操作后,都可以记一次数,以记录到此为止插入的读操作数量。所以在实施本申请实施例时,通过直接配置一个第一操作过程中允许插入读操作的第一阈值后,统计被插入的读操作数量,在达到允许插入的最大数量后,禁止再次插入读操作,以此实现调整读操作数量的目的。通过这种方式可以直观方便的调整允许插入读操作的数量,进而提高了SSD的性能。Optionally, the dynamically adjusting the number of insert read operations allowed in a first operation process based on the characteristic value includes: determining, based on the characteristic value, a first insert read operation allowed in the first operation process. Threshold; according to the first threshold, dynamically adjust the number of allowable insert read operations during a first operation. The first threshold is the maximum number of insert read operations allowed during the first operation, that is, it means that the number of insert read operations during the first operation can be less than the first threshold but not greater than the first threshold, and then can be adjusted in the The number of insert read operations allowed during a first operation. Because in the process of executing a first operation, every time the SSD interrupts the first operation and performs a read operation, it can record the number once to record the number of read operations inserted so far. Therefore, when implementing this embodiment of the present application, after directly configuring a first threshold for allowing insertion of read operations during the first operation, the number of inserted read operations is counted, and after the maximum number of allowable insertions is reached, re-insertion of read operations is prohibited. , in order to achieve the purpose of adjusting the number of read operations. In this way, the number of allowable insert read operations can be adjusted intuitively and conveniently, thereby improving the performance of the SSD.
可选的,所述基于所述特征值,动态调整一个第一操作过程中允许执行读操作的数量,包括:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在 一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。在本申请实施例中,暂停操作用于在一个第一操作过程中,暂停该第一操作,然后在暂停操作使用后在第一操作中插入读操作。因此,本申请实施例可以通过调整暂停操作的约束条件,如:调整暂停操作的使用频率、调整暂停操作的使用数量等,从而动态的调整使用暂停操作后允许插入读操作的数量。Optionally, the dynamically adjusting the number of read operations allowed to be performed in a first operation process based on the characteristic value includes: acquiring, based on the characteristic value, a suspension operation policy corresponding to the characteristic value, and the suspension The operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to insert a read operation in the first operation after suspending the first operation; based on the suspend operation strategy , which dynamically adjusts the number of insert read operations allowed during a first operation. In this embodiment of the present application, the suspend operation is used to suspend the first operation during a first operation, and then insert a read operation into the first operation after the suspend operation is used. Therefore, the embodiments of the present application can dynamically adjust the number of read operations allowed to be inserted after using the pause operation by adjusting the constraints of the pause operation, such as: adjusting the frequency of use of the pause operation, adjusting the number of use of the pause operation, etc.
在一种可能实现的方式中,所述基于所述特征值,获取与所述特征值对应的暂停操作策略,包括:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。在本申请实施例中,获取该暂停操作策略的方式可以是从预先存储的映射表中,直接根据该特征值确定。从预存储的映射关系表中确定暂停操作策略,可以快捷方便的节省计算步骤,大大的缩短了获取到暂停操作策略的时间,同时也提高了调整设置允许插入读操作数量时的效率,进而提高了SSD的性能。例如:请参考下述表1,表1是本申请实施例提供的一种映射关系表,用于基于所述特征值,获取与所述特征值对应的暂停操作策略。其中,该特征值包括读写比例值和压力值。In a possible implementation manner, the obtaining the pause operation policy corresponding to the feature value based on the feature value includes: obtaining, based on the feature value, from a pre-stored mapping table The suspend operation strategy corresponding to the characteristic value, and the mapping relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy. In this embodiment of the present application, the manner of acquiring the suspending operation policy may be determined directly according to the characteristic value from a pre-stored mapping table. Determining the pause operation strategy from the pre-stored mapping table can quickly and conveniently save calculation steps, greatly shorten the time to obtain the pause operation strategy, and improve the efficiency of adjusting the number of inserted read operations allowed by the settings, thereby improving the the performance of the SSD. For example, please refer to Table 1 below. Table 1 is a mapping relationship table provided by an embodiment of the present application, which is used to obtain a pause operation policy corresponding to the characteristic value based on the characteristic value. Wherein, the characteristic value includes a read-write ratio value and a pressure value.
表1:预存储的映射关系表Table 1: Pre-stored mapping table
Figure PCTCN2020119447-appb-000001
Figure PCTCN2020119447-appb-000001
在上述表1中,压力值区间表示,将压力值按照一定的策略分别分成P个区间,每个区间都有其对应的暂停操作策略。同理,读写比例值区间表示,将读写比例值按照一定的策略分别分成Q个区间,每个区间都有其对应的暂停操作策略。其中,暂停操作策略分别表示为:一个写操作过程中控制器可以下发暂停操作的最大数量R1、一个写操作过程中控制器每通过一次暂停操作暂停写操作后能够下发的读操作数量R2、一个写操作过程中控制器可以下发的总的读操作数量R3、一个擦除操作过程中控制器可以下发暂停操作的最大数量R4、一个擦除操作过程中控制器每通过一次暂停操作暂停擦除操作后能够下发的读操作数量R5、一个擦除操作过程中控制器可以下发的总的读操作数量R6。In the above Table 1, the pressure value interval indicates that the pressure value is divided into P intervals according to a certain strategy, and each interval has its corresponding pause operation strategy. Similarly, the read/write ratio value interval indicates that the read/write ratio value is divided into Q intervals according to a certain strategy, and each interval has its corresponding pause operation strategy. Among them, the pause operation strategies are respectively expressed as: the maximum number of pause operations that the controller can issue during a write operation, R1, and the number of read operations that the controller can issue after each pause operation during a write operation. R2 , the total number of read operations that the controller can issue during a write operation, R3, the maximum number of suspend operations that the controller can issue during an erase operation, R4, and each time the controller passes a suspend operation during an erase operation. The number of read operations R5 that can be issued after the erase operation is suspended, and the total number of read operations R6 that can be issued by the controller during an erase operation.
请参考附图11,图11是本申请实施例提供的一种基于预存储的映射关系表中获取暂停操作策略的流程示意图。如图11所示,在预设的周期内,SSD可以获取读写比例值,根据读写比例值确定其所在的区间;SSD还可以获取压力值,根据压力值确定其所在的区间。进而根据上述读写比例值所在的区间和/或压力值所在的区间,确定当前周期所对应的暂停 操作策略。例如:若SSD在获取到的压力值在压力值区间1中,以及SSD获取到的读写比例值在读写比例值区间1时,查表可知,暂停操作策略为R1=8,R2=5,R3=30,R4=8,R5=3,R6=20,因此,在该周期内,一个写操作过程中控制器可以下发暂停操作的最大数量为8、一个写操作过程中控制器每通过一次暂停操作暂停写操作后能够下发的读操作数量为5、一个写操作过程中控制器可以下发的总的读操作数量为30、一个擦除操作过程中控制器可以下发暂停操作的最大数量为8、一个擦除操作过程中控制器每通过一次暂停操作暂停擦除操作后能够下发的读操作数量为3、一个擦除操作过程中控制器可以下发的总的读操作数量为20。Please refer to FIG. 11 . FIG. 11 is a schematic flowchart of obtaining a pause operation policy based on a pre-stored mapping relationship table according to an embodiment of the present application. As shown in Figure 11, in a preset period, the SSD can obtain the read/write ratio value, and determine the interval in which it is located according to the read/write ratio value; the SSD can also obtain the pressure value, and determine the interval in which it is located according to the pressure value. Further, according to the interval where the read/write ratio value is located and/or the interval where the pressure value is located, the pause operation strategy corresponding to the current cycle is determined. For example: if the pressure value obtained by the SSD is in the pressure value range 1, and the read/write ratio value obtained by the SSD is in the read/write ratio value range 1, the table will show that the pause operation strategy is R1=8, R2=5 , R3=30, R4=8, R5=3, R6=20. Therefore, in this cycle, the controller can issue a maximum number of suspend operations during a write operation. The number of read operations that can be issued after a write operation is suspended by one pause operation is 5, the total number of read operations that the controller can issue during a write operation is 30, and the controller can issue a pause operation during an erase operation. The maximum number of read operations is 8. The number of read operations that can be issued by the controller after suspending the erase operation through a pause operation during an erase operation is 3. The total number of read operations that can be issued by the controller during an erase operation. The number is 20.
可以理解的是,当表格中对应暂停操作策略包含R1,R2,R3,R4,R5,R6中一个或多个时,说明该表1对其余的未包含的策略并不做过多的限制,或者,是预先设置好的默认值,本申请实施例对比不作具体的限定。It can be understood that when the corresponding pause operation strategy in the table includes one or more of R1, R2, R3, R4, R5, and R6, it means that the table 1 does not impose too many restrictions on the other strategies that are not included. Alternatively, it is a preset default value, which is not specifically limited in the comparison of the embodiments of the present application.
还可以理解的,本表格1中的数值,以及暂停操作策略数目和种类只是适应性的举例,在具体配置过程中,还需要根据SSD的性能适应性的配置,本申请实施例并不作具体的限定。而且,在R1、R2和R3同时存在的情况下或在R4、R5和R6同时存在的情况下,需要限定一个第一操作过程中控制器可以下发暂停操作的最大数量用于一个第一操作过程中每下发一次暂停操作后能够下发的读操作最大数量的乘积,要大于一个第一操作过程中允许插入的读操作最大数量。即,表1中R1和R2的乘积不小于R3,R4和R5的乘积不小于R6。例如:若SSD在获取到的压力值在压力值区间1中,以及SSD获取到的读写比例值在读写比例值区间Q时,查表可知,R1=4,R2=3,R3=8,R4=3,R5=3,R6=5,其中,均满足R1和R2的乘积大于R3,R4和R5的乘积大于R6。若R1和R2的乘积小于R3或者R4和R5的乘积小于R6,此时再限定R3或者R6是没有意义的。It can also be understood that the values in Table 1 and the number and types of suspend operation policies are only examples of adaptability. In the specific configuration process, it is also necessary to adapt the configuration according to the performance of the SSD, which is not specified in the embodiments of this application. limited. Moreover, when R1, R2, and R3 exist at the same time, or when R4, R5, and R6 exist at the same time, it is necessary to limit the maximum number of pause operations that the controller can issue during a first operation for one first operation. In the process, the product of the maximum number of read operations that can be issued after each pause operation is issued is greater than the maximum number of read operations that can be inserted during a first operation. That is, the product of R1 and R2 in Table 1 is not less than R3, and the product of R4 and R5 is not less than R6. For example: if the pressure value obtained by the SSD is in the pressure value range 1, and the read-write ratio value obtained by the SSD is in the read-write ratio value range Q, look up the table and we can see that R1=4, R2=3, R3=8 , R4=3, R5=3, R6=5, wherein, the product of R1 and R2 is greater than R3, and the product of R4 and R5 is greater than R6. If the product of R1 and R2 is less than R3 or the product of R4 and R5 is less than R6, it is meaningless to limit R3 or R6 at this time.
需要说明的是,该预存储的映射关系表中,关于压力值区间和读写比例值区间的划分方式、划分数量均可不相同。It should be noted that, in the pre-stored mapping relationship table, the division methods and division quantities of the pressure value interval and the read/write ratio value interval may be different.
还需要说明的是,上述表1只是本申请提供的其中一种映射方式,本申请实施例还可以包括其他分类方式,例如:预存储的映射表可以包括将特征值进行相关运算后获得的目标数值,以及目标数值对应的暂停操作策略。预存储的映射表中还包括的读写比例值、或压力值、或读写比例值和压力值分别对应的暂停操作策略,本申请对此不作具体的限定。It should also be noted that the above Table 1 is only one of the mapping methods provided by the present application, and the embodiments of the present application may also include other classification methods. For example, the pre-stored mapping table may include the target obtained by performing correlation operations on the eigenvalues. value, and the pause operation strategy corresponding to the target value. The pre-stored mapping table also includes the read/write ratio value, or the pressure value, or the pause operation strategy corresponding to the read/write ratio value and the pressure value, which is not specifically limited in this application.
可选的,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。其中,所述第二阈值为一个第一操作过程中允许发送所述暂停操作的最大数量,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作。在一个第一操作过程中,本申请实施例通过直接限制暂停操作使用的最大数量,即,通过限制打断一个第一操作执行的次数,进而可以限制允许插入读操作最大数量,从而提高了SSD的性能。例如:限制允许发送所述暂停操作的最大数量,就不会频繁暂停正在执行的写操作或者擦除操作以执行读操作,因为这时性能(每秒读写次数(Input/Output Operations Per Second,IOPS))主要的瓶颈是写IOPS,所以减小阈值,就能够减少对写操作的打断,SSD的IOPS性能就会较高。Optionally, the suspension operation policy is a second threshold for allowing the suspension operation to be sent during the first operation. Wherein, the second threshold is the maximum number of the suspend operations allowed to be sent during a first operation, and the suspend operation is used to insert a read operation in the first operation after suspending the first operation. During a first operation, the embodiment of the present application directly limits the maximum number of suspend operations used, that is, by limiting the number of times that a first operation is interrupted, thereby limiting the maximum number of allowable insert read operations, thereby improving the SSD performance. performance. For example, by limiting the maximum number of suspended operations allowed to be sent, the ongoing write operation or erase operation will not be suspended frequently to perform read operations, because performance (Input/Output Operations Per Second, IOPS)) The main bottleneck is write IOPS, so reducing the threshold can reduce the interruption of write operations, and the IOPS performance of SSD will be higher.
可选的,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。其中,所述第三阈值为一个第一操作过程中,每发送一次所述暂 停操作后允许插入读操作的最大数量,即,每发送一次所述暂停操作后允许插入读操作的数量上限。本申请实施例通过配置发送一次所述暂停操作后允许插入读操作的最大数量,从而控制一个第一操作过程中允许发送所述暂停操作的最大数量。即通过控制每下发一次暂停操作,控制插入的读操作最大数量,进而控制暂停一次的读操作总的执行时间,进而减少每次暂停操作对第一操作打断的时间,从而提高SSD的性能。Optionally, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation in a first operation process. Wherein, the third threshold is the maximum number of read operations allowed to be inserted after each transmission of the pause operation in a first operation process, that is, the upper limit of the number of read operations allowed to be inserted after each transmission of the pause operation. In this embodiment of the present application, by configuring the maximum number of read operations allowed to be inserted after the pause operation is sent once, the maximum number of the pause operations allowed to be sent during a first operation is controlled. That is, by controlling each suspend operation, the maximum number of inserted read operations is controlled, and then the total execution time of the read operation suspended once is controlled, thereby reducing the time that each suspend operation interrupts the first operation, thereby improving the performance of the SSD. .
可选的,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。例如,可对应参考上述表1中所涉及的暂停操作策略。在读写比例值越大情况下,说明执行读操作的占比越高,因此,这时SSD的IOPS性能主要的瓶颈是写IOPS,此时允许插入读操作的第一阈值设置较小的阈值,那么不会有过多的读操作频繁打断写操作的执行。所以减小插入读操作的第一阈值,可以能够减少对写操作的打断,从而提高SSD的性能。Optionally, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value. For example, the suspend operation strategy involved in Table 1 above can be referred to accordingly. The larger the read-write ratio, the higher the proportion of read operations. Therefore, at this time, the main bottleneck of SSD IOPS performance is write IOPS. At this time, the first threshold for allowing insert read operations is set to a smaller threshold. , then there will not be too many read operations frequently interrupting the execution of write operations. Therefore, reducing the first threshold of the insert read operation can reduce the interruption of the write operation, thereby improving the performance of the SSD.
可选的,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。例如,可对应参考上述表1中所涉及的暂停操作策略。压力值越大,说明等待执行的读操作数量越多。此时,需要降低允许插入读操作的第一阈值,防止过多的读操作会打扰写操作的执行。如果压力值较小,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的第一阈值的阈值,允许读操作尽可能多的打断写操作或擦除操作,让读操作尽快执行完成。Optionally, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value. For example, the suspend operation strategy involved in Table 1 above can be referred to accordingly. The higher the pressure value, the higher the number of read operations waiting to be performed. At this time, it is necessary to lower the first threshold for allowing insert read operations to prevent excessive read operations from disturbing the execution of write operations. If the pressure value is small, it means that the read delay of the read operation is more focused on the computing device. At this time, a larger threshold value that allows the first threshold of the suspended operation to be sent should be configured to allow the read operation to interrupt the write as much as possible. operation or erase operation, let the read operation complete as soon as possible.
可选的,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。在本申请实施例中,同时获取到读写比例值和压力值的情况下,若压力值大于第一压力值(如:压力值足够大),此时若想快速提高NAND Flash执行读、写和擦除操作的效率,还需要根据SSD执行的读写比例值,适应性的降低允许插入读操作的第一阈值,减少读操作对第一操作的打断,以便提高SSD的IOPS性能。如果压力值小于第一压力值(压力值足够小),说明此时正在等待的读操作数量不多,计算设备上更专注读操作的读延时,这时可以配置一个较大的允许插入读操作的第一阈值,允许读操作尽可能多的打断第一操作,让读操作尽快执行完成。Optionally, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the first threshold value that allows insertion of a read operation during the one first operation process Inversely proportional to the read/write ratio value, if the pressure value is smaller than the first pressure value, the first threshold value that allows insert read operations in the one first operation process is inversely proportional to the pressure value. In the embodiment of the present application, when the read/write ratio value and the pressure value are obtained at the same time, if the pressure value is greater than the first pressure value (for example, the pressure value is large enough), if you want to quickly increase the NAND Flash to perform read and write In order to improve the IOPS performance of the SSD, it is also necessary to adaptively lower the first threshold for allowing insertion and read operations to reduce the interruption of the first operation by the read operation according to the read-write ratio value performed by the SSD. If the pressure value is less than the first pressure value (the pressure value is small enough), it means that there are not many read operations waiting at this time, and the calculation device is more focused on the read delay of read operations. The first threshold of the operation, allowing the read operation to interrupt the first operation as much as possible, so that the read operation can be executed as soon as possible.
可选的,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。例如,可对应参考上述表1中所涉及的暂停操作策略。在读写比例值越大情况下,说明执行读操作的占比越高,因此,这时SSD的IOPS性能主要的瓶颈是写IOPS,此时允许发送暂停操作的第二阈值设置较小的阈值,那么读操作就不会频繁打断第一操作的执行。所以减小阈值,就能够减少对写操作的打断,IOPS性能就会较高。例如,当许发送暂停操作的第二阈值设置为0时,读操作就不会打扰第一操作的进行,此时专注与写操作,反之,读操作和写操作的比例关系比值越小,说明写操作的占比越高,此时SSD的性能更依赖于读操作的执行,所以将允许发送暂停操作的第二阈值设置较大的阈值,那么读操作就可以频繁打断第一操作的执行,就能够让读操作更快的执行,SSD的性能就会较高。Optionally, when the characteristic value includes the read-write ratio value, a second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value. For example, the suspend operation strategy involved in Table 1 above can be referred to accordingly. The larger the read-write ratio, the higher the proportion of read operations. Therefore, at this time, the main bottleneck of SSD IOPS performance is write IOPS. At this time, the second threshold that allows sending pause operations is set to a smaller threshold. , then the read operation will not frequently interrupt the execution of the first operation. Therefore, reducing the threshold can reduce the interruption of write operations, and the IOPS performance will be higher. For example, when the second threshold of the allow-transmission suspension operation is set to 0, the read operation will not disturb the first operation. At this time, the focus is on the write operation. On the contrary, the ratio of the read operation to the write operation is smaller, indicating that The higher the proportion of write operations, the performance of the SSD is more dependent on the execution of read operations. Therefore, a larger threshold is set for the second threshold that allows sending pause operations, so that read operations can frequently interrupt the execution of the first operation. , the read operation can be performed faster, and the performance of the SSD will be higher.
可选的,当所述特征值包括所述压力值时,所述一个第一操作过程中允许发送所述暂 停操作的第二阈值与所述压力值成反比。例如,可对应参考上述表1中所涉及的暂停操作策略。压力值越大,说明计算设备上更关注IOPS性能,因此在压力值较大的时候,发送所述暂停操作的第二阈值可以相应的减小。如果压力值较小,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的第二阈值,允许读操作尽可能多的打断第一操作,让读操作尽快执行完成。Optionally, when the characteristic value includes the pressure value, a second threshold value that allows sending of the pause operation during the one first operation process is inversely proportional to the pressure value. For example, the suspend operation strategy involved in Table 1 above can be referred to accordingly. A larger pressure value indicates that the computing device pays more attention to IOPS performance. Therefore, when the pressure value is larger, the second threshold for sending the suspend operation can be correspondingly reduced. If the pressure value is small, it means that the read delay of the read operation is more focused on the computing device. At this time, a larger second threshold value that allows the suspension operation to be sent should be configured to allow the read operation to interrupt the first operation as much as possible. , so that the read operation is executed as soon as possible.
可选的,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。在本申请实施例中,如果压力值大于第二压力值,说明计算设备上更关注SSD的IOPS性能,因此在压力值较大的时候按照SSD上读I/O和写I/O的比例来配置允许发送所述暂停操作的第二阈值。如果压力值小于所述第二压力值,说明计算设备上更专注读操作的读延时,这时应该配置一个较大的允许发送所述暂停操作的第二阈值,允许读操作尽可能多的打断第一操作,让读操作尽快执行完成。Optionally, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process of the first operation is allowed to send the second information of the pause operation. The second threshold value is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value that allows sending the pause operation during the first operation is inversely proportional to the pressure value . In the embodiment of the present application, if the pressure value is greater than the second pressure value, it means that the computing device pays more attention to the IOPS performance of the SSD. Therefore, when the pressure value is high, the ratio of read I/O to write I/O on the SSD is calculated. Configure a second threshold at which the pause operation is allowed to be sent. If the pressure value is less than the second pressure value, it means that the computing device is more focused on the read delay of the read operation. At this time, a larger second threshold value that allows the suspension operation to be sent should be configured to allow as many read operations as possible. Interrupt the first operation and let the read operation complete as soon as possible.
需要说明的是,在本申请实施例中,第一压力值和第二压力值的大小之间没有特殊联系。例如:第一压力值和第二压力值可以相同,也可以不同;第一压力值可以大于第二压力值,也可以小于第二压力值。上述两个压力值,用户可以根据SSD的实际性能具体设置,本申请实施例对此不作具体的限定。It should be noted that, in the embodiment of the present application, there is no special relationship between the magnitudes of the first pressure value and the second pressure value. For example, the first pressure value and the second pressure value may be the same or different; the first pressure value may be greater than or smaller than the second pressure value. The above two pressure values can be specifically set by the user according to the actual performance of the SSD, which is not specifically limited in this embodiment of the present application.
在本申请实施例中,可以首先获取SSD的特征值,该特征值包括读写比例值或压力值中的至少一个。由于读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值用于指示所述SSD中等待执行的读操作的数量。所以,通过获取的特征值,可以确定SSD当前执行读、写或擦除操作的效率和压力。若效率较低,压力较大,可以根据获取到的读写比例值或压力值中的至少一个,动态调整一个第一操作过程中允许插入读操作的数量,以提升NAND Flash执行读、写和擦除操作的效率,进而提高SSD的性能。In this embodiment of the present application, a characteristic value of the SSD may be obtained first, where the characteristic value includes at least one of a read-write ratio value or a pressure value. Since the read-write ratio value is the ratio of the number of read operations performed by the SSD and the number of write operations performed by the SSD, the pressure value is used to indicate the number of read operations waiting to be performed in the SSD. Therefore, through the acquired characteristic values, the current efficiency and pressure of the SSD to perform read, write or erase operations can be determined. If the efficiency is low and the pressure is high, according to at least one of the read-write ratio value or the pressure value obtained, the number of inserting read operations allowed in a first operation can be dynamically adjusted to improve the performance of read, write and read operations of NAND Flash. Efficiency of erase operations, which in turn improves the performance of SSDs.
需要说明的是,本申请实施例中的方法实现在上述图3-图5所述的固态硬盘,以及图6、图7所示的计算设备中同样适用,其具体实施方式还可以对应参考上述图8所示的方法实施例,本申请实施例在此不再赘述。It should be noted that the methods in the embodiments of the present application are also applicable to the solid-state hard disks described in FIGS. 3 to 5 and the computing devices shown in FIGS. 6 and 7 , and the specific implementation methods can also refer to the above The method embodiment shown in FIG. 8 is not repeated in this embodiment of the present application.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的相关装置。The methods of the embodiments of the present application are described in detail above, and the related apparatuses of the embodiments of the present application are provided below.
请参见图12,图12是本申请实施例提供的一种应用于固态硬盘SSD的数据读取装置的结构示意图,该数据读取装置10可以包括获取单元401和调整单元402,其中,各个单元的详细描述如下。Please refer to FIG. 12 . FIG. 12 is a schematic structural diagram of a data reading device applied to a solid-state drive (SSD) provided by an embodiment of the present application. The data reading device 10 may include an acquisition unit 401 and an adjustment unit 402 , wherein each unit is The detailed description is as follows.
获取单元401,用于获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;The obtaining unit 401 is configured to obtain a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is the number of read operations performed by the SSD and the SSD. A ratio of the number of write operations performed, the pressure value indicating the number of read operations waiting to be performed in the SSD;
调整单元402,用于基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前执行的写操作或擦除操作。The adjustment unit 402 is configured to dynamically adjust the number of allowable insert read operations in a first operation process based on the characteristic value, where the first operation is a currently executed write operation or an erase operation.
在一种可能实现的方式中,所述调整单元402具体用于:基于所述特征值,确定所述 第一操作过程中允许插入读操作的第一阈值;根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the adjusting unit 402 is specifically configured to: determine, based on the characteristic value, a first threshold that allows an insert read operation during the first operation; and dynamically adjust according to the first threshold The number of insert read operations allowed during a first operation.
在一种可能实现的方式中,所述调整单元402具体用于:基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the adjustment unit 402 is specifically configured to: based on the characteristic value, obtain a suspension operation strategy corresponding to the characteristic value, where the suspension operation strategy is to send in a first operation process Constraints of a Suspend operation, which is used to insert a read operation in the first operation after suspending the first operation; dynamically adjust the allowable insertion during a first operation based on the suspension operation strategy The number of read operations.
在一种可能实现的方式中,所述调整单元402具体用于:基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。In a possible implementation manner, the adjusting unit 402 is specifically configured to: based on the characteristic value, obtain the pause operation policy corresponding to the characteristic value from a pre-stored mapping relationship table, and the mapping The relationship table includes the corresponding relationship between the characteristic value and the suspension operation strategy.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。In a possible implementation manner, the suspending operation policy is a second threshold that allows sending of the suspending operation during a first operation.
在一种可能实现的方式中,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。In a possible implementation manner, the suspend operation strategy is a third threshold for allowing insertion of a read operation after each sending of the suspend operation during a first operation.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, a first threshold value that allows insert read operations in the one first operation process is inversely proportional to the read-write ratio value.
在一种可能实现的方式中,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比,若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read/write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process is allowed to insert read/write The first threshold value of the operation is inversely proportional to the read-write ratio value, and if the pressure value is smaller than the first pressure value, the first threshold value that allows inserting read operations during the one first operation process is inversely proportional to the pressure value. inversely proportional.
在一种可能实现的方式中,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation during the one first operation is inversely proportional to the read-write ratio value .
在一种可能实现的方式中,当所述特征值包括所述压力值的情况下,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the pressure value, a second threshold value that allows the sending of the pause operation during the one first operation process is inversely proportional to the pressure value.
在一种可能实现的方式中,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。In a possible implementation manner, when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process allows sending all the The second threshold value of the pause operation is inversely proportional to the read/write ratio value; if the pressure value is less than the second pressure value, the second threshold value of the pause operation is allowed to be sent during the first operation and all The pressure value is inversely proportional.
在一种可能实现的方式中,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;所述获取单元401具体用于:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。In a possible implementation manner, the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the number of write operations performed by the SSD is related to the control The characteristic value includes the read-write ratio value; the obtaining unit 401 is specifically configured to: count the first number of first read operations performed by the SSD, and the first read operation A read operation generated for the computing device; count the second number of second read operations performed by the SSD, where the second read operation is a read operation generated by the controller; The ratio of the two numbers is used as the read-write ratio of the SSD.
在一种可能实现的方式中,所述获取单元401还具体用于:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;所述获取单元401还具体用于:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;所述压力值指示第二缓存队 列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。In a possible implementation manner, the acquiring unit 401 is further specifically configured to: count the first number of the first read operations in the first cache queue executed by the SSD; the acquiring unit 401 is further specifically configured to: Used to: count the second number of the second read operations in the first cache queue executed by the SSD; the pressure value indicates the first read in the second cache queue waiting for the SSD to execute The number of operations, wherein the first read operation in the first cache queue is entered into the first cache queue from the second cache queue, and the second cache queue does not exist in the second cache queue read operation.
在一种可能实现的方式中,所述获取单元401具体用于:周期性的记录并存储与所述SSD的特征值;获取当前时间点最近周期的目标特征值;所述调整单元402,具体用于基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。In a possible implementation manner, the acquiring unit 401 is specifically configured to: periodically record and store the characteristic value of the SSD; acquire the target characteristic value of the most recent period at the current time point; the adjusting unit 402, specifically for dynamically adjusting the number of allowable insert read operations in a first operation process based on the target characteristic value.
需要说明的是,本申请实施例中所描述的固态硬盘SSD中数据读取的管理装置10中各功能单元的功能可参见上述图8中所述的方法实施例中步骤S301-步骤S305的相关描述,此处不再赘述。It should be noted that, for the functions of each functional unit in the management device 10 for data reading in the solid-state hard disk SSD described in the embodiment of the present application, reference may be made to the correlation of steps S301 to S305 in the method embodiment described in FIG. 8 above. description, which will not be repeated here.
本申请实施例还提供了一种控制器,所述控制器包括处理组件、存储组件和通信接口,所述处理组件通过所述通信接口读取所述存储组件上存储的指令,用于执行上述各实施例中任一实施例中涉及固态硬盘SSD中数据读取的管理方法和功能。An embodiment of the present application further provides a controller, where the controller includes a processing component, a storage component, and a communication interface, and the processing component reads an instruction stored on the storage component through the communication interface, so as to execute the above-mentioned Any one of the embodiments relates to a management method and function for data read in a solid-state disk SSD.
本申请实施例还提供了一种包含指令的计算机程序产品,其在计算机上运行时,使得计算机执行上述各实施例中任一实施例中涉及固态硬盘SSD中数据读取的管理方法和功能。Embodiments of the present application also provide a computer program product including instructions, which, when running on a computer, enables the computer to execute the management method and function of data reading in a solid-state hard disk in any of the foregoing embodiments.
本申请实施例提供一种计算机存储介质,用于储存为上述第二方面提供的一种固态硬盘SSD所用的计算机软件指令,其包含用于执行上述第一方面所涉及的程序。An embodiment of the present application provides a computer storage medium for storing computer software instructions used for the solid-state hard disk SSD provided in the second aspect, including a program for executing the program involved in the first aspect.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可能可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者 说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以为个人计算机、服务端或者网络设备等,具体可以是计算机设备中的处理器)执行本申请各个实施例上述方法的全部或部分步骤。其中,而前述的存储介质可包括:U盘、移动硬盘、磁碟、光盘、只读存储器(Read-Only Memory,缩写:ROM)或者随机存取存储器(Random Access Memory,缩写:RAM)等各种可以存储程序代码的介质。If the above-mentioned integrated units are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device) to execute all or part of the steps of the above methods in various embodiments of the present application. Wherein, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, Read-Only Memory (Read-Only Memory, abbreviation: ROM) or Random Access Memory (Random Access Memory, abbreviation: RAM), etc. A medium that can store program code.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the present application.

Claims (35)

  1. 一种应用于固态硬盘SSD的数据读取方法,其特征在于,包括:A data reading method applied to a solid-state hard disk (SSD), characterized in that it includes:
    获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;Acquire a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is equal to the number of read operations performed by the SSD and the number of write operations performed by the SSD. a ratio, the pressure value indicates the number of read operations waiting to be performed in the SSD;
    基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前执行的写操作或擦除操作。Based on the characteristic value, dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is a currently executed write operation or an erase operation.
  2. 根据权利要求1所述方法,其特征在于,所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:The method according to claim 1, wherein the dynamically adjusting the number of allowable insert read operations in a first operation process based on the characteristic value comprises:
    基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;determining, based on the characteristic value, a first threshold for allowing an insert read operation during the first operation;
    根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。According to the first threshold, the number of allowable insert read operations during a first operation is dynamically adjusted.
  3. 根据权利要求1所述方法,其特征在于,所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:The method according to claim 1, wherein the dynamically adjusting the number of allowable insert read operations in a first operation process based on the characteristic value comprises:
    基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在所述第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;Based on the feature value, a suspend operation strategy corresponding to the feature value is obtained, where the suspend operation strategy is a constraint condition for sending a suspend (Suspend) operation in the first operation process, and the suspend operation is used to suspend all inserting a read operation in the first operation after the first operation;
    基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。Based on the suspend operation policy, dynamically adjust the number of allowable insert read operations in a first operation process.
  4. 根据权利要求3所述方法,其特征在于,所述基于所述特征值,获取与所述特征值对应的暂停操作策略,包括:The method according to claim 3, characterized in that, the obtaining a pause operation strategy corresponding to the characteristic value based on the characteristic value comprises:
    基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。Based on the feature value, the pause operation strategy corresponding to the feature value is acquired from a pre-stored mapping relationship table, where the mapping relationship table includes a correspondence between the feature value and the pause operation strategy .
  5. 根据权利要求3或4所述方法,其特征在于,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。The method according to claim 3 or 4, wherein the suspending operation strategy is a second threshold for allowing the suspending operation to be sent during a first operation.
  6. 根据权利要求3或4所述方法,其特征在于,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。The method according to claim 3 or 4, wherein the pause operation strategy is a third threshold for allowing insertion of a read operation after each transmission of the pause operation in a first operation process.
  7. 根据权利要求2所述方法,其特征在于,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。The method according to claim 2, characterized in that, when the characteristic value includes the read-write ratio value, a first threshold for allowing insert read operations in the one first operation process is proportional to the read-write ratio value. inversely proportional.
  8. 根据权利要求2所述方法,其特征在于,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。3. The method according to claim 2, wherein when the characteristic value includes the pressure value, a first threshold value allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  9. 根据权利要求2所述方法,其特征在于,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比;若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。The method according to claim 2, wherein when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the one first operation process The first threshold value that allows insert read operations is inversely proportional to the read-write ratio value; if the pressure value is less than the first pressure value, the first threshold value that allows insert read operations during the one first operation is inversely proportional to the read/write ratio value. The pressure value is inversely proportional.
  10. 根据权利要求5所述方法,其特征在于,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。The method according to claim 5, characterized in that, when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the pause operation and the read-write ratio during the one first operation process value is inversely proportional.
  11. 根据权利要求5所述方法,其特征在于,当所述特征值包括所述压力值的时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。The method according to claim 5, characterized in that, when the characteristic value includes the pressure value, the second threshold for allowing the sending of the pause operation in the first operation process is inversely proportional to the pressure value .
  12. 根据权利要求5所述方法,其特征在于,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。The method according to claim 5, wherein when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process The second threshold value that allows sending of the pause operation is inversely proportional to the read-write ratio value; if the pressure value is less than the second pressure value, the second threshold value that allows sending the pause operation during the first operation The threshold is inversely proportional to the pressure value.
  13. 根据权利要求1-12所述的任意一项方法,其特征在于,所述SSD包括控制器,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;The method according to any one of claims 1-12, wherein the SSD comprises a controller, and the SSD is connected to a computing device; the number of read operations performed by the SSD is related to the read operations generated by the computing device The number corresponds to the number of write operations performed by the SSD and the number of read operations generated by the controller; the characteristic value includes the read-write ratio value;
    所述获取所述SSD的特征值包括:The acquiring the characteristic value of the SSD includes:
    统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;Counting the first number of first read operations performed by the SSD, where the first read operations are read operations generated by the computing device;
    统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;Counting a second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller;
    将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。The ratio of the first quantity to the second quantity is used as the read/write ratio value of the SSD.
  14. 根据权利要求13所述方法,其特征在于,所述统计所述SSD执行第一读操作的第一数量包括:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;The method according to claim 13, wherein the counting the first number of the first read operations performed by the SSD comprises: counting the number of the first read operations performed by the SSD in the first cache queue. a quantity;
    所述统计所述SSD执行第二读操作的第二数量包括:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;The counting the second number of second read operations performed by the SSD includes: counting the second number of the second read operations in the first cache queue performed by the SSD;
    所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。The pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, wherein the first read operation in the first cache queue is entered by the second cache queue to all of the SSDs. the first cache queue, and the second read operation does not exist in the second cache queue.
  15. 根据权利要求1-14所述的任意一项方法,其特征在于,所述获取所述SSD的特征值,包括:The method according to any one of claims 1-14, wherein the acquiring the characteristic value of the SSD comprises:
    周期性的记录并存储与所述SSD的特征值;Periodically record and store the characteristic values of the SSD;
    获取当前时间点最近周期的目标特征值;Get the target feature value of the most recent period at the current time point;
    所述基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,包括:The dynamic adjustment of the number of allowable insert read operations in a first operation process based on the characteristic value includes:
    基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。Based on the target characteristic value, dynamically adjust the number of allowable insert read operations during a first operation.
  16. 一种固态硬盘SSD,其特征在于,包括:控制器和存储阵列;A solid-state hard disk (SSD), comprising: a controller and a storage array;
    所述控制器耦合至所述存储阵列,用于:The controller is coupled to the storage array for:
    获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;Acquire a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is equal to the number of read operations performed by the SSD and the number of write operations performed by the SSD. a ratio, the pressure value indicates the number of read operations waiting to be performed in the SSD;
    基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前所述控制器对所述存储阵列进行的写操作或擦除操作。Based on the characteristic value, dynamically adjust the number of inserting read operations during a first operation, where the first operation is a write operation or an erase operation currently performed by the controller on the storage array.
  17. 根据权利要求16所述SSD,其特征在于,所述控制器具体用于:The SSD according to claim 16, wherein the controller is specifically configured to:
    基于所述特征值,确定所述第一操作过程中允许插入读操作的第一阈值;determining, based on the characteristic value, a first threshold for allowing an insert read operation during the first operation;
    根据所述第一阈值,动态调整在一个第一操作过程中允许插入读操作的数量。According to the first threshold, the number of allowable insert read operations during a first operation is dynamically adjusted.
  18. 根据权利要求16所述SSD,其特征在于,所述控制器具体用于:The SSD according to claim 16, wherein the controller is specifically configured to:
    基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;Based on the feature value, a suspend operation strategy corresponding to the feature value is obtained, where the suspend operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to suspend the suspend operation. inserting a read operation in the first operation after the first operation;
    基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。Based on the suspend operation policy, dynamically adjust the number of allowable insert read operations in a first operation process.
  19. 根据权利要求18所述SSD,其特征在于,所述控制器具体用于:The SSD according to claim 18, wherein the controller is specifically configured to:
    基于所述特征值,从预存储的映射关系表中,获取与所述特征值对应的所述暂停操作策略,所述映射关系表包括所述特征值与所述暂停操作策略之间的对应关系。Based on the feature value, the pause operation strategy corresponding to the feature value is obtained from a pre-stored mapping relationship table, where the mapping relationship table includes a correspondence between the feature value and the pause operation strategy .
  20. 根据权利要求18或19所述SSD,其特征在于,所述暂停操作策略为一个第一操作过程中允许发送所述暂停操作的第二阈值。The SSD according to claim 18 or 19, wherein the suspend operation policy is a second threshold for allowing the suspend operation to be sent during a first operation.
  21. 根据权利要求18或19所述SSD,其特征在于,所述暂停操作策略为一个第一操作过程中,每发送一次所述暂停操作后允许插入读操作的第三阈值。The SSD according to claim 18 or 19, wherein the suspend operation strategy is a third threshold for allowing an insert read operation after each sending of the suspend operation during a first operation.
  22. 根据权利要求17所述SSD,其特征在于,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比。The SSD according to claim 17, wherein when the characteristic value includes the read-write ratio value, a first threshold for allowing insert read operations in the one first operation process is proportional to the read-write ratio value inversely proportional.
  23. 根据权利要求17所述SSD,其特征在于,当所述特征值包括所述压力值时,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。18. The SSD of claim 17, wherein when the characteristic value includes the pressure value, a first threshold for allowing an insert read operation in the one first operation process is inversely proportional to the pressure value.
  24. 根据权利要求19所述SSD,其特征在于,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述读写比例值成反比;若所述压力值小于所述第一压力值,所述一个第一操作过程中允许插入读操作的第一阈值与所述压力值成反比。The SSD according to claim 19, wherein when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the first pressure value, the first operation process The first threshold value that allows insert read operations is inversely proportional to the read-write ratio value; if the pressure value is less than the first pressure value, the first threshold value that allows insert read operations during the one first operation is inversely proportional to the read/write ratio value. The pressure value is inversely proportional.
  25. 根据权利要求20所述SSD,其特征在于,当所述特征值包括所述读写比例值时,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比。The SSD according to claim 20, wherein when the characteristic value includes the read-write ratio value, the second threshold for allowing the sending of the suspended operation and the read-write ratio during the one first operation process value is inversely proportional.
  26. 根据权利要求20所述SSD,其特征在于,当所述特征值包括所述压力值的情况下,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。The SSD according to claim 20, characterized in that, when the characteristic value includes the pressure value, a second threshold for allowing the sending of the suspend operation during the one first operation process is equal to the pressure value. inversely proportional.
  27. 根据权利要求20所述SSD,其特征在于,当所述特征值包括所述读写比例值和所述压力值时,若所述压力值大于第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述读写比例值成反比;若所述压力值小于所述第二压力值,所述一个第一操作过程中允许发送所述暂停操作的第二阈值与所述压力值成反比。The SSD according to claim 20, wherein when the characteristic value includes the read-write ratio value and the pressure value, if the pressure value is greater than the second pressure value, the first operation process The second threshold value that allows sending of the pause operation is inversely proportional to the read-write ratio value; if the pressure value is less than the second pressure value, the second threshold value that allows sending the pause operation during the first operation The threshold is inversely proportional to the pressure value.
  28. 根据权利要求16-27所述的任意一项SSD,其特征在于,所述SSD与计算设备连接;所述SSD执行读操作的数量与所述计算设备生成的读操作数量相对应,所述SSD执行写操作的数量与所述控制器生成的读操作数量相对应;所述特征值包括所述读写比例值;The SSD according to any one of claims 16-27, wherein the SSD is connected to a computing device; the number of read operations performed by the SSD corresponds to the number of read operations generated by the computing device, and the SSD The number of executed write operations corresponds to the number of read operations generated by the controller; the characteristic value includes the read-write ratio value;
    所述控制器具体用于:统计所述SSD执行第一读操作的第一数量,所述第一读操作为所述计算设备生成的读操作;The controller is specifically configured to: count the first number of first read operations performed by the SSD, where the first read operation is a read operation generated by the computing device;
    统计所述SSD执行第二读操作的第二数量,所述第二读操作为所述控制器生成的读操作;Counting the second number of second read operations performed by the SSD, where the second read operations are read operations generated by the controller;
    将所述第一数量和所述第二数量的比值作为所述SSD的读写比例值。The ratio of the first quantity to the second quantity is used as the read/write ratio value of the SSD.
  29. 根据权利要求28所述SSD,其特征在于,所述控制器具体用于:统计所述SSD执行的第一缓存队列中所述第一读操作的所述第一数量;The SSD according to claim 28, wherein the controller is specifically configured to: count the first number of the first read operations in the first cache queue executed by the SSD;
    所述控制器具体用于:统计所述SSD执行的所述第一缓存队列中所述第二读操作的所述第二数量;The controller is specifically configured to: count the second number of the second read operations in the first cache queue performed by the SSD;
    所述压力值指示第二缓存队列中等待所述SSD执行的所述第一读操作的数量,其中,所述第一缓存队列中的第一读操作是由所述第二缓存队列进入到所述第一缓存队列的,且所述第二缓存队列中不存在所述第二读操作。The pressure value indicates the number of the first read operations in the second cache queue waiting to be performed by the SSD, wherein the first read operation in the first cache queue is entered by the second cache queue to all of the SSDs. the first cache queue, and the second read operation does not exist in the second cache queue.
  30. 根据权利要求16-29所述的任意一项SSD,其特征在于,所述控制器具体用于:The SSD according to any one of claims 16-29, wherein the controller is specifically configured to:
    周期性的记录并存储与所述SSD的特征值;Periodically record and store the characteristic values of the SSD;
    获取当前时间点最近周期的目标特征值;Get the target feature value of the most recent period at the current time point;
    基于所述目标特征值,动态调整一个第一操作过程中允许插入读操作的数量。Based on the target characteristic value, dynamically adjust the number of allowable insert read operations during a first operation.
  31. 一种计算设备,其特征在于,所述计算设备包括处理器;所述计算设备与固态硬盘SSD连接;A computing device, characterized in that the computing device includes a processor; the computing device is connected to a solid-state hard disk (SSD);
    所述处理器用于:The processor is used to:
    获取所述SSD的特征值,所述特征值包括读写比例值或压力值中的至少一个,所述读写比例值为所述SSD执行读操作的数量和所述SSD执行写操作的数量的比值,所述压力值指示所述SSD中等待执行的读操作的数量;Acquire a characteristic value of the SSD, where the characteristic value includes at least one of a read-write ratio value or a pressure value, and the read-write ratio value is equal to the number of read operations performed by the SSD and the number of write operations performed by the SSD. a ratio, the pressure value indicates the number of read operations waiting to be performed in the SSD;
    基于所述特征值,动态调整一个第一操作过程中允许插入读操作的数量,所述第一操作为当前在所述SSD中执行的写操作或擦除操作。Based on the characteristic value, dynamically adjust the number of allowable insert read operations during a first operation, where the first operation is a write operation or an erase operation currently performed in the SSD.
  32. 根据权利要求31所述计算设备,其特征在于,所述处理器具体用于:The computing device according to claim 31, wherein the processor is specifically configured to:
    基于所述特征值,获取与所述特征值对应的暂停操作策略,所述暂停操作策略为在一个第一操作过程中发送暂停(Suspend)操作的约束条件,所述暂停操作用于暂停所述第一操作后在所述第一操作中插入读操作;Based on the feature value, a suspend operation strategy corresponding to the feature value is obtained, where the suspend operation strategy is a constraint condition for sending a suspend (Suspend) operation in a first operation process, and the suspend operation is used to suspend the suspend operation. inserting a read operation in the first operation after the first operation;
    将所述暂停策略发送至所述SSD中,以使所述SSD基于所述暂停操作策略,动态调整一个第一操作过程中允许插入读操作的数量。Sending the suspend policy to the SSD, so that the SSD dynamically adjusts the number of allowable insert read operations in a first operation process based on the suspend operation policy.
  33. 一种控制器,所述控制器包括处理组件、存储组件和通信接口,其特征在于,所述处理组件通过所述通信接口读取所述存储组件上存储的指令,执行如权利要求1-15中任意一项所述的方法。A controller, the controller includes a processing component, a storage component and a communication interface, characterized in that, the processing component reads the instructions stored on the storage component through the communication interface, and executes the instructions according to claims 1-15 any of the methods described in .
  34. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述权利要求1-15任意一项所述的方法。A computer storage medium, characterized in that, the computer storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the preceding claims 1-15 is implemented.
  35. 一种计算机程序,其特征在于,所述计算机程序包括指令,当所述计算机程序被计算机执行时,使得所述计算机执行如权利要求1-15中任意一项所述的方法。A computer program, characterized in that the computer program includes instructions that, when the computer program is executed by a computer, cause the computer to perform the method according to any one of claims 1-15.
PCT/CN2020/119447 2020-09-30 2020-09-30 Data reading method applied to solid state disk (ssd), and related apparatus WO2022067686A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/119447 WO2022067686A1 (en) 2020-09-30 2020-09-30 Data reading method applied to solid state disk (ssd), and related apparatus
CN202080103398.5A CN116235138A (en) 2020-09-30 2020-09-30 Data reading method and related device applied to solid state disk SSD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/119447 WO2022067686A1 (en) 2020-09-30 2020-09-30 Data reading method applied to solid state disk (ssd), and related apparatus

Publications (1)

Publication Number Publication Date
WO2022067686A1 true WO2022067686A1 (en) 2022-04-07

Family

ID=80949394

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119447 WO2022067686A1 (en) 2020-09-30 2020-09-30 Data reading method applied to solid state disk (ssd), and related apparatus

Country Status (2)

Country Link
CN (1) CN116235138A (en)
WO (1) WO2022067686A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840542A (en) * 2023-02-24 2023-03-24 浪潮电子信息产业股份有限公司 Hard disk request processing method, system, storage medium and electronic equipment
CN117809725A (en) * 2024-03-01 2024-04-02 四川云海芯科微电子科技有限公司 Flash memory particle screening and grading method
CN117809725B (en) * 2024-03-01 2024-05-14 四川云海芯科微电子科技有限公司 Flash memory particle screening and grading method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445418A (en) * 2016-09-27 2017-02-22 郑州云海信息技术有限公司 Method and device for self-adaptingread-write services in solid state disk
CN106681661A (en) * 2016-12-23 2017-05-17 郑州云海信息技术有限公司 Read-write scheduling method and device in solid state disk
CN108984108A (en) * 2017-06-05 2018-12-11 北京忆恒创源科技有限公司 For dispatching the method and solid storage device of I/O command
US20190056870A1 (en) * 2017-08-15 2019-02-21 ScaleFlux, Inc. Reducing solid state Storage device read tail latency

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445418A (en) * 2016-09-27 2017-02-22 郑州云海信息技术有限公司 Method and device for self-adaptingread-write services in solid state disk
CN106681661A (en) * 2016-12-23 2017-05-17 郑州云海信息技术有限公司 Read-write scheduling method and device in solid state disk
CN108984108A (en) * 2017-06-05 2018-12-11 北京忆恒创源科技有限公司 For dispatching the method and solid storage device of I/O command
US20190056870A1 (en) * 2017-08-15 2019-02-21 ScaleFlux, Inc. Reducing solid state Storage device read tail latency

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840542A (en) * 2023-02-24 2023-03-24 浪潮电子信息产业股份有限公司 Hard disk request processing method, system, storage medium and electronic equipment
CN117809725A (en) * 2024-03-01 2024-04-02 四川云海芯科微电子科技有限公司 Flash memory particle screening and grading method
CN117809725B (en) * 2024-03-01 2024-05-14 四川云海芯科微电子科技有限公司 Flash memory particle screening and grading method

Also Published As

Publication number Publication date
CN116235138A (en) 2023-06-06

Similar Documents

Publication Publication Date Title
US11422722B2 (en) Intelligent wide port PHY usage
US10042563B2 (en) Segmenting read requests and interleaving segmented read and write requests to reduce latency and maximize throughput in a flash storage device
TWI437439B (en) Method for performing block management using dynamic threshold, and associated memory device and controller thereof
TWI432965B (en) Memory systems with a plurality of structures and methods for operating the same
KR101663066B1 (en) Solid state memory command queue in hybrid device
KR20210076143A (en) Out-of-order zone namespaces
JP2013530448A (en) Cache storage adapter architecture
US11449443B2 (en) Identification and classification of write stream priority
CN113168374A (en) Write command retention in partition namespaces
KR20130112210A (en) Page replace method and memory system using the same
KR102595233B1 (en) Data processing system and operating method thereof
EP3926451B1 (en) Communication of data relocation information by storage device to host to improve system performance
US10310923B1 (en) Probabilistic aging command sorting
US10042585B2 (en) Pervasive drive operating statistics on SAS drives
CN114746834A (en) Partition append command scheduling based on partition status
CN108205478B (en) Intelligent sequential SCSI physical layer power management
WO2018231741A1 (en) Adaptive throttling
WO2021035555A1 (en) Data storage method and apparatus for solid state disk and solid state disk (ssd)
WO2022067686A1 (en) Data reading method applied to solid state disk (ssd), and related apparatus
US11269559B2 (en) Data processing device
KR102634776B1 (en) Data storage device and operating method thereof
KR102425470B1 (en) Data storage device and operating method thereof
US8775711B2 (en) Solid-state disk, and user system comprising same
US20220083280A1 (en) Method and apparatus to reduce latency for random read workloads in a solid state drive
CN112286843B (en) System and method for data storage system

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: 20955711

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: 20955711

Country of ref document: EP

Kind code of ref document: A1