CN109491592B - Storage device, data writing method thereof and storage device - Google Patents

Storage device, data writing method thereof and storage device Download PDF

Info

Publication number
CN109491592B
CN109491592B CN201811099881.1A CN201811099881A CN109491592B CN 109491592 B CN109491592 B CN 109491592B CN 201811099881 A CN201811099881 A CN 201811099881A CN 109491592 B CN109491592 B CN 109491592B
Authority
CN
China
Prior art keywords
data
mode
writing
written
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811099881.1A
Other languages
Chinese (zh)
Other versions
CN109491592A (en
Inventor
唐江
梁小庆
邓恩华
李志雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongshan Longsys Electronics Co ltd
Original Assignee
Zhongshan Longsys Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongshan Longsys Electronics Co ltd filed Critical Zhongshan Longsys Electronics Co ltd
Priority to CN201811099881.1A priority Critical patent/CN109491592B/en
Publication of CN109491592A publication Critical patent/CN109491592A/en
Application granted granted Critical
Publication of CN109491592B publication Critical patent/CN109491592B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a storage device and a data writing method and a storage device thereof, wherein the data writing method comprises the steps of receiving a writing command of data to be written; judging whether a first mode of the storage device is started or not; if the first mode is started, receiving data to be written, and writing the data to be written by adopting the first mode; otherwise, judging whether the data to be written is the set writing type; if the data to be written is the set writing type, writing the data to be written in by adopting a first mode; otherwise, the data to be written is written by adopting the second mode. Whether the quick write-in mode is started or not is judged firstly, the data write-in mode is determined, the write-in speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write-in performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with low performance can obtain better burst write-in performance indexes, and the user experience is improved.

Description

Storage device, data writing method thereof and storage device
Technical Field
The present application relates to the field of storage technologies, and in particular, to a storage device, a data writing method thereof, and a storage apparatus.
Background
With the continuous development of storage technology, people are looking for larger capacity and paying more attention to other performance indexes of storage devices. For example, the burst performance of memory devices has been a focus of people in recent years.
For example, the NAND Flash memory has two write modes, a single-level cell SLC high-speed write mode and a multi-level cell MLC/three-level cell TLC low-speed write mode, and the two different data write modes have different write-in and read performances and different storage densities. For example, when data is written in the fast write SLC write mode, the processing speed of the data is 5 to 10 times that of the MLC/TLC operation mode.
Since the storage density in the fast write SLC operation mode is reduced, for example, when the SLC operation mode is completely used for data storage, the storage density is equivalent to 1/2 of the storage density in the MLC operation mode, or equivalent to 2/3 of the storage density in the TLC operation mode. Therefore, the SLC mode of operation by time-shifting in space is not suitable for any situation.
Disclosure of Invention
The application provides a storage device, a data writing method thereof and a storage device, which can select a proper data writing mode according to the current storage condition of the storage device and accelerate the data writing speed on the premise of not influencing the storage capacity of the storage device.
In order to solve the foregoing technical problem, a first technical solution provided by the present application is to provide a data writing method, including:
s101, receiving a write-in command of data to be written;
s102, judging whether a first mode of the storage device is started or not;
s103, if the first mode is started, receiving data to be written, and writing the data to be written by adopting the first mode; otherwise, judging whether the data to be written is a set writing type;
s104, if the data to be written is a set writing type, writing the data to be written by adopting the first mode; otherwise, the data to be written is written by adopting a second mode.
In order to solve the above technical problem, a second technical solution provided by the present application is to provide a storage device, where the storage device includes a memory, a processor communicatively connected to the memory, and a computer program executable on the processor is stored in the memory, and the processor implements the steps of the data writing method according to any one of the above embodiments when executing the computer program.
In order to solve the above technical problem, a third technical solution provided by the present application is to provide a storage device, on which a computer program is stored, and the computer program implements the steps of the data writing method when being executed by a processor.
Different from the prior art, after receiving a write command in an idle state, the storage device of the embodiment first determines whether a fast write mode of the storage device is turned on, and if so, writes data to be written in the fast write mode, otherwise, writes data to be written in the low-speed write mode. Whether the quick write-in mode is started or not is judged firstly, the data write-in mode is determined, the write-in speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write-in performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with low performance can obtain better burst write-in performance indexes, and the user experience is improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a first embodiment of a data writing method according to the present application;
FIG. 2 is a schematic flow chart diagram illustrating a second embodiment of the data writing method of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a third embodiment of the data writing method of the present application;
FIG. 4 is a schematic structural diagram of an embodiment of a memory device of the present application;
fig. 5 is a schematic structural diagram of an embodiment of a memory device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the continuous development of storage technology, storage equipment becomes an essential daily article in daily life. The Solid State Disk (SSD) using the Flash memory NAND Flash as a storage medium is a nonvolatile random access medium, has the characteristics of no disappearance of data after power failure, large capacity, high read-write speed, suitability for large-capacity data storage and the like, and gradually becomes a mainstream storage form. The performance of hard disk drives compared to conventional magnetic media is a matter of flight.
The storage device of the application comprises a USB Flash disk (USB Flash disk), an SD Card (Secure data Card), an SSD (Solid State disk), an EMMC (Embedded Multi Media Card), an EMCP (Embedded Multi Chip Package), a CF Card (Compact Flash) and other servers with storage devices, processors and the like.
In order to increase the writing speed on the premise of ensuring the storage space, the present embodiment proposes the following data writing method, as shown in fig. 1. Fig. 1 is a data writing method of the present application, including the following steps:
s101: a write command is received for data to be written.
The storage device is in an idle state when data reading and writing are not performed or after the data reading and writing are completed and before a new writing instruction is not received. In the idle state, the storage device executes an idle task, and judges whether a new write command exists at predetermined intervals in the execution process of the idle task.
The predetermined time is generally several milliseconds, and it can also be adjusted according to different requirements.
And if a new write command is received, acquiring the data to be written from the write command.
The idle tasks include data transfer and also include idle scanning of the storage device, and operation tasks such as cleaning and recovering garbage generated by writing data to be written.
When the storage device is in an idle state, when the host issues a write-in command of data to be written and the storage device is required to write in the data, the storage device receives the write-in command correspondingly. The write command includes the length of the data to be written, the logical address of the data to be written, and the write type of the data to be written, such as random address write.
S102: and judging whether the first mode of the storage equipment is started or not.
The first mode is a fast write mode, i.e., an SLC (Single-Level Cell) write mode, and the first mode write condition is a fast write condition.
Since the writing speed of the fast write mode is significantly better than that of other write modes, the storage device of this embodiment first determines whether the first mode, i.e., the fast write mode, is on after receiving a write command of data to be written.
S103: if the first mode is started, receiving data to be written, and writing the data to be written by adopting the first mode; otherwise, judging whether the data to be written is the set writing type.
And if the first mode of the storage equipment is started, receiving the data to be written, and directly writing the data to be written by adopting the first mode, namely the quick writing mode. If the first mode of the storage device is not started, the storage device further judges whether the data to be written is the set writing type.
Wherein the set write type is random address write.
S104: if the data to be written is of a set writing type, writing the data to be written by adopting a first mode; otherwise, the data to be written is written in the second mode.
Specifically, in the process of reading or writing data in the solid state disk, the speed of writing the random address is an important index for measuring the processing capacity of the solid state disk, and the number of times of performing read-write operations per second, i.e., the IOPS performance, is an index for measuring the speed of writing the random address in the storage device. Generally, the higher the IOPS index is, the stronger the data processing capability of the solid state disk SSD is. Thus, the IOPS performance is improved, and the random address writing speed can be improved. And the data to be written is written in by adopting a first mode, namely a fast writing mode, so that the number of times of writing operation per second can be increased to improve the IOPS index, and the writing speed of the storage equipment is further increased. Therefore, if the writing type of the data to be written is random address writing, the data to be written is directly written by adopting a fast writing mode.
And if the first mode is not started and the writing type of the data to be written is non-random address writing, writing the data to be written by adopting the second mode.
The second mode is any one of an MLC (Multi-Level Cell) write mode, a TLC (triple-Level Cell) write mode, or a QLC (Quad-Level Cell) write mode.
In the above mode, whether the fast write mode is started or not is judged firstly, the data write mode is determined, the write speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with low performance can obtain better burst write performance indexes, and the user experience is improved.
In another embodiment, as shown in fig. 2, fig. 2 is a schematic flow chart of a second embodiment of the writing method of the present application. The storage device is in an idle state, and before receiving a write-in instruction of data to be written in, the storage device judges whether a first mode starting condition, namely a fast write-in mode starting condition, is met. And if the first mode is satisfied, the first mode is started, and if the first mode is not satisfied, the second mode is started. The method specifically comprises the following steps:
s201: judging whether the storage device is satisfied, a) the free capacity of the storage device is larger than a first threshold value; or b) the idle time of the storage device is greater than a second threshold while the idle capacity is greater than the first threshold.
S202: if a) or b) above is satisfied, the first mode is turned on. Otherwise, the second mode is turned on.
The first mode is a fast write mode, i.e., an SLC (Single-Level Cell) write mode, and the first mode enable condition is a fast write enable condition.
The second mode is any one of an MLC (Multi-Level Cell) write mode, a TLC (triple-Level Cell) write mode, or a QLC (Quad-Level Cell) write mode.
In combination with S201 and S202, specifically, since the SLC fast write mode is to trade the sacrifice storage space for the write speed, in order to ensure that the storage space and the write space are considered at the same time, the SLC fast write mode is not completely used to write the data to be written. Therefore, a first threshold is set for the free capacity of the storage device, for example, 70G when the storage space is 100G. And when the idle capacity is larger than the first threshold value, starting a first mode. If the free capacity is not greater than the first threshold, a second mode is initiated.
In addition, the storage device can arrange the data inside the storage device when the storage device is in an idle state, namely when no data is read or written. Such as data transfer, garbage collection, idle scanning, etc., can severely affect the writing speed of data if the idle task is processed simultaneously with the fast writing of data. Therefore, in the present embodiment, the length of the idle time is limited in order to avoid temporal collision. Such as setting the second threshold value to be 1 minute or 30 seconds, etc. If the idle time of the storage device is less than a second threshold, a second mode is initiated. If the idle time of the storage device is greater than the second threshold, in order to ensure the feasibility of fast write-in, it is further determined whether the idle capacity of the storage device is greater than the first threshold, and if the idle capacity is greater than the first threshold, the first mode is turned on. And if the idle time is greater than the second threshold and the idle capacity is not greater than the first threshold, starting the second mode.
S203: a write command is received for data to be written.
When the storage device is in an idle state, when a host issues a write command of data to be written and the storage device is required to write the data, the storage device receives the write command correspondingly. The write command includes the length of the data to be written, the type of write, e.g., random address write.
S204: and judging whether the first mode of the storage equipment is started or not.
Since the writing speed of the fast writing mode is significantly better than that of other writing modes, the storage device of the embodiment first determines whether the first mode, i.e., the fast writing mode, is turned on after receiving a writing instruction of data to be written.
If the first mode is on, S205 is performed. If the first mode is not on, S206 is performed.
S205: and writing the data to be written by adopting the first mode.
And receiving the data to be written, and writing the data in a fast writing mode, so that the speed of writing the data to be written can be increased, and the writing performance of the storage equipment is effectively improved.
S206: and judging whether the data to be written is a set writing type.
Wherein the set write type is random address write.
Specifically, in the process of reading or writing data in the solid state disk, the speed of writing the random address is an important index for measuring the processing capacity of the solid state disk, and the number of times of performing read-write operations per second, i.e., the IOPS performance, is an index for measuring the speed of writing the random address in the storage device. Generally, the higher the IOPS index is, the stronger the data processing capability of the solid state disk SSD is. Thus, the IOPS performance is improved, and the random address writing speed can be improved. And the data to be written is written in by adopting a first mode, namely a quick writing mode, so that the number of times of writing operation per second can be increased to improve the IOPS index, and the writing speed of the storage equipment is further increased. Therefore, if the writing type of the data to be written is random address writing, the data to be written is directly written by adopting a fast writing mode.
If it is the set write type, S205 is executed. If the data to be written is not the set write type, S207 is performed.
S207: and writing the data to be written by adopting a second mode.
In the above mode, whether the fast write mode is started or not is judged firstly, the data write mode is determined, the write speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with the storage performance of the low-end performance can obtain a better burst write performance index, and the user experience is improved.
In any of the above embodiments, the data storage is a continuous dynamic process, and is not limited to any one determination. For example, when the storage device receives a write command in an idle state, the data to be written is written in the second mode because the first mode is not turned on, which does not mean that the entire write process needs to be written in the second mode. Or, since the fast write is read at the space acquisition write speed, the first mode is turned on and the data to be written is written in the first mode, which does not mean that the entire write process meets the write condition of the first mode. Therefore, after the storage device enters the host data writing state, whether the storage device meets the first mode writing condition is further continuously judged. As shown in fig. 3, fig. 3 is a schematic flow chart of a third embodiment of the data writing method of the present application. The method comprises the following steps:
s301: a write command is received for data to be written.
S302: and judging whether the first mode of the storage equipment is started or not.
S303: if the first mode is started, receiving data to be written, and writing the data to be written by adopting the first mode; otherwise, judging whether the data to be written is the set writing type.
S304: if the data to be written is a set writing type, writing the data to be written by adopting the first mode; otherwise, the data to be written is written by adopting a second mode.
S301 to S304 are the same as S101 to S104, and please refer to S101 to S104 and the description of the related characters, which are not described herein again.
S305: and judging whether the storage equipment meets a first mode writing condition or not.
The first mode writing condition is that the data to be written is a set writing type; or the data to be written is a non-set writing type, but the free capacity of the storage equipment is larger than a first threshold value; or the data to be written is in a non-set writing type, but the idle time of the storage device is larger than the second threshold value, and meanwhile, the idle capacity is larger than the first threshold value.
Wherein the set write type is random address write.
The storage device firstly judges whether the writing type of the data to be written is random address writing or not, and the data to be written accords with a fast writing condition. Specifically, in the process of reading or writing data in the solid state disk, the speed of writing the random address is an important index for measuring the processing capacity of the solid state disk, and the number of times of performing read-write operations per second, i.e., the IOPS performance, is an index for measuring the performance of writing the random address in the storage device. Generally, the higher the IOPS index is, the stronger the data processing capability of the solid state disk SSD is. Thus, the IOPS performance is improved, and the random address writing speed can be improved. And the data to be written is written in by adopting a first mode, namely a quick writing mode, so that the number of times of writing operation per second can be increased to improve the IOPS index, and the writing speed of the storage equipment is further increased. Therefore, if the write type of the data to be written is random address write, it is determined that the data to be written meets the fast write condition.
And if the write-in type of the data to be written is a non-set write-in type, the storage device judges whether the free capacity of the storage device is larger than a first threshold value. And if the free capacity is larger than the first threshold value, the data to be written accords with a first mode writing condition, namely a quick writing condition. Specifically, since the SLC fast write mode is to sacrifice the storage space for the write speed, the SLC fast write mode is not completely used to write the data to be written in order to ensure that the storage space and the write space are simultaneously considered. Therefore, a first threshold is set for the free capacity of the storage device, for example, 70G when the storage space is 100G. And when the free capacity is larger than the first threshold value, the data to be written accords with a fast writing condition. For example, if the free capacity is greater than 70G, the fast write condition is satisfied.
And if the write-in type of the data to be written is a non-set write-in type, judging whether the idle time of the storage equipment is greater than a second threshold value. And if the idle time is greater than a second threshold, judging whether the idle capacity is greater than a first threshold. And if the free capacity of the storage equipment is larger than the first threshold value, the data to be written accords with a fast writing condition. Specifically, when the storage device is in an idle state, that is, when there is no data read/write, the storage device may perform sorting on the data therein, such as garbage collection and idle scanning, reproduce the data of the data block written in the first mode, write the data block in the idle data block in the second mode, erase the data of the data block written in the first mode after writing, and the like. Therefore, in the present embodiment, the length of the idle time is limited in order to avoid temporal collision. Such as setting the second threshold to be 1 minute or 30 seconds, etc. If the idle time of the storage device is greater than the second threshold, in order to ensure the feasibility of fast write-in, it is further determined whether the idle capacity of the storage device is greater than the first threshold, and if the idle capacity is greater than the first threshold, the data to be written meets the fast write-in condition.
If the first pattern writing condition is satisfied, S306 is performed, and if the first pattern writing condition is not satisfied, S308 is performed.
S306: and writing the data to be written by adopting a first mode.
S307: and judging whether the first mode writing condition is still met currently.
In the writing process, the storage device further determines whether the current writing start condition of the first mode is still present, for example, whether the free capacity of the current storage device is greater than a first threshold. If yes, S306 is performed, and if not, S308 is performed.
S308: and writing the data to be written by adopting a second mode.
S309: it is determined whether there is a new write command.
After the storage device finishes writing the current data to be written, it further determines whether a new write command is received, and if a new write command is received, step S302 is executed. If a new write command is not received, S310 is performed.
S310: and entering an idle state, executing an idle task, and judging whether a new write-in command exists or not.
The idle task comprises data transfer, and specifically comprises the steps of writing data of a data block written by adopting a first mode into an idle data block by adopting a second mode again; and after the writing is finished, erasing the data of the data block written by the first mode. The idle tasks also comprise idle scanning of the storage device, cleaning and recycling of garbage and other operation tasks generated by writing of data to be written.
Further, the storage device judges whether the execution of the idle task is completed, and if not, judges whether a new command is written in every preset time in the execution process of the idle task.
The predetermined time is generally several milliseconds, and it can also be adjusted according to different requirements.
If the storage device receives a new write command during the execution of the idle task, S302 is performed. And cycling the writing process. If a new write command is not received during the execution of the idle task, S311 is performed.
S311: the storage device enters a hibernation state.
After entering the sleep state, the storage device waits for the next Host wakeup.
Different from the prior art, after receiving a write command in an idle state, the storage device of the embodiment first determines whether a fast write mode of the storage device is turned on, and if so, writes data to be written in the fast write mode, otherwise, writes data to be written in the low-speed write mode. Whether the quick write-in mode is started or not is judged firstly, the data write-in mode is determined, the write-in speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write-in performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with low performance can obtain better burst write-in performance indexes, and the user experience is improved.
In terms of hardware architecture, the present application proposes a storage device, and referring to fig. 4, the storage device of this embodiment includes a memory 41 and a processor 42 communicatively connected to the memory 41. The memory 41 stores a computer program that can be executed on the processor, and the processor 42 can implement the data writing method according to any one of the embodiments of fig. 1 to 3 when executing the computer program.
The memory 41 is used as a nonvolatile computer readable storage medium, and can be used for storing nonvolatile software programs, nonvolatile computer executable programs, and modules, such as program instructions/modules corresponding to the data writing method in the embodiment of the present invention. The processor 42 executes various functional applications of the server and data processing, namely, implements the method for writing data of the above-described method embodiment, by executing the nonvolatile software program, instructions and modules stored in the memory 42.
The memory 41 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the garbage collected device, and the like.
The one or more modules are stored in the memory 41 and when executed by the one or more processors 42 perform the data writing method of any of the method embodiments described above.
Specifically, the processor 42 receives a write command to write data.
When the host issues a write command for data to be written to the storage device and requests the storage device to write data while the storage device is in an idle state, the processor 42 receives the write command accordingly. The write command includes the length of the data to be written, the logical address of the data to be written, and the write type of the data to be written, such as random address write.
Processor 42 further determines whether the first mode of the memory device is on.
The first mode is a fast write mode, i.e. an SLC (Single-Level Cell) write mode, and the first mode write condition is a fast write condition.
If the first mode is started, the processor 42 writes the data to be written in by adopting the first mode; otherwise, the processor 42 writes the data to be written in the second mode.
The second mode is any one of an MLC (Multi-Level Cell) write mode, a TLC (triple-Level Cell) write mode, or a QLC (Quad-Level Cell) write mode.
In another embodiment, the storage device is in an idle state, and before the processor 42 receives a write command for data to be written, the storage device determines whether a first mode enable condition, i.e., a fast write mode enable condition, is satisfied. And if the first mode is satisfied, the first mode is started, and if the first mode is not satisfied, the second mode is started.
The processor 42 is specifically configured to perform the following steps: judging whether the storage device meets a) the free capacity of the storage device is larger than a first threshold value; or b) the idle time of the storage device is greater than a second threshold while the idle capacity is greater than the first threshold. If a) or b) above is satisfied, the first mode is turned on. Otherwise, the second mode is turned on.
Because the fast write SLC write mode is at the expense of storage space for write speed, the SLC fast write mode is not fully used to write the data to be written in order to ensure that the storage space and the write space are simultaneously considered. Therefore, a first threshold is set for the free capacity of the storage device, for example, when the storage space is 100G, the first threshold is set to 70G. When the free capacity is greater than the first threshold, the processor 42 turns on the first mode. If the free capacity is not greater than the first threshold, the second mode is enabled.
In addition, the storage device can arrange the data inside the storage device when the storage device is in an idle state, namely when no data is read or written. Such as data transfer, garbage collection, idle scanning, etc., can severely affect the writing speed of data if the idle task is processed simultaneously with the fast writing of data. Therefore, in this embodiment, in order to avoid the time conflict, the processor 42 limits the duration of the idle time. Such as setting the second threshold to be 1 minute or 30 seconds, etc. If the idle time of the storage device is less than a second threshold, a second mode is initiated. If the idle time of the storage device is greater than the second threshold, in order to ensure the feasibility of fast write, the processor 42 needs to further determine whether the idle capacity of the storage device is greater than the first threshold, and if the idle capacity is greater than the first threshold, the first mode is turned on. And if the idle time is greater than the second threshold and the idle capacity is not greater than the first threshold, starting the second mode.
In any of the above embodiments, the data storage is a continuous dynamic process, and is not limited to any one determination. For example, when the storage device receives a write command in an idle state, the data to be written is written in the second mode because the first mode is not turned on, which does not mean that the entire write process needs to be written in the second mode. Or, since the fast write is read at the space acquisition write speed, the first mode is turned on and the data to be written is written in the first mode, which does not mean that the entire write process meets the write condition of the first mode. Therefore, after the memory device enters the host write data state, the processor 42 further continuously determines whether the memory device meets the first pattern write condition.
Specifically, processor 42 determines whether the storage device meets a first pattern write condition. The first mode writing condition is that the data to be written is a set writing type; or the data to be written is a non-set writing type, but the free capacity of the storage equipment is larger than a first threshold value; or the data to be written is in a non-set writing type, but the idle time of the storage device is larger than the second threshold value, and meanwhile, the idle capacity is larger than the first threshold value. Wherein the set write type is random address write.
If the first mode writing condition is met, the processor 42 writes the data to be written in the first mode. If the first pattern write condition is not met, the processor 42 writes the data to be written using the second pattern. And after the first mode writing condition is met, judging whether the first mode writing condition is still met currently. And if the data is in line with the first mode, continuing to write the data to be written by adopting the first mode, and writing the rest data by adopting the second mode after the data is positive.
After finishing writing the current data to be written, the processor 42 further determines whether a new write command is received, and if a new write command is received, continues to execute the step of determining whether the first mode is turned on. And if the new write-in command is not received, entering an idle state, executing an idle task, and judging whether a new write-in command exists.
The idle task comprises data transfer, and specifically comprises the steps of writing data of a data block written by adopting a first mode into an idle data block by adopting a second mode again; and after the writing is finished, erasing the data of the data block written by the first mode. The idle tasks also comprise idle scanning of the storage device, cleaning and recycling of garbage and other operation tasks generated by writing of data to be written.
Further, the processor 42 determines whether the execution of the idle task is completed, and if not, determines whether a new command is written every predetermined time during the execution of the idle task.
The predetermined time is generally several milliseconds, and it can also be adjusted according to different requirements.
If the processor 42 receives a new write command during execution of the idle task, a process is performed to determine whether the first mode is on. If processor 42 does not receive a new write command during execution of the idle task, the storage device enters a sleep state.
After entering the sleep state, the storage device waits for the next Host wakeup.
Different from the prior art, after receiving the write command in the idle state, the processor 42 of this embodiment first determines whether the fast write mode of the storage device is turned on, and if so, writes the data to be written in using the fast write mode, otherwise, writes the data to be written in using the low speed write mode. Whether the fast write-in mode is started or not is judged firstly, the data write-in mode is determined, the write-in speed of data can be accelerated on the premise that the storage capacity of the storage device is not influenced, the burst write-in performance of the storage device is improved, the storage device is convenient to transplant, the practicability is wide, the storage device with the storage performance of low-end performance can obtain better burst write-in performance indexes, and the user experience is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a storage device according to the present application, in which a computer program 51 is stored in a storage device 50 of the present embodiment, and the computer program 51 is executed by a processor to implement the data writing method.
The storage device 50 may be a medium that can store the computer program 51, such as a usb disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, or may be a server that stores the computer program 51, and the server can send the stored computer program 51 to another device for running, or can run the stored computer program 51 by itself. The storage device 50 may be a combination of a plurality of entities in terms of physical entities, for example, a plurality of servers, a server plus a memory, or a memory plus a removable hard disk.
The above are only embodiments of the present application, and not intended to limit the scope of the present application, and all equivalent structures or equivalent processes performed by the present application and the contents of the attached drawings, which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (11)

1. A data writing method of a storage device, comprising:
judging whether the storage equipment meets the requirements, b) the idle time of the storage equipment is larger than a second threshold value, and the idle capacity is larger than a first threshold value; if b) is satisfied, starting the first mode; otherwise, the second mode is started; the first mode is a fast write mode, and the second mode is a low speed write mode;
s101, receiving a write-in command of data to be written;
s102, judging whether a first mode of the storage device is started or not;
s103, if the first mode is started, receiving data to be written, and writing the data to be written by adopting the first mode; otherwise, judging whether the writing type of the data to be written is random address writing;
s104, if the writing type of the data to be written is random address writing, writing the data to be written by adopting the first mode; otherwise, writing the data to be written in by adopting a second mode;
judging whether a new write-in command exists or not; if a new write command exists, executing S101;
otherwise, entering an idle state and executing an idle task; the idle task includes: writing the data of the data block written by adopting the first mode into the idle data block by adopting the second mode again; and after the writing is finished, erasing the data of the data block written by the first mode.
2. The data writing method according to claim 1, further comprising,
judging whether the storage equipment meets a first mode writing condition or not;
if the storage equipment meets the first mode writing condition, writing the data to be written in by adopting a first mode; otherwise, the data to be written is written in the second mode.
3. The data writing method according to claim 2, wherein the determining whether the storage device meets a first pattern writing condition specifically includes:
and judging whether the data to be written is a set writing type, and if so, conforming to a first writing condition.
4. The data writing method according to claim 3, wherein the determining whether the storage device meets a first pattern writing condition further includes:
if the data to be written is a non-set writing type, judging whether the free capacity of the storage equipment is larger than a first threshold value; and if the free capacity is larger than a first threshold value, meeting a first writing condition.
5. The data writing method according to claim 3, wherein the determining whether the storage device meets a first pattern writing condition further includes:
if the data to be written is a non-set writing type, judging whether the idle time is greater than a second threshold value; if the idle time is larger than a second threshold, judging whether the idle capacity is larger than a first threshold; and if the free capacity is larger than a first threshold value, meeting a first writing condition.
6. The data writing method according to claim 2, wherein if the storage device meets the first mode writing condition, the data to be written is written in a first mode; otherwise, writing the data to be written in by adopting a second mode, specifically:
if the storage equipment meets the first mode writing condition, starting a first mode, and writing the data to be written in by adopting the first mode; otherwise, switching to a second mode, and writing the data to be written by adopting the second mode.
7. The data writing method according to claim 1,
the fast write mode is an SLC write mode; the low-speed write mode is an MLC write mode, a TLC write mode, or a QLC write mode.
8. The data writing method according to claim 1, further comprising:
judging whether the idle task is executed and completed;
if not, judging whether a new write-in command exists or not at preset time intervals;
and if the execution is finished, entering a dormant state.
9. The data writing method according to claim 8, further comprising: and when the storage device is in the dormant state, if a new write-in command exists, waking up the storage device.
10. A storage device, comprising a memory, a processor communicatively connected to the memory, and a computer program executable on the processor, wherein the processor implements the steps of the data writing method according to any one of claims 1 to 9 when executing the computer program.
11. A storage device having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the data writing method according to any one of claims 1 to 9.
CN201811099881.1A 2018-09-20 2018-09-20 Storage device, data writing method thereof and storage device Active CN109491592B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811099881.1A CN109491592B (en) 2018-09-20 2018-09-20 Storage device, data writing method thereof and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811099881.1A CN109491592B (en) 2018-09-20 2018-09-20 Storage device, data writing method thereof and storage device

Publications (2)

Publication Number Publication Date
CN109491592A CN109491592A (en) 2019-03-19
CN109491592B true CN109491592B (en) 2022-11-15

Family

ID=65690695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811099881.1A Active CN109491592B (en) 2018-09-20 2018-09-20 Storage device, data writing method thereof and storage device

Country Status (1)

Country Link
CN (1) CN109491592B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467706A (en) * 2020-03-30 2021-10-01 华为技术有限公司 Solid state disk management method and solid state disk
CN112558865A (en) * 2020-12-02 2021-03-26 成都佰维存储科技有限公司 Burst data reading and writing method and device, readable storage medium and electronic equipment
CN114564151A (en) * 2022-02-28 2022-05-31 深圳忆联信息系统有限公司 Method and device for improving SSD data retention, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266835A (en) * 2007-01-17 2008-09-17 三星电子株式会社 Non-volatile memory apparatus comprising multi-user selectable programming mode and the related method
CN101361135A (en) * 2005-12-09 2009-02-04 美光科技公司 Single level cell programming in a multiple level cell non-volatile memory device
CN102521160A (en) * 2011-12-22 2012-06-27 上海交通大学 Write buffer detector, addressing method of written data and parallel channel write method
CN103955431A (en) * 2014-04-11 2014-07-30 深圳市江波龙电子有限公司 Data management method and apparatus in flash memory storage device
CN104091617A (en) * 2014-06-17 2014-10-08 深圳市江波龙电子有限公司 Flash memory equipment detection method and apparatus thereof
CN104919431A (en) * 2013-01-14 2015-09-16 西部数据技术公司 Systems and methods of configuring a mode of operation in a solid-state memory
CN106951186A (en) * 2017-03-07 2017-07-14 合肥兆芯电子有限公司 Data programming method, memory storage apparatus and memorizer control circuit unit
CN107291626A (en) * 2017-06-19 2017-10-24 北京小米移动软件有限公司 Date storage method and device
CN108228478A (en) * 2018-01-05 2018-06-29 湖南国科微电子股份有限公司 A kind of raising method and device of SSD write performances

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101361135A (en) * 2005-12-09 2009-02-04 美光科技公司 Single level cell programming in a multiple level cell non-volatile memory device
CN101266835A (en) * 2007-01-17 2008-09-17 三星电子株式会社 Non-volatile memory apparatus comprising multi-user selectable programming mode and the related method
CN102521160A (en) * 2011-12-22 2012-06-27 上海交通大学 Write buffer detector, addressing method of written data and parallel channel write method
CN104919431A (en) * 2013-01-14 2015-09-16 西部数据技术公司 Systems and methods of configuring a mode of operation in a solid-state memory
CN103955431A (en) * 2014-04-11 2014-07-30 深圳市江波龙电子有限公司 Data management method and apparatus in flash memory storage device
CN104091617A (en) * 2014-06-17 2014-10-08 深圳市江波龙电子有限公司 Flash memory equipment detection method and apparatus thereof
CN106951186A (en) * 2017-03-07 2017-07-14 合肥兆芯电子有限公司 Data programming method, memory storage apparatus and memorizer control circuit unit
CN107291626A (en) * 2017-06-19 2017-10-24 北京小米移动软件有限公司 Date storage method and device
CN108228478A (en) * 2018-01-05 2018-06-29 湖南国科微电子股份有限公司 A kind of raising method and device of SSD write performances

Also Published As

Publication number Publication date
CN109491592A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
EP2921963B1 (en) Memory recycling method and device
US8234466B2 (en) Flash memory storage system applying SLC NAND flash memory and MLC NAND flash memory and data writing method thereof
US8392649B2 (en) Memory storage device, controller, and method for responding to host write commands triggering data movement
CN101981551B (en) Apparatus and method for cache utilization
US8667209B2 (en) Non-volatile memory access method and system, and non-volatile memory controller
US20170160989A1 (en) Solid state disk and method for implementing trim command of the same
CN109491592B (en) Storage device, data writing method thereof and storage device
US8897092B2 (en) Memory storage device, memory controller and controlling method
CN110673789B (en) Metadata storage management method, device, equipment and storage medium of solid state disk
KR102208058B1 (en) Storage device and data processing system including the same
CN111694510B (en) Data storage device and data processing method
US8914587B2 (en) Multi-threaded memory operation using block write interruption after a number or threshold of pages have been written in order to service another request
KR101127686B1 (en) Semiconductor memory device
CN102135943B (en) Storing and accessing method of flash memory data and device thereof
US11188267B2 (en) Method and apparatus and computer program product for handling sudden power off recovery
US20130132640A1 (en) Data writing method, and memory controller and memory storage apparatus using the same
CN114968839A (en) Hard disk garbage recycling method, device and equipment and computer readable storage medium
CN108334383B (en) Information processing method and electronic equipment
CN110647294B (en) Storage block recovery method and device, storage medium and electronic equipment
US20180203813A1 (en) Methods for processing return entities associated with multiple requests in single interrupt service routine thread and apparatuses using the same
CN110658995A (en) Solid state disk, configuration data management method and device thereof, and storage medium
US20110087828A1 (en) Method for enhancing performance of accessing a flash memory, and associated memory device and controller thereof
KR20200021861A (en) Storage device and operation method thereof
CN106021124B (en) A kind of storage method and storage system of data
CN114995756A (en) Virtual disk space recovery method, device and medium

Legal Events

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