Data migration system and method for computer

文档序号:923453 发布日期:2021-03-02 浏览:2次 中文

阅读说明:本技术 一种计算机用数据迁移系统及方法 (Data migration system and method for computer ) 是由 王建华 赵莉 于 2020-11-16 设计创作,主要内容包括:本发明公开了一种计算机用数据迁移系统及方法,数据迁移系统包括块划分模块、关键字采集模块和已存在数据信息采集模块,所述块划分模块预先采集固态驱动器SSD中各个Block的磨损数值,将各个Block按照磨损数值所处的范围划分为第一Block、第二Block和第三Block,其中,第一Block的磨损数值大于第二Block的磨损数值,第二Block的磨损数值大于第三Block的磨损数值,所述关键字采集模块用于采集准备写入的待写入数据的关键字为第一关键字,在SSD搜索包含第一关键字的已存在数据,在SSD中存储有包含第一关键字的已存在数据时,令所述已存在数据信息采集模块获取该已存在数据的最早写入时间以及已存在数据在当前所处的Block内的信息判断待写入数据的写入的Block。(The invention discloses a data migration system and a method for a computer, the data migration system comprises a block division module, a keyword acquisition module and a stored data information acquisition module, the Block division module collects the wear values of all blocks in the SSD in advance, divides all blocks into a first Block, a second Block and a third Block according to the range of the wear values, wherein the wear value of the first Block is greater than that of the second Block, the wear value of the second Block is greater than that of the third Block, the keyword collection module is used for collecting keywords of data to be written into as first keywords, when the SSD searches for existing data that includes the first key, and when the existing data that includes the first key is stored in the SSD, and enabling the existing data information acquisition module to acquire the earliest writing time of the existing data and the information of the existing data in the current Block to judge the Block of the writing of the data to be written.)

1. A data migration system for a computer is characterized by comprising a block dividing module, a keyword acquisition module and a stored data information acquisition module, the Block division module collects the wear values of all blocks in the SSD in advance, divides all blocks into a first Block, a second Block and a third Block according to the range of the wear values, wherein the wear value of the first Block is greater than that of the second Block, the wear value of the second Block is greater than that of the third Block, the keyword collection module is used for collecting keywords of data to be written into as first keywords, when the SSD searches for existing data that includes the first key, and when the existing data that includes the first key is stored in the SSD, and enabling the existing data information acquisition module to acquire the earliest writing time of the existing data and the information of the existing data in the current Block to judge the Block of the writing of the data to be written.

2. The data migration system for computer according to claim 1, wherein: the existing data information acquisition module comprises a time interval duration acquisition module, a running operation information acquisition module and a writing selection module, the time interval duration acquisition module is used for acquiring the time interval duration of the earliest writing time of the existing data and the preparation writing time of the to-be-written data, the running operation information acquisition module is used for acquiring the running operation information of the existing data writing Block when the time interval duration is larger than an interval duration threshold, the writing selection module writes the to-be-written data into a first Block or a second Block or a third Block according to the content of the running operation information acquisition module, the writing selection module comprises a first Block writing module, a second Block writing module and a third Block writing module, the first Block writing module is used for writing the to-be-written data into the first Block, the second Block writing module is used for writing the to-be-written data into the second Block, and the third Block writing module is used for writing the data to be written into the third Block.

3. The data migration system for computer according to claim 2, wherein: the operation information acquisition module comprises a time length division module, an erasing and writing frequency acquisition module, an erasing and writing frequency judgment module, a first erasing and writing comparison module and a second erasing and writing comparison module,

the time length dividing module is used for averagely dividing the time interval time length of the earliest writing time of the existing data and the preparation writing time of the data to be written into a first time length, a second time length and a third time length, the erasing times acquisition module acquires the erasing times c1, c2 and c3 of the existing data in the first time length, the second time length and the third time length in the current Block, the erasing times judging module is used for judging the relation between the erasing times c1, c2 and c3 and the erasing threshold c0, when two erase counts of the erase counts c1, c2, and c3 are equal to or more than the erase threshold c0, let the remaining erase/write count be cq1 and let the first erase/write comparison module perform processing, when two erase counts out of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, setting the remaining erasing times as cq2 and making the second erasing comparison module to process;

the first erasing comparison module comprises a first erasing phase difference comparison module and a first residual space comparison module, the first erasing phase difference comparison module calculates a first erasing phase difference according to the erasing times cq1 and an erasing threshold c0, compares the first erasing phase difference with a first erasing phase difference threshold, enables a third Block writing module to work when the first erasing phase difference cm is larger than or equal to the first erasing phase difference threshold, and enables the second Block writing module or the third Block writing module to work according to the situation of the residual space by comparing the first residual space comparison module with the residual space in which data is not written in the second Block and the third Block when the first erasing phase difference cm is smaller than the first erasing phase difference threshold;

the second erasing comparison module comprises a second erasing phase difference comparison module and a second residual space comparison module, the second erasing phase difference comparison module calculates a second erasing phase difference according to the erasing times cq2 and the erasing threshold c0, compares the second erasing phase difference with a second erasing phase difference threshold, enables the first Block writing module to work when the first erasing phase difference cn is larger than or equal to the first erasing phase difference threshold, enables the second residual space comparison module to compare residual spaces, in the first Block and the second Block, where data are not written, when the first erasing phase difference cm is smaller than the first erasing phase difference threshold, and enables the first Block writing module or the second Block writing module to work according to the situation of the residual spaces.

4. A data migration system for a computer according to claim 3, wherein: the data migration system further comprises a migration judgment module, wherein the migration judgment module comprises a Block comparison module, a third residual space comparison module and a data migration module, the Block comparison module is used for comparing the current Block of the existing data and the type of the Block written by the data to be written, when one of the current Block of the existing data and the Block written by the data to be written is a first Block, and the other is a third Block, the third residual space comparison module calculates a third spatial phase difference rate according to the residual space of the Block written by the data to be written and the residual space of the Block written by the data not written by the data, and when the third spatial phase difference rate is larger than or equal to a third spatial phase difference rate threshold value, the data migration module migrates the existing data from the original Block to the Block written by the data to be written.

5. A data migration method for a computer, characterized by: the data migration method comprises the following steps:

step S1: the method comprises the steps that the abrasion values of all blocks in a Solid State Drive (SSD) are collected in advance, and the blocks are divided into a first Block, a second Block and a third Block according to the range of the abrasion values, wherein the abrasion value of the first Block is larger than that of the second Block, and the abrasion value of the second Block is larger than that of the third Block;

step S2: acquiring a key word of data to be written to be ready to be written as a first key word, searching existing data containing the first key word in the SSD, if the existing data containing the first key word is stored in the SSD, acquiring the time interval duration between the earliest writing time of the existing data and the time to be ready to be written to the data to be written,

and when the time interval duration is greater than the interval duration threshold, acquiring running operation information of the written data Block, and judging the written data Block according to the running operation information.

6. The method of claim 5, wherein the method comprises: the step S2 of determining the writing method of the data to be written according to the operation information includes:

the time interval duration of the earliest writing time of the existing data and the preparation writing time of the data to be written is divided into a first duration, a second duration and a third duration on average,

acquiring erasing times c1, c2 and c3 of the existing data in the current Block within the first time length, the second time length and the third time length;

if two of the erase counts c1, c2, and c3 are greater than or equal to the erase threshold c0, the remaining erase count is cq1,

when the first erasing phase difference rate cm is larger than or equal to the first erasing phase difference rate threshold value, (cq1-c0)/c0, writing the data to be written into the third Block,

when the first erasure difference rate cm is smaller than the first erasure difference rate threshold value, (cq-c0)/c0, comparing the residual spaces of the second Block and the third Block, in which data are not written, to determine the writing mode of the data to be written;

if two of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, the remaining erase count is cq2,

when the second erasing phase difference rate cn is smaller than the second erasing phase difference rate threshold value (cq2-c0)/c0, writing the data to be written into the first Block;

when the second erasure difference rate cn (cq-c0)/c0 is greater than or equal to the second erasure difference rate threshold, comparing the remaining space of the first Block and the second Block where no data is written to determine the writing mode of the data to be written.

7. The method of claim 6, wherein:

the step of comparing the remaining space of the unwritten data in the second Block and the third Block to determine the writing mode of the data to be written comprises the following steps:

if (s3-s2)/s2 is greater than or equal to the first spatial phase difference rate threshold, the data to be written is written to a third Block,

if (s3-s2)/s2 is less than the first spatial phase difference rate threshold, the data to be written is written to a second Block,

the step of comparing the remaining space of the unwritten data in the first Block and the second Block to determine the writing mode of the data to be written comprises the following steps:

if (s1-s2)/s2 is greater than or equal to the second spatial phase difference rate threshold, the data to be written is written to the first Block,

if (s1-s2)/s2 is less than the second spatial phase difference rate threshold, the data to be written is written to the second Block,

where s1 is the remaining space of the first Block where no data is written, s2 is the remaining space of the second Block where no data is written, and s3 is the remaining space of the third Block where no data is written.

8. The method of claim 5, wherein the method comprises: the data migration method comprises the following steps:

step S3: if one of the Block in which the existing data is currently located and the Block into which the data to be written is the first Block, and the other is the third Block,

let Sc be the residual space of Block unwritten data to be written with data, Sx be the residual space of Block unwritten data where data exists currently,

and if the third spatial difference rate Sm is greater than or equal to the third spatial difference rate threshold, migrating the existing data from the original Block to the Block to which the data to be written is written.

9. The method of claim 5, wherein the method comprises: the step S2 further includes:

and if the SSD does not have existing data containing the first key or the time interval duration is less than or equal to the interval duration threshold, writing the data to be written into a second Block.

Technical Field

The invention relates to the technical field of computers, in particular to a data migration system and a data migration method for a computer.

Background

The SSD is a short-term solid state drive, also called solid state disk, which is a hard disk made of a solid state electronic memory chip array, has the advantages of fast read/write speed, shock and fall resistance, low power consumption, no noise, large working temperature range, portability, etc., and is widely used in a variety of fields such as military, vehicle-mounted, industrial control, video monitoring, network terminal, electric power, medical treatment, aviation, navigation equipment, etc. In the prior art, when the SSD is frequently erased in a certain area, the area is worn more, which affects the service life of the SSD.

Disclosure of Invention

The present invention is directed to a system and method for migrating data for a computer, so as to solve the problems in the background art.

In order to solve the technical problems, the invention provides the following technical scheme: a data migration system for a computer comprises a block dividing module, a keyword acquisition module and a stored data information acquisition module, the Block division module collects the wear values of all blocks in the SSD in advance, divides all blocks into a first Block, a second Block and a third Block according to the range of the wear values, wherein the wear value of the first Block is greater than that of the second Block, the wear value of the second Block is greater than that of the third Block, the keyword collection module is used for collecting keywords of data to be written into as first keywords, when the SSD searches for existing data that includes the first key, and when the existing data that includes the first key is stored in the SSD, and enabling the existing data information acquisition module to acquire the earliest writing time of the existing data and the information of the existing data in the current Block to judge the Block of the writing of the data to be written.

Further, the existing data information acquisition module comprises a time interval duration acquisition module, a running operation information acquisition module and a write selection module, the time interval duration acquisition module is used for acquiring the time interval duration between the earliest write time of the existing data and the ready-to-write time of the to-be-written data, the running operation information acquisition module is used for acquiring the running operation information of the existing data write Block when the time interval duration is greater than an interval duration threshold, the write selection module writes the to-be-written data into a first Block, a second Block or a third Block according to the content of the running operation information acquisition module, the write selection module comprises a first Block write module, a second Block write module and a third Block write module, the first Block write module is used for writing the to-be-written data into the first Block, the second Block write module is used for writing the to-be-written data into the second Block, and the third Block writing module is used for writing the data to be written into the third Block.

Further, the operation information acquisition module comprises a time length division module, an erasing and writing frequency acquisition module, an erasing and writing frequency judgment module, a first erasing and writing comparison module and a second erasing and writing comparison module,

the time length dividing module is used for averagely dividing the time interval time length of the earliest writing time of the existing data and the preparation writing time of the data to be written into a first time length, a second time length and a third time length, the erasing times acquisition module acquires the erasing times c1, c2 and c3 of the existing data in the first time length, the second time length and the third time length in the current Block, the erasing times judging module is used for judging the relation between the erasing times c1, c2 and c3 and the erasing threshold c0, when two erase counts of the erase counts c1, c2, and c3 are equal to or more than the erase threshold c0, let the remaining erase/write count be cq1 and let the first erase/write comparison module perform processing, when two erase counts out of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, setting the remaining erasing times as cq2 and making the second erasing comparison module to process;

the first erasing comparison module comprises a first erasing phase difference comparison module and a first residual space comparison module, the first erasing phase difference comparison module calculates a first erasing phase difference according to the erasing times cq1 and an erasing threshold c0, compares the first erasing phase difference with a first erasing phase difference threshold, enables a third Block writing module to work when the first erasing phase difference cm is larger than or equal to the first erasing phase difference threshold, and enables the second Block writing module or the third Block writing module to work according to the situation of the residual space by comparing the first residual space comparison module with the residual space in which data is not written in the second Block and the third Block when the first erasing phase difference cm is smaller than the first erasing phase difference threshold;

the second erasing comparison module comprises a second erasing phase difference comparison module and a second residual space comparison module, the second erasing phase difference comparison module calculates a second erasing phase difference according to the erasing times cq2 and the erasing threshold c0, compares the second erasing phase difference with a second erasing phase difference threshold, enables the first Block writing module to work when the first erasing phase difference cn is larger than or equal to the first erasing phase difference threshold, enables the second residual space comparison module to compare residual spaces, in the first Block and the second Block, where data are not written, when the first erasing phase difference cm is smaller than the first erasing phase difference threshold, and enables the first Block writing module or the second Block writing module to work according to the situation of the residual spaces.

The data migration system further comprises a Block comparison module, a third residual space comparison module and a data migration module, wherein the Block comparison module is used for comparing the current Block where the existing data are located with the Block type written by the data to be written, when one of the current Block where the existing data are located and the Block written by the data to be written is a first Block, and the other is a third Block, the third residual space comparison module calculates a third spatial phase difference rate according to the residual space where the Block written by the data to be written is not written and the residual space where the Block written by the data are located is not written, and when the third spatial phase difference rate is greater than or equal to a third spatial phase difference rate threshold value, the data migration module migrates the existing data from the original Block to the Block written by the data to be written.

A data migration method for a computer, the data migration method comprising:

step S1: the method comprises the steps that the abrasion values of all blocks in a Solid State Drive (SSD) are collected in advance, and the blocks are divided into a first Block, a second Block and a third Block according to the range of the abrasion values, wherein the abrasion value of the first Block is larger than that of the second Block, and the abrasion value of the second Block is larger than that of the third Block;

step S2: acquiring a key word of data to be written to be ready to be written as a first key word, searching existing data containing the first key word in the SSD, if the existing data containing the first key word is stored in the SSD, acquiring the time interval duration between the earliest writing time of the existing data and the time to be ready to be written to the data to be written,

and when the time interval duration is greater than the interval duration threshold, acquiring running operation information of the written data Block, and judging the written data Block according to the running operation information.

Further, the step S2 of determining, according to the operation information, a writing method of the data to be written includes:

the time interval duration of the earliest writing time of the existing data and the preparation writing time of the data to be written is divided into a first duration, a second duration and a third duration on average,

acquiring erasing times c1, c2 and c3 of the existing data in the current Block within the first time length, the second time length and the third time length;

if two of the erase counts c1, c2, and c3 are greater than or equal to the erase threshold c0, the remaining erase count is cq1,

when the first erasing phase difference rate cm is larger than or equal to the first erasing phase difference rate threshold value, (cq1-c0)/c0, writing the data to be written into the third Block,

when the first erasure difference rate cm is smaller than the first erasure difference rate threshold value, (cq-c0)/c0, comparing the residual spaces of the second Block and the third Block, in which data are not written, to determine the writing mode of the data to be written;

if two of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, the remaining erase count is cq2,

when the second erasing phase difference rate cn is smaller than the second erasing phase difference rate threshold value (cq2-c0)/c0, writing the data to be written into the first Block;

when the second erasure difference rate cn is greater than or equal to the second erasure difference rate threshold, (cq-c0)/c0, comparing the remaining space of the first Block and the second Block where no data is written to determine the writing mode of the data to be written.

Further, the comparing the remaining space of the unwritten data in the second Block and the third Block to determine the writing mode of the data to be written includes:

if (s3-s2)/s2 is greater than or equal to the first spatial phase difference rate threshold, the data to be written is written to a third Block,

if (s3-s2)/s2 is less than the first spatial phase difference rate threshold, the data to be written is written to a second Block,

the step of comparing the remaining space of the unwritten data in the first Block and the second Block to determine the writing mode of the data to be written comprises the following steps:

if (s1-s2)/s2 is greater than or equal to the second spatial phase difference rate threshold, the data to be written is written to the first Block,

if (s1-s2)/s2 is less than the second spatial phase difference rate threshold, the data to be written is written to the second Block,

where s1 is the remaining space of the first Block where no data is written, s2 is the remaining space of the second Block where no data is written, and s3 is the remaining space of the third Block where no data is written.

Further, the data migration method includes:

step S3: if one of the Block in which the existing data is currently located and the Block into which the data to be written is the first Block, and the other is the third Block,

let Sc be the residual space of Block unwritten data to be written with data, Sx be the residual space of Block unwritten data where data exists currently,

and if the third spatial difference rate Sm is greater than or equal to the third spatial difference rate threshold, migrating the existing data from the original Block to the Block to which the data to be written is written.

Further, the step S2 further includes:

and if the SSD does not have existing data containing the first key or the time interval duration is less than or equal to the interval duration threshold, writing the data to be written into a second Block.

Compared with the prior art, the invention has the following beneficial effects: according to the method and the device, the data to be written and the data stored in the SSD are associated according to the key words, and the Block written with the data to be written is determined according to the erasing condition of the stored data in the Block, so that the condition that a certain area in the SSD is abraded greatly and the SSD is abraded unevenly is prevented.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:

FIG. 1 is a block diagram of a data migration system for computers according to the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.

Referring to fig. 1, the present invention provides a technical solution: a data migration system for a computer comprises a block dividing module, a keyword acquisition module and a stored data information acquisition module, the Block division module collects the wear values of all blocks in the SSD in advance, divides all blocks into a first Block, a second Block and a third Block according to the range of the wear values, wherein the wear value of the first Block is greater than that of the second Block, the wear value of the second Block is greater than that of the third Block, the keyword collection module is used for collecting keywords of data to be written into as first keywords, when the SSD searches for existing data that includes the first key, and when the existing data that includes the first key is stored in the SSD, and enabling the existing data information acquisition module to acquire the earliest writing time of the existing data and the information of the existing data in the current Block to judge the Block of the writing of the data to be written.

The existing data information acquisition module comprises a time interval duration acquisition module, a running operation information acquisition module and a writing selection module, the time interval duration acquisition module is used for acquiring the time interval duration of the earliest writing time of the existing data and the preparation writing time of the to-be-written data, the running operation information acquisition module is used for acquiring the running operation information of the existing data writing Block when the time interval duration is larger than an interval duration threshold, the writing selection module writes the to-be-written data into a first Block or a second Block or a third Block according to the content of the running operation information acquisition module, the writing selection module comprises a first Block writing module, a second Block writing module and a third Block writing module, the first Block writing module is used for writing the to-be-written data into the first Block, the second Block writing module is used for writing the to-be-written data into the second Block, and the third Block writing module is used for writing the data to be written into the third Block.

The operation information acquisition module comprises a time length division module, an erasing and writing frequency acquisition module, an erasing and writing frequency judgment module, a first erasing and writing comparison module and a second erasing and writing comparison module,

the time length dividing module is used for averagely dividing the time interval time length of the earliest writing time of the existing data and the preparation writing time of the data to be written into a first time length, a second time length and a third time length, the erasing times acquisition module acquires the erasing times c1, c2 and c3 of the existing data in the first time length, the second time length and the third time length in the current Block, the erasing times judging module is used for judging the relation between the erasing times c1, c2 and c3 and the erasing threshold c0, when two erase counts of the erase counts c1, c2, and c3 are equal to or more than the erase threshold c0, let the remaining erase/write count be cq1 and let the first erase/write comparison module perform processing, when two erase counts out of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, setting the remaining erasing times as cq2 and making the second erasing comparison module to process;

the first erasing comparison module comprises a first erasing phase difference comparison module and a first residual space comparison module, the first erasing phase difference comparison module calculates a first erasing phase difference according to the erasing times cq1 and an erasing threshold c0, compares the first erasing phase difference with a first erasing phase difference threshold, enables a third Block writing module to work when the first erasing phase difference cm is larger than or equal to the first erasing phase difference threshold, and enables the second Block writing module or the third Block writing module to work according to the situation of the residual space by comparing the first residual space comparison module with the residual space in which data is not written in the second Block and the third Block when the first erasing phase difference cm is smaller than the first erasing phase difference threshold;

the second erasing comparison module comprises a second erasing phase difference comparison module and a second residual space comparison module, the second erasing phase difference comparison module calculates a second erasing phase difference according to the erasing times cq2 and the erasing threshold c0, compares the second erasing phase difference with a second erasing phase difference threshold, enables the first Block writing module to work when the first erasing phase difference cn is larger than or equal to the first erasing phase difference threshold, enables the second residual space comparison module to compare residual spaces, in the first Block and the second Block, where data are not written, when the first erasing phase difference cm is smaller than the first erasing phase difference threshold, and enables the first Block writing module or the second Block writing module to work according to the situation of the residual spaces.

The data migration system further comprises a Block comparison module, a third residual space comparison module and a data migration module, wherein the Block comparison module is used for comparing the type of a Block in which the existing data is located at present with the type of a Block in which the data to be written is written, when one of the Block in which the existing data is located at present and the Block in which the data to be written is a first Block, and the other is a third Block, the third residual space comparison module calculates a third spatial phase difference rate according to the residual space in which the data is not written in by the Block in which the data to be written is written and the residual space in which the data is not written by the Block in which the data is located at present, and when the third spatial phase difference rate is larger than or equal to a third spatial phase difference rate threshold value, the data migration module migrates the existing data from the original Block to the Block in which the data to be written is written.

A data migration method for a computer, the data migration method comprising:

step S1: the method comprises the steps that the abrasion values of blocks (blocks) in a solid state drive SSD are collected in advance, and the blocks are divided into a first Block, a second Block and a third Block according to the range of the abrasion values, wherein the abrasion value of the first Block is larger than that of the second Block, and the abrasion value of the second Block is larger than that of the third Block; when a Block in the SSD is divided, a first abrasion value threshold value and a second abrasion value threshold value can be determined according to the size of the abrasion value range of the Block, the first abrasion value threshold value is larger than or equal to the second abrasion value threshold value, when the abrasion value of the Block is larger than or equal to the first abrasion value threshold value, the Block is the first Block, when the abrasion value of the Block is larger than or equal to the second abrasion value threshold value and the abrasion value of the Block is smaller than the first abrasion value threshold value, the Block is the second Block, and when the abrasion value of the Block is smaller than the second abrasion value threshold value, the Block is the third Block;

step S2: acquiring a keyword of data to be written as a first keyword, searching existing data containing the first keyword in the SSD, if the existing data containing the first keyword is stored in the SSD, acquiring the time interval duration of the earliest writing time of the existing data and the time to be written of the data to be written, and searching for the association between the data to be written and the existing data through the first keyword so as to be convenient for subsequently determining the Block for writing the data to be written;

when the time interval duration is greater than the interval duration threshold, acquiring running operation information of the written data Block, and judging the written data Block according to the running operation information; when the existing data in the SSD exceeds a certain time, the erasing and writing conditions of the existing data in the SSD are closer to the actual conditions that the data to be written is stored in the Block, and the existing data has referential property.

If the SSD does not have existing data containing the first key words or the time interval duration is less than or equal to the interval duration threshold, writing the data to be written into a second Block;

the step S2 of determining the writing method of the data to be written according to the operation information includes:

the time interval duration of the earliest writing time of the existing data and the preparation writing time of the data to be written is divided into a first duration, a second duration and a third duration on average,

acquiring erasing times c1, c2 and c3 of the existing data in the current Block within the first time length, the second time length and the third time length;

if two of the erase counts c1, c2, and c3 are greater than or equal to the erase threshold c0, the remaining erase count is cq1,

when the first erasing phase difference rate cm is larger than or equal to the first erasing phase difference rate threshold value, (cq1-c0)/c0, writing the data to be written into the third Block,

when the first erasure difference rate cm is smaller than the first erasure difference rate threshold value, (cq-c0)/c0, comparing the residual spaces of the second Block and the third Block, in which data are not written, to determine the writing mode of the data to be written;

if two of the erase counts c1, c2 and c3 are smaller than the erase threshold c0, the remaining erase count is cq2,

when the second erasing phase difference rate cn is smaller than the second erasing phase difference rate threshold value (cq2-c0)/c0, writing the data to be written into the first Block;

when the second erasing phase difference rate cn is greater than or equal to the second erasing phase difference rate threshold, (cq-c0)/c0, comparing the remaining space of the first Block and the second Block where no data is written to determine the writing mode of the data to be written;

the erasing threshold c0 is determined according to the average erasing times in the first Block, the second Block and the third Block, wherein the average erasing times of the first Block is the average of all the erasing times of the first Block in the SSD, and the average erasing times in the second Block and the third Block are the same; comparing the erasing times c1, c2 and c3 with an erasing threshold c0, and comparing the erasing phase difference rate with the erasing phase difference rate threshold to judge whether the existing data have a high erasing time or a low erasing time in a certain time period in the SSD, so that the Block for writing the data to be written is determined according to the erasing times of the existing data;

the step of comparing the remaining space of the unwritten data in the second Block and the third Block to determine the writing mode of the data to be written comprises the following steps:

if (s3-s2)/s2 is greater than or equal to the first spatial phase difference rate threshold, the data to be written is written to a third Block,

if (s3-s2)/s2 is less than the first spatial phase difference rate threshold, the data to be written is written to a second Block,

the step of comparing the remaining space of the unwritten data in the first Block and the second Block to determine the writing mode of the data to be written comprises the following steps:

if (s1-s2)/s2 is greater than or equal to the second spatial phase difference rate threshold, the data to be written is written to the first Block,

if (s1-s2)/s2 is less than the second spatial phase difference rate threshold, the data to be written is written to the second Block,

where s1 is the remaining space of the first Block where no data is written, s2 is the remaining space of the second Block where no data is written, and s3 is the remaining space of the third Block where no data is written.

The data migration method comprises the following steps:

step S3: if one of the Block in which the existing data is currently located and the Block into which the data to be written is the first Block, and the other is the third Block,

let Sc be the residual space of Block unwritten data to be written with data, Sx be the residual space of Block unwritten data where data exists currently,

and if the third spatial phase difference rate Sm is greater than or equal to the third spatial phase difference rate threshold value, (Sc-Sx)/Sx, migrating the existing data from the original Block to the Block to be written with the data, and further optimizing the SSD.

The historical erasing condition of the existing data is used as the reference erasing condition of the data to be written, so that proper Block is selected for the data to be written to keep the abrasion in the SSD balanced, the writing position of the data to be written is prevented from being adjusted after the data to be written is stored, and the writing efficiency of the data to be written is improved.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.

Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种针对超融合架构的存储空间优化方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类