CN117742608A - Method, device, equipment and medium for optimizing SSD service life - Google Patents
Method, device, equipment and medium for optimizing SSD service life Download PDFInfo
- Publication number
- CN117742608A CN117742608A CN202311786417.0A CN202311786417A CN117742608A CN 117742608 A CN117742608 A CN 117742608A CN 202311786417 A CN202311786417 A CN 202311786417A CN 117742608 A CN117742608 A CN 117742608A
- Authority
- CN
- China
- Prior art keywords
- physical block
- page
- read command
- unit
- optimizing
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 30
- 238000005070 sampling Methods 0.000 claims abstract description 28
- 238000004590 computer program Methods 0.000 claims description 18
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000005457 optimization Methods 0.000 claims description 4
- 238000006467 substitution reaction Methods 0.000 claims description 4
- 230000002035 prolonged effect Effects 0.000 abstract description 2
- 238000013403 standard screening design Methods 0.000 description 35
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to a method, a device, equipment and a medium for optimizing SSD service life, wherein the method comprises the following steps: closing the physical block after the physical block is full of data, and adding the physical block into a data linked list; judging whether the data linked list is in an empty state; taking out the physical block from the data linked list; page sampling is carried out on the physical block, and a read command is issued to the page according to the granularity of the page; acquiring read command results returned by all pages of a physical block, and counting the number of error bits of the read command results returned by each page; calculating to obtain the average error bit number of each page in the physical block; calculating to obtain a virtual erasing number of the physical block; and replacing the actual erasing times of the physical block with the virtual erasing times of the physical block, and optimizing the physical block to obtain the usable erasing times. According to the invention, by detecting the reliability of all the blocks, the physical blocks can be used continuously under the condition of higher reliability, so that the integral writing quantity of the SSD is improved, and the service life of the SSD is prolonged.
Description
Technical Field
The invention relates to the technical field of SSD life optimization, in particular to a method, a device, equipment and a medium for SSD life optimization.
Background
While the SSD needs to be frequently erased to empty physical blocks for writing new data, the number of erasures per physical block of the SSD is limited, and excessive erase operations may lead to a shortened SSD lifetime. The current SSD disk life is calculated according to the lower limit value in all physical blocks, which results in that other relatively good physical blocks are not used any more in the case of not using the limit scene, thereby resulting in the waste of SSD resources.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method, a device, equipment and a medium for optimizing the service life of an SSD.
In order to solve the technical problems, the invention adopts the following technical scheme:
in a first aspect, the present embodiment provides a method for optimizing SSD lifetime, including the steps of:
closing the physical block after the physical block is full of data, and adding the physical block into a data linked list;
judging whether the data linked list is in an empty state or not;
if the data linked list is not in the empty state, the physical block is taken out from the data linked list;
page sampling is carried out on the physical block, and a read command is issued to the page according to page granularity;
acquiring read command results returned by all pages of the physical block, and counting the number of error bits of the read command results returned by each page;
according to the number of error bits and the number of pages of the read command result returned by each page, calculating to obtain the average number of error bits of each page in the physical block;
calculating to obtain a virtual erase time value of the physical block according to the average error bit number and page number of each page in the physical block and the actual erase time value of the physical block;
and replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain the usable erasing times.
The further technical scheme is as follows: and in the step of calculating the average error bit number of each page in the physical block according to the error bit number and the page number of the read command result returned by each page, dividing the sum of the error bit numbers of the read command result returned by each page by the page number of the physical block to obtain the average error bit number of each page in the physical block.
The further technical scheme is as follows: and in the step of calculating the virtual erasing times value of the physical block according to the average error bit number of each page in the physical block, the page number and the actual erasing times value of the physical block, the average error bit number of each page in the physical block is multiplied by the page number, then divided by the actual erasing times value of the physical block, and finally multiplied by a proportionality coefficient to obtain the virtual erasing times value of the physical block.
The further technical scheme is as follows: and in the step of page sampling the physical block and issuing a read command to the page according to the page granularity, dividing the page in the physical block into a plurality of page sets, namely, page sampling is performed on one page set at a time, and the page is issued with the read command according to the page granularity until all page sets are page-sampled.
In a second aspect, the present embodiment provides an apparatus for optimizing SSD lifetime, including: closing the adding unit, the judging unit, the taking-out unit, the sampling issuing unit, the acquisition statistics unit, the first calculation unit, the second calculation unit and the substitution optimization unit;
the closing adding unit is used for closing the physical block and adding the physical block into a data linked list after the physical block is full of data;
the judging unit is used for judging whether the data link list is in an empty state or not;
the extracting unit is used for extracting the physical block from the data linked list if the data linked list is not in an empty state;
the sampling issuing unit is used for performing page sampling on the physical block and issuing a read command to the page according to page granularity;
the acquisition statistical unit is used for acquiring the read command results returned by all pages of the physical block and counting the number of error bits of the read command results returned by each page;
the first calculating unit is used for calculating the average error bit number of each page in the physical block according to the error bit number and the page number of the read command result returned by each page;
the second calculating unit is configured to calculate, according to the average number of error bits of each page in the physical block, the number of pages, and the actual erasure count value of the physical block, to obtain a virtual erasure count value of the physical block;
the replacement optimizing unit is used for replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain usable erasing times.
The further technical scheme is as follows: and in the first calculation unit, dividing the sum of the error bit numbers of the read command results returned by each page by the page number of the physical block to obtain the average error bit number of each page in the physical block.
The further technical scheme is as follows: and in the second calculation unit, multiplying the average error bit number of each page in the physical block by the page number, dividing by the actual erasure sub-value of the physical block, and multiplying by a proportionality coefficient to obtain the virtual erasure sub-value of the physical block.
The further technical scheme is as follows: in the sampling issuing unit, the pages in the physical block are divided into a plurality of parts, namely a plurality of page sets, each time, one page set is subjected to page sampling, and a read command is issued to the pages according to page granularity until all the page sets are subjected to page sampling.
In a third aspect, the present embodiment provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and where the processor implements a method for optimizing SSD lifetime as described above when executing the computer program.
In a fourth aspect, the present embodiment provides a storage medium storing a computer program comprising program instructions which, when executed by a processor, implement a method of optimizing SSD lifetime as described above.
Compared with the prior art, the invention has the beneficial effects that: the method comprises the steps of sampling and analyzing an SSD physical block to obtain the error bit number of a read command result returned by each page, further calculating to obtain the average error bit number of the physical block, and calculating to obtain a virtual erase time value according to the average error bit number and the actual erase time value of the physical block so as to detect the reliability of all blocks.
The invention is further described below with reference to the drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for optimizing SSD lifetime according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of an apparatus for optimizing SSD lifetime provided by an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to the embodiment shown in fig. 1, the invention discloses a method for optimizing the service life of an SSD, which comprises the following steps:
s1, closing a physical block after the physical block is full of data, and adding the physical block into a data linked list;
specifically, the data written by the physical block may be any data that needs to be stored in the SSD, such as an operating system, an application program, a document, a picture, audio, video, etc., in which the data is stored in the physical block, each physical block typically contains a plurality of pages (pages), one of which is typically 4KB or 8KB in size, depending on the design of the SSD, and when the data needs to be written to the SSD, the data is divided into pages of an appropriate size and written to free pages in the physical block in turn until the physical block is full. The SSD controller changes the state of the physical block into "used" or "closed" after one physical block is full of data, which means that the physical block is full and no longer accepts new data writing. The SSD updates metadata information, marks the state of the physical block as closed, and possibly records information about the data stored in the physical block so that the data can be correctly located when it needs to be read. In addition, the closed physical blocks are added to the linked list of data so that when an erase operation is required, the idle physical blocks can be quickly found to store new data.
Specifically, the data link list includes a plurality of physical blocks. Each node in the data link list stores address information of an idle physical block, which is used for indicating the position of the physical block in the SSD. In addition, the status of each idle physical block is recorded in the data link table to identify whether it is available for storing new data, and common physical blocks include "idle", "off" or other custom status. In addition, the data link list may further include other information related to the physical block, such as a usage count of the physical block, a write timestamp, and the like. The purpose of the data link table is to improve the writing performance and the service life of the SSD, when new data writing is needed, the SSD controller can quickly find a proper idle physical block through the data link table, and the overhead of linear searching in the whole SSD is avoided. Meanwhile, after a certain physical block is full of data, the physical block can be added into a data link list, so that an idle physical block can be conveniently and rapidly found when the erasing operation is needed.
S2, judging whether the data linked list is in an empty state or not; if the data linked list is in an empty state, returning to execute S1;
specifically, in some SSDs, the data link table may adopt a link table structure in which a link table head pointer points to a first idle physical block, and thus, whether the data link table is in a null state may be determined by checking whether the link table head pointer is in a null state. In addition, whether the data link list is empty is judged by counting the number of idle physical block nodes in the data link list, and if the data link list has no idle physical block nodes, the data link list can be considered to be in an empty state. In addition, the idle physical block nodes in the data link list may include specific flag bits or metadata to indicate whether the link list is empty, and by checking the flag bits or metadata, whether the data link list is empty can be determined.
S3, if the data linked list is not in a null state, the physical block is taken out from the data linked list;
s4, page sampling is carried out on the physical block, and a read command is issued to the page according to page granularity;
in an embodiment, in the step of performing page sampling on the physical block and issuing the read command to the page according to the page granularity, the page in the physical block is divided into a plurality of parts, that is, a plurality of page sets, each time, page sampling is performed on one page set, and the read command is issued to the page according to the page granularity until all page sets are page-sampled.
Specifically, the pages in the physical block are divided into 4 parts, 1/4 of all pages of the whole physical block are sampled at one time, a read command is constructed on a software side, and then the read command is issued according to the page granularity, so that page sampling is realized, and the page sampling is completed until all page sets are page-sampled. Page granularity refers to the smallest unit considered in data management and operation in a storage system, and for SSDs, page granularity refers to the smallest unit that each storage page takes as data read-write and management.
S5, obtaining read command results returned by all pages of the physical block, and counting the number of error bits of the read command results returned by each page;
in particular, the storage system, upon receiving the read command results returned by each page, needs to record the data content of each page and mark the number of error bits, which may require the use of specialized hardware or software to process and record the read command results for each page. The memory system analyzes the read command results returned for each page and counts the number of erroneous bits therein, which may involve checksum comparison of the read data to determine the number of erroneous bits present in the data.
S6, calculating to obtain the average error bit number of each page in the physical block according to the error bit number and the page number of the read command result returned by each page;
in an embodiment, in the step of calculating the average error bit number of each page in the physical block according to the error bit number and the page number of the read command result returned by each page, the average error bit number of each page in the physical block is obtained by dividing the sum of the error bit numbers of the read command result returned by each page by the page number of the physical block.
Specifically, typically, each page contains 80-150 erroneous bits, and a physical block may include 1200-1500 pages. Assuming that one physical block contains 1400 pages, the sum of the error bits of the read command result returned by each page is 140000, the average error bits of each page in the physical block is 140000/1400=100, i.e., 100.
S7, calculating to obtain a virtual erase count value of the physical block according to the average error bit number and the page number of each page in the physical block and the actual erase count value of the physical block;
in an embodiment, in the step of calculating the virtual erase count value of the physical block according to the average error bit number of each page in the physical block, the page number and the actual erase count value of the physical block, the average error bit number of each page in the physical block is multiplied by the page number, divided by the actual erase count value of the physical block, and finally multiplied by a scaling factor, so as to obtain the virtual erase count value of the physical block.
Specifically, assuming that the actual erasure count value of one physical block is 8000 and the scaling factor is 300, the virtual erasure count value of the physical block is 100×1400 divided by 8000 and multiplied by 300 is equal to 5250, i.e., 5250 times.
S8, replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain usable erasing times.
Specifically, the virtual erase count value is smaller than the actual erase count value, i.e., the virtual erase count value is smaller than the discard value set by the physical block. Therefore, the virtual erase count value of the physical block is used to replace the actual erase count value of the physical block, i.e. the erase count of the physical block is optimized, so that the physical block obtains the usable erase count, i.e. the difference between the virtual erase count value and the actual erase count value. For example: the virtual erase count value is 5250, and the actual erase count value is 8000, so that the usable erase count is 8000-5250=2750, that is, 2750 times can be erased.
Specifically, on the basis of the same actual erasure number value, the virtual increment value of the physical block with small error bit number is small, so that the physical block can be selected with higher probability when being selected, and higher writing quantity is ensured. In addition, on the basis of the same virtual erasure number value, the corresponding actual erasure number value of the block with less error bits is higher, and the service life is prolonged.
The invention obtains the error bit number of the read command result returned by each page by sampling and analyzing the SSD physical block, further calculates the average error bit number of the physical block, calculates the virtual erase time value according to the average error bit number and the actual erase time value of the physical block, and detects the reliability of all blocks.
Referring to fig. 2, the invention also discloses a device for optimizing the service life of the SSD, which comprises: closing the adding unit 10, the judging unit 20, the extracting unit 30, the sampling issuing unit 40, the acquisition counting unit 50, the first calculating unit 60, the second calculating unit 70 and the substitution optimizing unit 80;
the closing adding unit 10 is configured to close a physical block after the physical block is full of data, and add the physical block to a data link list;
the judging unit 20 is configured to judge whether the data link list is in an empty state;
the extracting unit 30 is configured to extract the physical block from the data linked list if the data linked list is not in a null state;
the sample issuing unit 40 is configured to perform page sampling on the physical block, and issue a read command to the page according to a page granularity;
the obtaining statistics unit 50 is configured to obtain read command results returned by all pages of the physical block, and count the number of error bits of the read command result returned by each page;
the first calculating unit 60 is configured to calculate, according to the number of error bits and the number of pages of the read command result returned by each page, an average number of error bits of each page in the physical block;
the second calculating unit 70 is configured to calculate a virtual erase count value of the physical block according to the average number of error bits of each page in the physical block, the number of pages, and the actual erase count value of the physical block;
the replacement optimizing unit 80 is configured to replace the virtual erase count value of the physical block with the actual erase count value of the physical block, and optimize the physical block to obtain a usable erase count.
In one embodiment, the first calculating unit 60 divides the sum of the error bits of the read command result returned by each page by the number of pages of the physical block, to obtain the average error bits of each page in the physical block.
In one embodiment, the second calculating unit 70 multiplies the average error bit number of each page in the physical block by the page number, divides by the actual erasure count value of the physical block, and finally multiplies by the scaling factor to obtain the virtual erasure count value of the physical block.
In one embodiment, the sample issuing unit 40 divides the pages in the physical block into several parts, i.e. several page sets, performs page sampling on one page set at a time, and issues a read command to the pages according to the page granularity until all page sets are page-sampled.
It should be noted that, as those skilled in the art can clearly understand, the specific implementation process of the above device and each unit for optimizing the SSD lifetime may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, the description is omitted here.
The above-described means for optimizing SSD lifetime may be implemented in the form of a computer program that can be run on a computer device as shown in FIG. 3.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application; the computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster formed by a plurality of servers.
With reference to FIG. 3, the computer device 500 includes a processor 502, memory, and a network interface 505, connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a method of optimizing SSD lifetime.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a method of optimizing SSD lifetime.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the structures shown in FIG. 3 are block diagrams only and do not constitute a limitation of the computer device 500 to which the present teachings apply, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
closing the physical block after the physical block is full of data, and adding the physical block into a data linked list; judging whether the data linked list is in an empty state or not; if the data linked list is not in the empty state, the physical block is taken out from the data linked list; page sampling is carried out on the physical block, and a read command is issued to the page according to page granularity; acquiring read command results returned by all pages of the physical block, and counting the number of error bits of the read command results returned by each page; according to the number of error bits and the number of pages of the read command result returned by each page, calculating to obtain the average number of error bits of each page in the physical block; calculating to obtain a virtual erase time value of the physical block according to the average error bit number and page number of each page in the physical block and the actual erase time value of the physical block; and replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain the usable erasing times.
It should be appreciated that in embodiments of the present application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program, wherein the computer program comprises program instructions which, when executed by a processor, implement the above-described method of optimizing SSD lifetime. The storage medium stores a computer program comprising program instructions which, when executed by a processor, implement the method described above. The program instructions include the steps of:
closing the physical block after the physical block is full of data, and adding the physical block into a data linked list; judging whether the data linked list is in an empty state or not; if the data linked list is not in the empty state, the physical block is taken out from the data linked list; page sampling is carried out on the physical block, and a read command is issued to the page according to page granularity; acquiring read command results returned by all pages of the physical block, and counting the number of error bits of the read command results returned by each page; according to the number of error bits and the number of pages of the read command result returned by each page, calculating to obtain the average number of error bits of each page in the physical block; calculating to obtain a virtual erase time value of the physical block according to the average error bit number and page number of each page in the physical block and the actual erase time value of the physical block; and replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain the usable erasing times.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
The foregoing embodiments are preferred embodiments of the present invention, and in addition, the present invention may be implemented in other ways, and any obvious substitution is within the scope of the present invention without departing from the concept of the present invention.
Claims (10)
1. A method of optimizing SSD lifetime comprising the steps of:
closing the physical block after the physical block is full of data, and adding the physical block into a data linked list;
judging whether the data linked list is in an empty state or not;
if the data linked list is not in the empty state, the physical block is taken out from the data linked list;
page sampling is carried out on the physical block, and a read command is issued to the page according to page granularity;
acquiring read command results returned by all pages of the physical block, and counting the number of error bits of the read command results returned by each page;
according to the number of error bits and the number of pages of the read command result returned by each page, calculating to obtain the average number of error bits of each page in the physical block;
calculating to obtain a virtual erase time value of the physical block according to the average error bit number and page number of each page in the physical block and the actual erase time value of the physical block;
and replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain the usable erasing times.
2. The method for optimizing SSD lifetime of claim 1, wherein in the step of calculating the average number of error bits of each page in the physical block according to the number of error bits and the number of pages of the read command result returned by each page, the average number of error bits of each page in the physical block is obtained by dividing the sum of the number of error bits of the read command result returned by each page by the number of pages of the physical block.
3. The method for optimizing the service life of an SSD according to claim 1, wherein in the step of calculating the virtual erase count value of the physical block according to the average number of erroneous bits per page in the physical block, the number of pages, and the actual erase count value of the physical block, the average number of erroneous bits per page in the physical block is multiplied by the number of pages, divided by the actual erase count value of the physical block, and finally multiplied by a scaling factor, to obtain the virtual erase count value of the physical block.
4. The method for optimizing SSD lifetime of claim 1, wherein in the step of page sampling the physical block and issuing the read command to the page according to a page granularity, the page in the physical block is divided into a plurality of parts, that is, a plurality of page sets, each time, the page set is page-sampled, and the read command is issued to the page according to the page granularity until all page sets are page-sampled.
5. An apparatus for optimizing SSD lifetime, comprising: closing the adding unit, the judging unit, the taking-out unit, the sampling issuing unit, the acquisition statistics unit, the first calculation unit, the second calculation unit and the substitution optimization unit;
the closing adding unit is used for closing the physical block and adding the physical block into a data linked list after the physical block is full of data;
the judging unit is used for judging whether the data link list is in an empty state or not;
the extracting unit is used for extracting the physical block from the data linked list if the data linked list is not in an empty state;
the sampling issuing unit is used for performing page sampling on the physical block and issuing a read command to the page according to page granularity;
the acquisition statistical unit is used for acquiring the read command results returned by all pages of the physical block and counting the number of error bits of the read command results returned by each page;
the first calculating unit is used for calculating the average error bit number of each page in the physical block according to the error bit number and the page number of the read command result returned by each page;
the second calculating unit is configured to calculate, according to the average number of error bits of each page in the physical block, the number of pages, and the actual erasure count value of the physical block, to obtain a virtual erasure count value of the physical block;
the replacement optimizing unit is used for replacing the virtual erasing times value of the physical block with the actual erasing times value of the physical block, and optimizing the physical block to obtain usable erasing times.
6. The apparatus for optimizing SSD lifetime of claim 5, wherein the first computing unit adds the sum of the error bits of the read command results returned by each page divided by the number of pages of the physical block to obtain the average error bits of each page in the physical block.
7. The apparatus for optimizing SSD lifetime of claim 5, wherein the second computing unit multiplies the average number of erroneous bits per page in a physical block by the number of pages, divides by the actual erasure count value of the physical block, and multiplies by a scaling factor to obtain the virtual erasure count value of the physical block.
8. The apparatus for optimizing SSD lifetime of claim 5, wherein in the sample issuing unit, pages in a physical block are divided into a plurality of page sets, i.e., page sampling is performed on one page set at a time, and a read command is issued to the pages at a page granularity until all page sets are page-sampled.
9. A computer device comprising a memory having a computer program stored thereon and a processor that when executing the computer program implements the method of optimizing SSD lifetime of any of claims 1-4.
10. A storage medium storing a computer program comprising program instructions which, when executed by a processor, implement the method of optimizing SSD lifetime of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311786417.0A CN117742608A (en) | 2023-12-22 | 2023-12-22 | Method, device, equipment and medium for optimizing SSD service life |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311786417.0A CN117742608A (en) | 2023-12-22 | 2023-12-22 | Method, device, equipment and medium for optimizing SSD service life |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117742608A true CN117742608A (en) | 2024-03-22 |
Family
ID=90260597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311786417.0A Pending CN117742608A (en) | 2023-12-22 | 2023-12-22 | Method, device, equipment and medium for optimizing SSD service life |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117742608A (en) |
-
2023
- 2023-12-22 CN CN202311786417.0A patent/CN117742608A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8112579B2 (en) | Selecting a destination tape recording device for saving data | |
JP2011520188A (en) | Memory system copyback optimization | |
CN105117351A (en) | Method and apparatus for writing data into cache | |
CN110147203B (en) | File management method and device, electronic equipment and storage medium | |
CN113366452A (en) | Management of event log information for a memory subsystem | |
CN112558868B (en) | Method, device and equipment for storing configuration data | |
CN111078123A (en) | Method and device for evaluating wear degree of flash memory block | |
CN112988611A (en) | Data writing method of nonvolatile memory, terminal and readable storage medium | |
CN116134519A (en) | Balanced three-level read disturb management in memory devices | |
CN115617255A (en) | Management method and management device for cache files | |
CN112466378A (en) | Solid state disk operation error correction method and device and related components | |
US10437784B2 (en) | Method and system for endurance enhancing, deferred deduplication with hardware-hash-enabled storage device | |
CN112069004B (en) | Method and system for testing conversion relation between block reading and page reading in flash memory chip | |
WO2021027271A1 (en) | Bad block information protection method and apparatus, computer device and storage medium | |
US20100287331A1 (en) | Electronic device and method for recording power-on time thereof | |
CN117742608A (en) | Method, device, equipment and medium for optimizing SSD service life | |
CN108984124B (en) | Method and device for reducing write amplification, computer equipment and storage medium | |
CN107943415B (en) | Method and system for searching free cluster based on FAT file system | |
CN110727405A (en) | Data processing method and device, electronic equipment and computer readable medium | |
CN115862714A (en) | SSD (solid State disk) read delay optimization method and device, computer equipment and storage medium | |
CN115203002A (en) | Log processing method and device, electronic equipment and storage medium | |
CN115328851A (en) | Data protection method, device, equipment and medium | |
CN114627959A (en) | Flash memory detection method, flash memory detection device, equipment and medium | |
CN113467724A (en) | CRC (Cyclic redundancy check) code storage method, device, equipment and medium | |
CN113468105A (en) | Data structure of data snapshot, related data processing method, device and system |
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 |