CN108874683A - The method and computer equipment of the garbage reclamation of solid storage device - Google Patents

The method and computer equipment of the garbage reclamation of solid storage device Download PDF

Info

Publication number
CN108874683A
CN108874683A CN201810542520.3A CN201810542520A CN108874683A CN 108874683 A CN108874683 A CN 108874683A CN 201810542520 A CN201810542520 A CN 201810542520A CN 108874683 A CN108874683 A CN 108874683A
Authority
CN
China
Prior art keywords
data block
data
recycled
computer equipment
block
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.)
Withdrawn
Application number
CN201810542520.3A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810542520.3A priority Critical patent/CN108874683A/en
Publication of CN108874683A publication Critical patent/CN108874683A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

The embodiment of the present application discloses the method and computer equipment of a kind of garbage reclamation of solid storage device, for improving the flexibility for carrying out garbage reclamation to the data block to be recycled of solid storage device.The embodiment of the present application method includes:Computer equipment determines that the data block to be recycled in the solid storage device, the data block to be recycled are to be stored with the data block of the data of write-in;The computer equipment generates list according to the data block to be recycled, and the list includes the relevant information of the data block to be recycled;The computer equipment judges the data stored in data block to be recycled described in the list with the presence or absence of valid data;If so, the valid data are copied in the freed data blocks of the solid storage device by the computer equipment, the freed data blocks are the not stored data block for having data in the solid storage device;The computer equipment discharges memory space corresponding to data block to be recycled described in the list.

Description

The method and computer equipment of the garbage reclamation of solid storage device
Technical field
This application involves nnir Rtorae technologies more particularly to a kind of methods and meter of the garbage reclamation of solid storage device Calculate machine equipment.
Background technique
With the development of nnir Rtorae technologies, solid storage device using more and more extensive.And solid storage device is deposited Storage data are in such a way that computer equipment redirects write-in data, i.e., the data of the write-in before same memory address are under When data are written in primary same memory address again, then the data being written before are changing to invalid data.Therefore, solid-state is deposited Invalid data needs to carry out garbage reclamation in storage equipment, i.e., to the deletion of invalid data.
Currently, the mode of garbage reclamation is mainly to pass through computer equipment in the process of write-in data in solid storage device In, data to be written stores in data block corresponding to the target memory address into solid storage device, then, write-in The data that this memory address of data has been written into originally are changing to invalid data, then the invalid data has been determined at this time When it is necessary to delete the invalid data, i.e. garbage reclamation realizes that the storage of data block corresponding to release invalid data is empty Between.
Therefore, computer equipment carries out garbage reclamation processing to the invalid data of data block and depends on computer equipment at present The process of data block is write data to, i.e. computer equipment can only be in the process of write-in data to invalid data progress garbage reclamation Middle processing results in discharging in time to the memory space of the data block where the invalid data in solid storage device Limitation is larger, and flexibility is poor.
Summary of the invention
The embodiment of the present application provides the method and computer equipment of a kind of garbage reclamation of solid storage device, is used for Improve the flexibility that garbage reclamation is carried out to the data block to be recycled of solid storage device.
In a first aspect, the embodiment of the present application provides a kind of method of the garbage reclamation of solid storage device, the method Including:
Computer equipment determines that the data block to be recycled in the solid storage device, the data block to be recycled are storage There is the data block of the data of write-in;
The computer equipment generates list according to the data block to be recycled, and the list includes the number to be recycled According to the relevant information of block;
The computer equipment judges the data stored in data block to be recycled described in the list with the presence or absence of effective Data;
If so, the valid data are copied to the freed data blocks of the solid storage device by the computer equipment In, the freed data blocks are the not stored data block for having data in the solid storage device;
The computer equipment discharges memory space corresponding to data block to be recycled described in the list.
In a kind of possible implementation, if the computer equipment determines that there is no significant figures in data block to be recycled According to, the method also includes:
The computer equipment discharges memory space corresponding to data block to be recycled described in the list.
In alternatively possible implementation, the computer equipment determines data to be recycled in the solid storage device After block, before the computer equipment generates list according to the data block to be recycled, the method also includes:
The computer equipment determines that the number of the data block to be recycled is greater than predetermined number;
The computer equipment determines the invalid data accounting of each data block in the data block to be recycled;
The computer equipment determines that invalid data accounting is greater than the target of preset threshold from the data block to be recycled Data block.
The computer equipment generates list according to the data block to be recycled:
The number of the target data block is filled in list described in the computer equipment, the list includes the mesh Mark the relevant information of data block.
In alternatively possible implementation, the computer equipment discharges data block institute to be recycled described in the list Corresponding memory space includes:
The computer equipment preferentially discharges in the target data block corresponding to the maximum data block of invalid data accounting Memory space.
In alternatively possible implementation, the computer equipment discharges data block institute to be recycled described in the list After corresponding memory space, the method also includes:
The computer equipment detects the release of memory space corresponding to the data block to be recycled according to preset duration Situation;
When the computer equipment determines memory space corresponding to the first data block in the data block to be recycled not When release is completed, the computer equipment fills in the number of first data block into the list, so that the meter Machine equipment is calculated to discharge memory space corresponding to first data block.
In alternatively possible implementation, the computer equipment determines the number to be recycled in the solid storage device Include according to block:
The computer equipment determines the solid storage device according to the assignment bit map rolled up in the solid storage device In data block to be recycled.
In alternatively possible implementation, the computer equipment judges the data stored in the data block to be recycled Include with the presence or absence of valid data:
The computer equipment judges whether each physical block in the data block to be recycled sets with the solid-state storage There are mapping relations for logical block in standby;
If so, the computer equipment determines the data that store in the data block to be recycled, there are valid data;
If it is not, then the computer equipment determines that valid data are not present in the data stored in the data block to be recycled.
Second aspect, the embodiment of the present application provide a kind of computer equipment, and the computer equipment includes:
First determination unit, for determining data block to be recycled in the solid storage device, the data block to be recycled For be stored with write-in data data block;
Generation unit, for generating list according to the data block to be recycled, the list includes the number to be recycled According to the relevant information of block;
Judging unit, the data for judging to store in the data block to be recycled whether there is valid data;
Copy cell, if it is effective to determine that the data stored in the data block to be recycled exist for the computer equipment The valid data are copied in the freed data blocks of the solid storage device by data, and the freed data blocks are described The not stored data block for having data in solid storage device;
Releasing unit, for discharging memory space corresponding to data block to be recycled described in the list.
In a kind of possible implementation, the releasing unit is also used to:
If the computer equipment determines that valid data are not present in the data stored in the data block to be recycled, institute is discharged State memory space corresponding to data block to be recycled in list.
In alternatively possible implementation, the computer equipment further includes:
Second determination unit, for determining that the number of the data block to be recycled is greater than predetermined number;
Third determination unit, for determining the invalid data accounting of each data block in data block to be recycled;
4th determination unit, for determining that invalid data accounting is greater than the mesh of preset threshold from the data block to be recycled Mark data block;
The generation unit is specifically used for:
The number of the target data block is filled in list, the list includes the related letter of the target data block Breath.
In alternatively possible implementation, the releasing unit is specifically used for:
Preferentially discharge memory space corresponding to the maximum data block of invalid data accounting in the target data block.
In alternatively possible implementation, the computer equipment further includes:
Detection unit, for detecting the release feelings of memory space corresponding to the data block to be recycled according to preset duration Condition;
Unit is filled in, for determining corresponding to the first data block in the data block to be recycled when the computer equipment Memory space when not discharging completion, the number of first data block is filled in into the list, so that the calculating Machine equipment discharges memory space corresponding to first data block.
In alternatively possible implementation, first determination unit is specifically used for:
The data to be recycled in the solid storage device are determined according to the assignment bit map rolled up in the solid storage device Block.
In alternatively possible implementation, the judging unit is specifically used for:
Judge whether each physical block in the data block to be recycled is deposited with the logical block in the solid storage device In mapping relations;
If so, there are valid data for the data stored in the determining data block to be recycled;
If not, it is determined that valid data are not present in the data stored in the data block to be recycled.
As can be seen from the above technical solutions, the embodiment of the present application has the following advantages that:
It, should be to as can be seen from the above technical solutions, computer equipment determines the data block to be recycled in solid storage device Recovered data block is the data block for being stored with write-in data;Then list is generated according to the data block to be recycled, is deposited in the list The relevant information of the data block to be recycled is contained, then computer equipment judges that the data stored in the data block to be recycled are again No there are valid data, should if storage, which is copied in the freed data blocks of the solid storage device Freed data blocks are the not stored data block for having data in the solid storage device, and then computer equipment can discharge the list In memory space corresponding to data block to be recycled.Therefore, by the technical solution of the application, pass through determination data to be recycled Then valid data in data block to be recycled are copied in idle data block, then discharge the data to be recycled by block Memory space corresponding to block, therefore, the release for treating memory space corresponding to recovered data block, which is not need to rely on, to be write It is immediately treated during entering data to data block, therefore, storage corresponding to recovered data block is treated in the scheme of the application There is no limit at any time handled invalid data, therefore, the application is deposited to solid-state in time for the release in space The flexibility for storing up the data block to be recycled progress garbage reclamation of equipment is higher.
Detailed description of the invention
Fig. 1 is one of the embodiment of the present application application scenarios block schematic illustration;
Fig. 2 is one embodiment schematic diagram of the method for the garbage reclamation of solid storage device in the embodiment of the present application;
Fig. 3 is another embodiment schematic diagram of the method for the garbage reclamation of solid storage device in the embodiment of the present application;
Fig. 4 is a kind of structural schematic diagram of computer equipment in the embodiment of the present application;
Fig. 5 is another structural schematic diagram of computer equipment in the embodiment of the present application.
Specific embodiment
The embodiment of the present application provides the method and computer equipment of a kind of garbage reclamation of solid storage device, is used for Improve the flexibility that garbage reclamation is carried out to the data block to be recycled of solid storage device.
Referring to Fig. 1, Fig. 1 is one of the embodiment of the present application application scenarios system framework schematic diagram, wherein computer The scanning for the invalid data that equipment is used to generate solid storage device and to the processing of invalid data, realization is to solid-state storage Memory space corresponding to the data block that the garbage collection operation of equipment, i.e. release invalid data are stored in.Solid-state storage is set The data of storage computer equipment write-in are ready for use on, which can be solid state hard disk, wherein solid state hard disk uses Redirect the mode of write-in data.For example, the solid storage device using flash memory as storage medium, distributes write-in by rolling up Data cell, the data being written every time distribute new data cell, therefore, during data are written in long-time, will go out Now a large amount of invalid datas are stored in corresponding data cell, and therefore, it is necessary to the invalid data stored to solid storage device progress It deletes, i.e. garbage collection operation.
It should be noted that the solid storage device can be a module in the computer equipment, it is also possible to list Only solid storage device, without limitation to this application.A kind of scene of application scheme is merely to illustrate that for Fig. 1 Schematic diagram.
It is carried out below from method of the angle of computer equipment to the garbage reclamation of the solid storage device of the application detailed Description, referring to Fig. 2, one embodiment of the method for the garbage reclamation of solid storage device includes in the embodiment of the present application:
201, computer equipment determines data block to be recycled in the solid storage device.
When needing to carry out garbage collection operation to solid storage device, computer equipment can determine that the solid-state is deposited at this time Store up data block to be recycled in equipment, wherein the data block to be recycled is the number that write-in data are stored in the solid storage device According to block.Specifically, the computer equipment can be determined by the assignment bit map of the volume in the solid storage device it is stored There is the data block of write-in data, can also determine by other means, specific the application is without limitation.
202, computer equipment generates list according to data block to be recycled.
Computer equipment can generate list according to the data block to be recycled, wherein the list is stored with data to be recycled The relevant information of block.Specifically, computer equipment can fill in the number of data block to be recycled to list, stored in the list Need the relevant information of recovered data block, wherein the relevant information can be the number etc. of the data block to be recycled.
203, computer equipment judges that the data stored in the data block to be recycled whether there is valid data, if so, Execute step 204;If it is not, thening follow the steps 206.
Computer equipment may determine that the data stored in the data block to be recycled with the presence or absence of valid data, if deposited Then step 204 is executed, if it does not, so executing step 206.Specifically, the computer equipment can according to this to Whether there are mapping relations with the logical block of the solid storage device for each physical block in recovered data block, if it does, that Computer equipment can determine the data that store in the data block to be recycled, and there are valid data, if it does not, so counting Calculating machine equipment can determine that valid data are not present in the data stored in the data block to be recycled.
204, the valid data are copied in the freed data blocks of the solid storage device by computer equipment.
If computer equipment determines that the valid data can be copied to this by computer equipment there are valid data In the freed data blocks of solid storage device.
205, computer equipment discharges memory space corresponding to the data block to be recycled of this in the list.
After the completion of computer equipment copies valid data, which can discharge data to be recycled in the list Memory space corresponding to block realizes the garbage collection operation to the data block to be recycled.
206, computer equipment executes other operations.
If the computer equipment determines that valid data are not present in the data stored in the data block to be recycled, calculate Machine equipment can execute other operations, for example, can directly discharge memory space corresponding to the data block to be recycled.
In the embodiment of the present application, computer equipment determines the data block to be recycled in solid storage device, the number to be recycled It is the data block for being stored with write-in data according to block;Then list is generated according to the data block to be recycled, is stored with this in the list The relevant information of data block to be recycled, then computer equipment judges that the data stored in the data block to be recycled whether there is again Valid data, if storage, which is copied in the freed data blocks of the solid storage device, the free time number It is the not stored data block for having data in the solid storage device according to block, then computer equipment can discharge in the list wait return Receive memory space corresponding to data block.Therefore, by the technical solution of the application, by determination data block to be recycled, then Valid data in data block to be recycled are copied in idle data block, then discharged corresponding to the data block to be recycled Memory space, therefore, the release for treating memory space corresponding to recovered data block, which is not need to rely on, to be write data to It is immediately treated during data block, therefore, releasing for memory space corresponding to recovered data block is treated in the scheme of the application Put in time there is no limit, invalid data is handled at any time, therefore, the application is to solid storage device The flexibility that data block to be recycled carries out garbage reclamation is higher.
In the embodiment of the present application, computer equipment determines that the data block to be recycled in solid storage device can be computer Equipment determines the distribution data block in solid storage device according to the assignment bit map of the volume of solid storage device, this has distributed number It is data block to be recycled according to block, computer equipment can also determine data block to be recycled by other means, specifically herein Without limitation.In subsequent embodiment only by taking computer equipment determines data block to be recycled according to the assignment bit map of volume as an example It is illustrated.
In the embodiment of the present application, computer equipment carries out discharging it treating memory space corresponding to recovered data block Afterwards, computer equipment can detect the release conditions of memory space corresponding to data block to be recycled according to preset duration, when this When computer equipment determines that memory space corresponding to the first data block in the data block to be recycled does not discharge completion, count at this time Calculating machine equipment can fill in the number of first data block into the list, allow the computer equipment to first number It is discharged again according to the memory space of block.By the inspection for treating the release conditions of memory space corresponding to recovered data block It surveys, application scheme is enabled to be truly realized release completely in the release for treating memory space corresponding to recovered data block.
In the embodiment of the present application, computer equipment judges the data stored in data block to be recycled with the presence or absence of valid data Can be computer equipment judge in the data block to be recycled each physical block whether with the logical block in the solid storage device There are mapping relations, and if there is that can determine the data block to be recycled, there are valid data, if it does not, so can be true Valid data are not present in the fixed data block to be recycled;Computer equipment can also judge the data to be recycled by other means Block whether there is valid data, and the application does not limit this, and in subsequent embodiment, only passes through judgement with computer equipment Whether there are mapping relations to determine this with logical block in the solid storage device for each physical block in the data block to be recycled Data block to be recycled is illustrated for whether there is valid data.
In the embodiment of the present application, determined in solid storage device after data block to be recycled in computer equipment, the meter The number of the data block to be recycled can also be determined by calculating machine equipment, then determine that the number of the data block to be recycled is greater than default When number, computer equipment can determine the invalid data accounting of each data block in the data block to be recycled, and then determining should Invalid data accounting in data block to be recycled is greater than the target data block of preset threshold, then the number of the target data block is filled out It is written in list, which includes the number of the target data block, and the embodiment is discussed in detail below by Fig. 3, please join Fig. 3 is read, another embodiment of the method for the garbage reclamation of solid storage device includes in the embodiment of the present application:
301, computer equipment determines data block to be recycled according to the assignment bit map rolled up in solid storage device.
Computer equipment can divide according to the assignment bit map of the volume of solid storage device to determine in solid storage device The data block matched, the allocated data block are to be stored with the data block of write-in data, and then computer equipment can determine this Allocated data block is the data block to be recycled.
302, computer equipment determines that the number of the data block to be recycled is more than predetermined number.
After computer equipment has determined data block to be recycled, which can determine the data block to be recycled Number is greater than predetermined number.It should be noted that when the computer equipment determines the number of the data block to be recycled no more than pre- If when number, computer equipment can directly be handled the data block to be recycled at this time.
303, computer equipment determines the invalid data accounting of each data block of the data block to be recycled.
Computer equipment determines that the number of data block to be recycled is greater than predetermined number, then computer equipment can be true at this time The invalid data accounting of each data block in the fixed data block to be recycled, it is to be recycled by this specifically to can be computer equipment There are the physical block accounting of mapping relations determines invalid data accounting with the logical block of data block to be recycled in data block.
304, computer equipment determines that invalid data accounting is greater than the number of targets of preset threshold from the data block to be recycled According to block.
Computer equipment can determine that invalid data accounting is greater than the target data of preset threshold from data block to be recycled Block.For example, computer equipment chooses 100 data blocks to be recycled greater than preset threshold from data block to be recycled.
305, computer equipment fills in the number of the target data block to list.
Computer equipment can the number of target data block of the determination fill in into list, for example, being determined in step 304 100 data blocks to be recycled, then computer equipment can fill in the number of 100 data blocks to be recycled to list at this time In, wherein fill in list number can with when filled according to the size of invalid data accounting, it can be by invalid data The maximum target data block of accounting is placed in list foremost, and the smallest target data block of invalid data accounting is placed in list Backmost.
306, computer equipment determines that the physical block in the target data block exists and the logical block in target data block Mapping relations.
Computer equipment can determine that the mapping relations of the logical block of physical block and target data block in target data block are deposited ?.It should be noted that when the computer equipment determines that computer equipment can determine the mesh at this time there is no when mapping relations It marks data block and invalid data is not present, then garbage reclamation directly can be carried out to the target data block.
307, computer equipment determines the data that store in the target data block there are valid data.
Computer equipment has determined that mapping relations exist, then computer equipment can determine target data block storage Valid data in data, specifically can with when the computer equipment determine corresponding physical block according to the mapping relations, then really The valid data stored in the fixed corresponding physical block.
308, valid data are copied in the freed data blocks of solid storage device by computer equipment.
309, memory space corresponding to computer equipment release target data block.
Step 308 is similar to step 205 with the step 204 in earlier figures 2 to step 309, and specific details are not described herein again.
Need to illustrate when, computer equipment, can be with when discharging to memory space corresponding to target data block The maximum data block of invalid data accounting is effectively treated, be can also be and randomly selected a target data block and then located Reason, the application do not limit this.
310, computer equipment detects the release conditions of memory space corresponding to target data block according to preset duration.
After computer equipment discharges memory space corresponding to target data block, computer equipment can be according to Preset duration detects the release conditions of memory space corresponding to target data block.
311, computer equipment fills in the number of the first data block into list.
When computer equipment is by detecting the release of memory space corresponding to the first data block determined in target data block When not completing, computer equipment can again be filled in the number of first data block into list at this time.It should be noted that The number of first data block is filled in that can be filled in list foremost when list, so that the computer equipment is preferentially located Manage the invalid data stored in first data block.
312, computer equipment discharges memory space corresponding to first data block.
Computer equipment again fills in the first data block to list, and computer equipment can discharge first data block Corresponding memory space.
In the embodiment of the present application, computer equipment determines the data block to be recycled in solid storage device, the number to be recycled It is the data block for being stored with write-in data according to block;Then list is generated according to the data block to be recycled, is stored with this in the list The relevant information of data block to be recycled, then computer equipment judges that the data stored in the data block to be recycled whether there is again Valid data, if storage, which is copied in the freed data blocks of the solid storage device, the free time number It is the not stored data block for having data in the solid storage device according to block, then computer equipment can discharge in the list wait return Receive memory space corresponding to data block.Therefore, by the technical solution of the application, by determination data block to be recycled, then Valid data in data block to be recycled are copied in idle data block, then discharged corresponding to the data block to be recycled Memory space, therefore, the release for treating memory space corresponding to recovered data block, which is not need to rely on, to be write data to It is immediately treated during data block, therefore, releasing for memory space corresponding to recovered data block is treated in the scheme of the application Put in time there is no limit, invalid data is handled at any time, therefore, the application is to solid storage device The flexibility that data block to be recycled carries out garbage reclamation is higher.
The method of the above-mentioned garbage reclamation to the application solid storage device is described, and is deposited below to the application solid-state The computer equipment for storing up the garbage reclamation of equipment describes in detail, referring to Fig. 4, wherein, the second determination unit 406, third Determination unit 407, the 4th determination unit 408, detection unit 409 and fill in unit 410 be selectable unit, the embodiment of the present application One embodiment of middle computer equipment includes:
First determination unit 401, for determining data block to be recycled in solid storage device, which is to deposit Contain the data block of the data of write-in;
Generation unit 402, for generating list according to the data block to be recycled, which includes the data block to be recycled Relevant information;
Judging unit 403, the data for judging to store in the data block to be recycled whether there is valid data;
Copy cell 404, if it is effective to determine that the data stored in the data block to be recycled exist for the computer equipment The valid data are copied in the freed data blocks of the solid storage device by data, which is that the solid-state is deposited Store up the not stored data block for there are data in equipment;
Releasing unit 405, for discharging memory space corresponding to the data block to be recycled of this in the list.
In the present embodiment, which is also used to:
If the computer equipment determines that valid data are not present in the data stored in the data block to be recycled, the list is discharged In memory space corresponding to data block to be recycled.
In the present embodiment, which further includes:
Second determination unit 406, for determining that the number of the data block to be recycled is greater than predetermined number;
Third determination unit 407, for determining the invalid data accounting of each data block in data block to be recycled;
4th determination unit 408, for determining that invalid data accounting is greater than preset threshold from the data block to be recycled Target data block;
The generation unit 402 is specifically used for:
The number of the target data block is filled in list, which includes the relevant information of the target data block.
In the present embodiment, which is specifically used for:
Preferentially discharge memory space corresponding to the maximum data block of invalid data accounting in the target data block.
In the present embodiment, which further includes:
Detection unit 409, for detecting the release of memory space corresponding to the data block to be recycled according to preset duration Situation;
Unit 410 is filled in, for determining corresponding to the first data block in the data block to be recycled when the computer equipment Memory space when not discharging completion, the number of first data block is filled in into the list, so that the computer equipment Memory space corresponding to first data block is discharged.
In the present embodiment, which is specifically used for:
The data block to be recycled in the solid storage device is determined according to the assignment bit map rolled up in the solid storage device.
In the present embodiment, which is specifically used for:
Judge that each physical block in the data block to be recycled whether there is and the logical block in the solid storage device Mapping relations;
If so, there are valid data for the data stored in the determining data block to be recycled;
If not, it is determined that valid data are not present in the data stored in the data block to be recycled.
In the embodiment of the present application, the first determination unit 401 determines the data block to be recycled in solid storage device, should be wait return Receiving data block is to be stored with the data block of write-in data;Then generation unit 402 generates list according to the data block to be recycled, should The relevant information of the data block to be recycled is stored in list, then judging unit 403 judges to deposit in the data block to be recycled again The data of storage whether there is valid data, if the valid data are copied to the solid-state storage by storage, copy cell 404 In the freed data blocks of equipment, which is the not stored data block for having data in the solid storage device, is then released Memory space corresponding to data block to be recycled in the list can be discharged by putting unit 405.Therefore, pass through the technical side of the application Case determines data block to be recycled by the first determination unit 401, and then copy cell 404 is by having in data block to be recycled It imitates in data copy to idle data block, releasing unit 405 discharges memory space corresponding to the data block to be recycled again, Therefore, the release for treating memory space corresponding to recovered data block is not need to rely in the process for writing data to data block In immediately treat, therefore, the release that memory space corresponding to recovered data block is treated in the scheme of the application does not have in time It is restricted, invalid data is handled at any time, therefore, the application is in the data block to be recycled to solid storage device The flexibility for carrying out garbage reclamation is higher.
The application also provides a kind of computer equipment 500, referring to Fig. 5, computer equipment 500 1 in the embodiment of the present application A embodiment includes:
Processor 501, memory 502, input-output equipment 503 and bus 504;
The processor 501, memory 502, input-output equipment 503 are connected with bus 504 respectively, in the memory 502 It is stored with computer instruction;
For the processor 501 for determining data block to be recycled in solid storage device, which is to be stored with The data block of the data of write-in;List is generated according to the data block to be recycled, which includes the phase of the data block to be recycled Close information;Judge the data stored in the data block to be recycled with the presence or absence of valid data;It should be to if the computer equipment determines There are valid data for the data stored in recovered data block, which is copied to the idle data of the solid storage device In block, which is the not stored data block for having data in the solid storage device;Discharging should be wait return in the list Receive memory space corresponding to data block.
In a kind of possible implementation, which is also used to:
If the computer equipment determines that valid data are not present in the data stored in the data block to be recycled, the list is discharged In memory space corresponding to data block to be recycled.
In alternatively possible implementation, which is also used to:
Determine that the number of the data block to be recycled is greater than predetermined number;
Determine the invalid data accounting of each data block in data block to be recycled;
Determine that invalid data accounting is greater than the target data block of preset threshold from the data block to be recycled;
The processor 501 is specifically used for:
The number of the target data block is filled in list, which includes the relevant information of the target data block.
In alternatively possible implementation, which is specifically used for:
Preferentially discharge memory space corresponding to the maximum data block of invalid data accounting in the target data block.
In alternatively possible implementation, which is also used to:
The release conditions of memory space corresponding to the data block to be recycled are detected according to preset duration;
When the computer equipment determines that memory space corresponding to the first data block in the data block to be recycled does not discharge When completion, the number of first data block is filled in into the list, so that the computer equipment is to the first data block institute Corresponding memory space is discharged.
In alternatively possible implementation, which is specifically used for:
The data block to be recycled in the solid storage device is determined according to the assignment bit map rolled up in the solid storage device.
In alternatively possible implementation, which is specifically used for:
Judge that each physical block in the data block to be recycled whether there is and the logical block in the solid storage device Mapping relations;
If so, there are valid data for the data stored in the determining data block to be recycled;
If not, it is determined that valid data are not present in the data stored in the data block to be recycled.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the application Portion or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
The above, above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although referring to before Embodiment is stated the application is described in detail, those skilled in the art should understand that:It still can be to preceding Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these It modifies or replaces, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution.

Claims (14)

1. a kind of method of the garbage reclamation of solid storage device, which is characterized in that the method includes:
Computer equipment determines that the data block to be recycled in the solid storage device, the data block to be recycled are to be stored with to write The data block of the data entered;
The computer equipment generates list according to the data block to be recycled, and the list includes the data block to be recycled Relevant information;
The computer equipment judges the data stored in data block to be recycled described in the list with the presence or absence of valid data;
If so, the valid data are copied in the freed data blocks of the solid storage device by the computer equipment, The freed data blocks are the not stored data block for having data in the solid storage device;
The computer equipment discharges memory space corresponding to data block to be recycled described in the list.
2. the method according to claim 1, wherein if the computer equipment determines in data block to be recycled not There are valid data, the method also includes:
The computer equipment discharges memory space corresponding to data block to be recycled described in the list.
3. the method according to claim 1, wherein the computer equipment determines in the solid storage device After data block to be recycled, before the computer equipment generates list according to the data block to be recycled, the method is also wrapped It includes:
The computer equipment determines that the number of the data block to be recycled is greater than predetermined number;
The computer equipment determines the invalid data accounting of each data block in the data block to be recycled;
The computer equipment determines that invalid data accounting is greater than the target data of preset threshold from the data block to be recycled Block;
The computer equipment generates list according to the data block to be recycled:
The number of the target data block is filled in list described in the computer equipment, the list includes the number of targets According to the relevant information of block.
4. according to the method described in claim 3, it is characterized in that, the computer equipment discharges described in the list wait return Receiving memory space corresponding to data block includes:
The computer equipment preferentially discharges in the target data block deposits corresponding to the maximum data block of invalid data accounting Store up space.
5. method according to any one of claims 1 to 4, which is characterized in that described in the computer equipment release After memory space corresponding to data block to be recycled described in list, the method also includes:
The computer equipment detects the release conditions of memory space corresponding to the data block to be recycled according to preset duration;
When the computer equipment determines that memory space corresponding to the first data block in the data block to be recycled does not discharge When completion, the computer equipment fills in the number of first data block into the list, so that the computer Equipment discharges memory space corresponding to first data block.
6. method according to any one of claims 1 to 4, which is characterized in that described in the computer equipment determines Data block to be recycled in solid storage device includes:
The computer equipment according to the assignment bit map rolled up in the solid storage device determine in the solid storage device to Recovered data block.
7. method according to any one of claims 1 to 4, which is characterized in that described in the computer equipment judgement The data stored in data block to be recycled include with the presence or absence of valid data:
The computer equipment judge each physical block in the data block to be recycled whether in the solid storage device Logical block there are mapping relations;
If so, the computer equipment determines the data that store in the data block to be recycled, there are valid data;
If it is not, then the computer equipment determines that valid data are not present in the data stored in the data block to be recycled.
8. a kind of computer equipment of the garbage reclamation of solid storage device, which is characterized in that the computer equipment includes:
First determination unit, for determining that data block to be recycled in the solid storage device, the data block to be recycled are to deposit Contain the data block of the data of write-in;
Generation unit, for generating list according to the data block to be recycled, the list includes the data block to be recycled Relevant information;
Judging unit, the data for judging to store in the data block to be recycled whether there is valid data;
Copy cell, if determining the data stored in the data block to be recycled for the computer equipment, there are significant figures According to, the valid data are copied in the freed data blocks of the solid storage device, the freed data blocks be it is described solid State stores the not stored data block for having data in equipment;
Releasing unit, for discharging memory space corresponding to data block to be recycled described in the list.
9. computer equipment according to claim 8, which is characterized in that the releasing unit is also used to:
If the computer equipment determines that valid data are not present in the data stored in the data block to be recycled, the column are discharged Memory space corresponding to data block to be recycled in table.
10. computer equipment according to claim 8, which is characterized in that the computer equipment further includes:
Second determination unit, for determining that the number of the data block to be recycled is greater than predetermined number;
Third determination unit, for determining the invalid data accounting of each data block in data block to be recycled;
4th determination unit, for determining that invalid data accounting is greater than the number of targets of preset threshold from the data block to be recycled According to block;
The generation unit is specifically used for:
The number of the target data block is filled in list, the list includes the relevant information of the target data block.
11. computer equipment according to claim 10, which is characterized in that the releasing unit is specifically used for:
Preferentially discharge memory space corresponding to the maximum data block of invalid data accounting in the target data block.
12. the computer equipment according to any one of claim 8 to 11, which is characterized in that the computer equipment is also Including:
Detection unit, for detecting the release conditions of memory space corresponding to the data block to be recycled according to preset duration;
Unit is filled in, for depositing corresponding to the first data block in the data block to be recycled when the computer equipment determines When storage space does not discharge completion, the number of first data block is filled in into the list, so that the computer is set It is standby that memory space corresponding to first data block is discharged.
13. the computer equipment according to any one of claim 8 to 11, which is characterized in that first determination unit It is specifically used for:
The data block to be recycled in the solid storage device is determined according to the assignment bit map rolled up in the solid storage device.
14. the computer equipment according to any one of claim 8 to 11, which is characterized in that the judging unit is specific For:
Judge whether each physical block in the data block to be recycled exists with the logical block in the solid storage device to reflect Penetrate relationship;
If so, there are valid data for the data stored in the determining data block to be recycled;
If not, it is determined that valid data are not present in the data stored in the data block to be recycled.
CN201810542520.3A 2018-05-30 2018-05-30 The method and computer equipment of the garbage reclamation of solid storage device Withdrawn CN108874683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810542520.3A CN108874683A (en) 2018-05-30 2018-05-30 The method and computer equipment of the garbage reclamation of solid storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810542520.3A CN108874683A (en) 2018-05-30 2018-05-30 The method and computer equipment of the garbage reclamation of solid storage device

Publications (1)

Publication Number Publication Date
CN108874683A true CN108874683A (en) 2018-11-23

Family

ID=64336027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810542520.3A Withdrawn CN108874683A (en) 2018-05-30 2018-05-30 The method and computer equipment of the garbage reclamation of solid storage device

Country Status (1)

Country Link
CN (1) CN108874683A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949200A (en) * 2019-05-17 2020-11-17 北京兆易创新科技股份有限公司 Memory and control method and control device thereof
CN112764662A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for storage management
CN113641304A (en) * 2021-07-05 2021-11-12 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks
CN113849422A (en) * 2021-09-26 2021-12-28 苏州浪潮智能科技有限公司 Method, device and equipment for selecting garbage collection target block and readable storage medium
CN114840450A (en) * 2022-07-04 2022-08-02 荣耀终端有限公司 Storage space arrangement method and electronic equipment
CN116860179A (en) * 2023-08-31 2023-10-10 合肥康芯威存储技术有限公司 Storage device, data processing method for storage device, computer apparatus, and medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949200A (en) * 2019-05-17 2020-11-17 北京兆易创新科技股份有限公司 Memory and control method and control device thereof
CN112764662A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for storage management
CN112764662B (en) * 2019-10-21 2024-04-19 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for storage management
CN113641304A (en) * 2021-07-05 2021-11-12 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks
CN113641304B (en) * 2021-07-05 2023-10-20 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks
CN113849422A (en) * 2021-09-26 2021-12-28 苏州浪潮智能科技有限公司 Method, device and equipment for selecting garbage collection target block and readable storage medium
CN114840450A (en) * 2022-07-04 2022-08-02 荣耀终端有限公司 Storage space arrangement method and electronic equipment
CN116860179A (en) * 2023-08-31 2023-10-10 合肥康芯威存储技术有限公司 Storage device, data processing method for storage device, computer apparatus, and medium

Similar Documents

Publication Publication Date Title
CN108874683A (en) The method and computer equipment of the garbage reclamation of solid storage device
CN105589812B (en) Disk fragments method for sorting, device and host
CN103984641B (en) A kind of memory space recovery method and its device based on simplify configuration technology
CN104808951B (en) The method and apparatus for carrying out storing control
CN107528882A (en) The method, apparatus and electronic equipment of processing common recognition request in block chain common recognition network
CN104077197B (en) System recovery method, device, solid state hard disc and electronic equipment
CN104461768B (en) copy storage device and copy storage method
CN104685474B (en) For the method for handling not repairable EMS memory error and non-transient processor readable medium
CN106598495A (en) Mixed storage service quality control method and control apparatus
CN106776113A (en) A kind of virtual machine backup method and device
CN108984295B (en) Memory recovery method, computer device and computer readable storage medium
CN107229414A (en) Memory space recovery method and device
CN107590144A (en) A kind of file memory method and terminal
CN107861685A (en) Virtual disk wiring method and device, storage medium based on copy-on-write
CN106626795A (en) Serial number transmission method, device, consumable chip and imaging box
CN105912425A (en) Snapshot image establishment and rollback method and apparatus
CN106293497A (en) The recovery method of junk data and device in watt record filesystem-aware
CN106201904A (en) Method and device for internal memory garbage reclamation
CN107135192A (en) Dispose VNF resource authorization method, VNFM and NFVO
CN107329836A (en) Multi-system memory management method and device and mobile terminal
CN107241370A (en) The rollback method and system of resource operation under IaaS cloud environment
CN108228339A (en) A kind of method for recovering internal storage and device, terminal device and computer readable storage medium
CN111399988A (en) Memory security detection system and method of cloud platform
CN107729182B (en) Data storage and access method and device
CN108228340A (en) terminal control method and device, terminal device and computer readable storage 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
WW01 Invention patent application withdrawn after publication

Application publication date: 20181123

WW01 Invention patent application withdrawn after publication