CN111190835A - Data writing method, device, equipment and medium - Google Patents
Data writing method, device, equipment and medium Download PDFInfo
- Publication number
- CN111190835A CN111190835A CN201911386528.6A CN201911386528A CN111190835A CN 111190835 A CN111190835 A CN 111190835A CN 201911386528 A CN201911386528 A CN 201911386528A CN 111190835 A CN111190835 A CN 111190835A
- Authority
- CN
- China
- Prior art keywords
- data
- pba
- reverse table
- storage
- write
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000013500 data storage Methods 0.000 claims abstract description 84
- 239000007787 solid Substances 0.000 claims abstract description 37
- 238000004590 computer program Methods 0.000 claims description 12
- 238000012005 ligant binding assay Methods 0.000 claims 4
- 238000010586 diagram Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/0292—User address space allocation, e.g. contiguous or non contiguous base addressing using tables or multilevel address translation means
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
- G06F12/1018—Address translation using page tables, e.g. page table structures involving hashing techniques, e.g. inverted page tables
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The application discloses a data writing method, a device, equipment and a medium, comprising the following steps: when a first data write request of a current page is acquired, applying for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request; reading the reverse table position identification, and adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the position identification of the target reverse table to obtain a target table storage PBA; writing the write data into a write cache corresponding to the corresponding data storage PBA, and sequentially writing the LBA corresponding to each write request into a write cache corresponding to the target table storage PBA; and when the data volume in the DDR reaches the writing nand condition, writing the write data into the solid state disk storage space corresponding to the corresponding data storage PBA, and writing the corresponding LBA into the corresponding target table to store the solid state disk storage space corresponding to the PBA. Therefore, the speed of searching the storage position of the reverse table can be improved, and the data writing efficiency is improved.
Description
Technical Field
The present application relates to the field of data storage, and in particular, to a data writing method, apparatus, device, and medium.
Background
In the process of writing data in an SSD (Solid State drive), not only user data needs to be operated, but also existing internal management data of the Solid State drive needs to be supported, for example, a reverse table used for garbage collection and the like are needed to provide data support for garbage collection, the reverse table mainly maps LBAs (Logical Block addresses) corresponding to PBAs (Physical Block addresses), and in order to maintain the reverse table, LBAs corresponding to the PBAs need to be written together when falling to nand.
In the prior art, each storage page corresponds to one reverse table, and the reverse tables corresponding to different pages are different, when writing in an LBA, the storage location of the corresponding reverse table needs to be searched, and the search for the storage location of the reverse table is performed in a bitmap traversal manner, that is, each page needs to traverse a bitmap from the beginning, so that the search efficiency is low, and the data writing efficiency is reduced.
Disclosure of Invention
In view of the above, an object of the present application is to provide a data writing method, apparatus, device and medium, which can improve the speed of looking up the storage location of the reverse table, thereby improving the data writing efficiency. The specific scheme is as follows:
in a first aspect, the present application discloses a data writing method applied to a solid state disk, including:
when a first data write request of a current page is acquired, applying for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request;
reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table;
adding 1 to the reverse table position identification to obtain a target reverse table position identification;
searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained;
writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table;
and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA.
Optionally, the adding 1 operation to the reverse table location identifier to obtain a target reverse table location identifier includes:
and adding 1 to the reverse table position identification, if the reverse table position identification added with 1 reaches a preset threshold value, setting the reverse table position identification to be 0 to obtain the target reverse table position identification, and otherwise, determining the reverse table position identification added with 1 as the target reverse table position identification.
Optionally, the method further includes:
and predetermining a preset PBA on any LUN as a table storage PBA.
Optionally, the method further includes:
and calculating to obtain the bitmap according to the bad block table and the parity.
Optionally, after acquiring the first data write request of the current page, applying for a corresponding write cache in the DDR to obtain a corresponding data storage PBA, the method further includes:
and updating the next valid data storage PBA so as to allocate the data storage PBA for the next data writing request.
In a second aspect, the present application discloses a data writing device, which is applied to a solid state disk, and includes:
the data storage PBA acquisition module is used for applying a corresponding write cache in the DDR when a first data write request of a current page is acquired so as to obtain a data storage PBA corresponding to the data write request;
the reverse table position identification reading module is used for reading the current reverse table position identification; wherein the reverse table location identification is used for identifying the historical location of the reverse table;
the target reverse table position identification acquisition module is used for adding 1 to the reverse table position identification to obtain a target reverse table position identification;
a target table storage PBA acquisition module, configured to search, by using the target reverse table location identifier, an available state of an LUN at a location corresponding to a bitmap, determine, if the available state is available, a reverse table storage location corresponding to a current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, jump to the step of adding 1 to the reverse table location identifier until the target table storage PBA is obtained;
the data cache module is used for writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA, and sequentially writing LBAs corresponding to the data storage PBA of the current page into write caches corresponding to the target table storage PBA;
and the data writing module is used for respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA when the data volume in the DDR reaches a write nand condition.
Optionally, the target reverse table position identifier obtaining module is specifically configured to add 1 to the reverse table position identifier, set the reverse table position identifier to 0 if the reverse table position identifier added with 1 reaches a preset threshold, so as to obtain the target reverse table position identifier, and otherwise, determine the reverse table position identifier added with 1 as the target reverse table position identifier.
Optionally, the data writing device further includes:
and the table storage PBA determining module is used for determining the preset PBA on any LUN in advance as the table storage PBA.
In a third aspect, the present application discloses a data writing apparatus comprising a processor and a memory; wherein,
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the foregoing data writing method.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned data writing method.
Therefore, when the first data write request of the current page is obtained, the corresponding write cache is applied in the DDR to obtain the data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA. Like this, when looking for the reverse table memory location that the current page corresponds, utilize the reverse table position sign of reading to look for, the historical position of reverse table has been identified to the reverse table of reading, has avoided traversing bitmap from the beginning to at the searching in-process updated reverse table position sign, so that the next page utilizes the reverse table position sign after the renewal to carry out reverse table position to look for, can promote the speed of looking for reverse table memory location, thereby promote data write-in efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a data writing method disclosed in the present application;
FIG. 2 is a schematic diagram of a data writing apparatus according to the present disclosure;
fig. 3 is a block diagram of a data writing apparatus disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, each storage page corresponds to one reverse table, and the reverse tables corresponding to different pages are different, when writing in an LBA, the storage location of the corresponding reverse table needs to be searched, and the search for the storage location of the reverse table is performed in a bitmap traversal manner, that is, each page needs to traverse a bitmap from the beginning, so that the search efficiency is low, and the data writing efficiency is reduced.
Referring to fig. 1, an embodiment of the present application discloses a data writing method applied to a solid state disk, including:
step S11: when the first Data write request of the current page is acquired, a corresponding write cache is applied in a DDR (Double Data Rate, Double Rate synchronous dynamic random access memory) to obtain a Data storage PBA corresponding to the Data write request.
In a specific implementation manner, a physical LUN (Logical Unit Number), a block, and a page may be recombined in the SSD, where a plurality of PBAs are combined into a superpage, a plurality of superpages are combined into a superblock super block, and a plurality of superblocks are combined into a LUN, and the current page of this embodiment may be the current superpage.
And when the first data write request of the current page is acquired, applying for a corresponding write cache in the DDR to obtain a corresponding data storage PBA, and then updating the next valid data storage PBA so as to allocate the data storage PBA for the next data write request.
Step S12: reading the position identification of the current reverse table; wherein the reverse table location identification is used to identify a historical location of the reverse table.
In a specific embodiment, the reverse table location identifier is used to identify a location of a reverse table corresponding to any page, and update the location in real time for each page, so that the read current reverse table location identifier marks a location of a historical reverse table, that is, a LUN of a reverse table corresponding to a previous page.
Step S13: and adding 1 to the reverse table position identification to obtain a target reverse table position identification.
In a specific implementation manner, the reverse table position identifier is added with 1, if the reverse table position identifier added with 1 reaches a preset threshold, the reverse table position identifier is set to 0 to obtain the target reverse table position identifier, otherwise, the reverse table position identifier added with 1 is determined as the target reverse table position identifier.
That is, in this embodiment, a reverse table position identifier, such as a current LUN, may be used to record a storage location of a reverse table, that is, a storage LUN corresponding to the reverse table, and each time a storage location corresponding to a reverse table of a current page is searched, 1 may be added to the read reverse table position identifier, because the read reverse table position identifier identifies a storage location of a reverse table of a previous page, and in this embodiment, when a superblock is obtained, a bitmap may be obtained by calculating according to a bad block table and parity, each bit of the bitmap corresponds to an available state of a corresponding LUN, and then an LUN corresponding to a starting superpage is determined, and a corresponding reverse table position identifier is recorded, so that when other superpages search corresponding reverse table storage locations, the reverse table position identifier may be read, added with 1, and search continues, and the bitmap has a preset number of bits, such as 32 bits, that 32 LUNs correspond, therefore, when the reverse table position identifier is added with 1 and then is 0, the reverse table location flag needs to be set to 0.
Step S14: and searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain the corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until obtaining the target table storage PBA.
In a specific embodiment, the predetermined PBA on any of the LUNs may be predetermined as the table storage PBA, so that the target table storage PBA can be obtained by finding the corresponding LUN. And the obtained target reverse table position identification corresponding to the target table storage PBA is the corresponding reverse table position identification updated aiming at the current page, and the target reverse table position identification is stored so as to be convenient for reading and calling when the next page is searched for the reverse table position.
Step S15: writing the write data corresponding to each data write request of the current page into the write cache corresponding to the data storage PBA, and sequentially writing the LBA corresponding to each data write request of the current page into the write cache corresponding to the data storage PBA of the target table.
In a specific embodiment, write data is written into the write buffer write cache of the DDR by DMA (Direct Memory Access), and the corresponding LBA is moved into the write buffer of the DDR by the DATANETWORK data network working hardware functional unit.
Step S16: and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA.
That is, when the data amount in the DDR reaches the write nand condition, the corresponding write data and the LBA are written into the solid state disk storage space corresponding to the corresponding PBA together.
Therefore, in the embodiment of the application, when a first data write request of a current page is acquired, a corresponding write cache is applied in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA. Like this, when looking for the reverse table memory location that the current page corresponds, utilize the reverse table position sign of reading to look for, the historical position of reverse table has been identified to the reverse table of reading, has avoided traversing bitmap from the beginning to at the searching in-process updated reverse table position sign, so that the next page utilizes the reverse table position sign after the renewal to carry out reverse table position to look for, can promote the speed of looking for reverse table memory location, thereby promote data write-in efficiency.
Referring to fig. 2, an embodiment of the present application discloses a data writing device applied to a solid state disk, including:
the data storage PBA acquisition module 11 is configured to, when a first data write request of a current page is acquired, apply for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request;
a reverse table position identifier reading module 12, configured to read a current reverse table position identifier; wherein the reverse table location identification is used for identifying the historical location of the reverse table;
a target reverse table position identifier obtaining module 13, configured to add 1 to the reverse table position identifier to obtain a target reverse table position identifier;
a target table storage PBA obtaining module 14, configured to use the target reverse table location identifier to search for an available state of an LUN at a location corresponding to a bitmap, if the available state is available, determine a reverse table storage location corresponding to a current page as the LUN, so as to obtain a corresponding target table storage PBA, and if the available state is unavailable, jump to the step of adding 1 to the reverse table location identifier until the target table storage PBA is obtained;
the data cache module 15 is configured to write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially write LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the target table storage PBA;
and a data writing module 16, configured to, when the data amount in the DDR reaches a write nand condition, respectively write the write data in the DDR into the solid state disk storage space corresponding to the data storage PBA, and write the LBA corresponding to the write data into the solid state disk storage space corresponding to the target table storage PBA.
Therefore, in the embodiment of the application, when a first data write request of a current page is acquired, a corresponding write cache is applied in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA. Like this, when looking for the reverse table memory location that the current page corresponds, utilize the reverse table position sign of reading to look for, the historical position of reverse table has been identified to the reverse table of reading, has avoided traversing bitmap from the beginning to at the searching in-process updated reverse table position sign, so that the next page utilizes the reverse table position sign after the renewal to carry out reverse table position to look for, can promote the speed of looking for reverse table memory location, thereby promote data write-in efficiency.
The target reverse table position identifier obtaining module 12 is specifically configured to add 1 to the reverse table position identifier, set the reverse table position identifier to 0 if the reverse table position identifier added with 1 reaches a preset threshold, so as to obtain the target reverse table position identifier, and otherwise, determine the reverse table position identifier added with 1 as the target reverse table position identifier.
And the data writing device further comprises a table storage PBA determining module, which is used for determining the preset PBA on any LUN as the table storage PBA in advance.
The data writing device also comprises a bitmap calculation module which is used for calculating and obtaining the bitmap according to the bad block table and the parity.
The data writing device also comprises a data storage PBA updating module which is used for updating the next valid data storage PBA so as to distribute the data storage PBA for the next data writing request.
Referring to fig. 3, an embodiment of the present application discloses a data writing device, which includes a processor 21 and a memory 22; wherein, the memory 22 is used for saving computer programs; the processor 21 is configured to execute the computer program to implement the following steps:
when a first data write request of a current page is acquired, applying for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA.
Therefore, in the embodiment of the application, when a first data write request of a current page is acquired, a corresponding write cache is applied in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA. Like this, when looking for the reverse table memory location that the current page corresponds, utilize the reverse table position sign of reading to look for, the historical position of reverse table has been identified to the reverse table of reading, has avoided traversing bitmap from the beginning to at the searching in-process updated reverse table position sign, so that the next page utilizes the reverse table position sign after the renewal to carry out reverse table position to look for, can promote the speed of looking for reverse table memory location, thereby promote data write-in efficiency.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and adding 1 to the reverse table position identification, if the reverse table position identification added with 1 reaches a preset threshold value, setting the reverse table position identification to be 0 to obtain the target reverse table position identification, and otherwise, determining the reverse table position identification added with 1 as the target reverse table position identification.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and predetermining a preset PBA on any LUN as a table storage PBA.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and calculating to obtain the bitmap according to the bad block table and the parity.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and updating the next valid data storage PBA so as to allocate the data storage PBA for the next data writing request.
Further, an embodiment of the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:
when a first data write request of a current page is acquired, applying for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA.
Therefore, in the embodiment of the application, when a first data write request of a current page is acquired, a corresponding write cache is applied in the DDR to obtain a data storage PBA corresponding to the data write request; reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table; adding 1 to the reverse table position identification to obtain a target reverse table position identification; searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained; writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table; and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA. Like this, when looking for the reverse table memory location that the current page corresponds, utilize the reverse table position sign of reading to look for, the historical position of reverse table has been identified to the reverse table of reading, has avoided traversing bitmap from the beginning to at the searching in-process updated reverse table position sign, so that the next page utilizes the reverse table position sign after the renewal to carry out reverse table position to look for, can promote the speed of looking for reverse table memory location, thereby promote data write-in efficiency.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and adding 1 to the reverse table position identification, if the reverse table position identification added with 1 reaches a preset threshold value, setting the reverse table position identification to be 0 to obtain the target reverse table position identification, and otherwise, determining the reverse table position identification added with 1 as the target reverse table position identification.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and predetermining a preset PBA on any LUN as a table storage PBA.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and calculating to obtain the bitmap according to the bad block table and the parity.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and updating the next valid data storage PBA so as to allocate the data storage PBA for the next data writing request.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing detailed description is directed to a data writing method, apparatus, device and medium provided by the present application, and specific examples are applied herein to illustrate the principles and embodiments of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A data writing method is applied to a solid state disk and comprises the following steps:
when a first data write request of a current page is acquired, applying for a corresponding write cache in the DDR to obtain a data storage PBA corresponding to the data write request;
reading the position identification of the current reverse table; wherein the reverse table location identification is used for identifying the historical location of the reverse table;
adding 1 to the reverse table position identification to obtain a target reverse table position identification;
searching the available state of the LUN at the position corresponding to the bitmap by using the target reverse table position identification, if the available state is available, determining the reverse table storage position corresponding to the current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, skipping to the step of adding 1 to the reverse table position identification until the target table storage PBA is obtained;
writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA corresponding to the write request, and sequentially writing LBAs corresponding to the data storage PBA corresponding to each data write request of the current page into write caches corresponding to the data storage PBA of the target table;
and when the data volume in the DDR reaches a write-in nand condition, respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA, and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA.
2. The data writing method according to claim 1, wherein the adding 1 operation to the reverse table location identifier to obtain a target reverse table location identifier comprises:
and adding 1 to the reverse table position identification, if the reverse table position identification added with 1 reaches a preset threshold value, setting the reverse table position identification to be 0 to obtain the target reverse table position identification, and otherwise, determining the reverse table position identification added with 1 as the target reverse table position identification.
3. The data writing method according to claim 1, further comprising:
and predetermining a preset PBA on any LUN as a table storage PBA.
4. The data writing method according to claim 1, further comprising:
and calculating to obtain the bitmap according to the bad block table and the parity.
5. The data writing method according to any one of claims 1 to 4, wherein after acquiring a first data writing request of a current page, applying for a corresponding write cache in the DDR to obtain a corresponding data storage PBA, further comprising:
and updating the next valid data storage PBA so as to allocate the data storage PBA for the next data writing request.
6. A data writing device is applied to a solid state disk and comprises:
the data storage PBA acquisition module is used for applying a corresponding write cache in the DDR when a first data write request of a current page is acquired so as to obtain a data storage PBA corresponding to the data write request;
the reverse table position identification reading module is used for reading the current reverse table position identification; wherein the reverse table location identification is used for identifying the historical location of the reverse table;
the target reverse table position identification acquisition module is used for adding 1 to the reverse table position identification to obtain a target reverse table position identification;
a target table storage PBA acquisition module, configured to search, by using the target reverse table location identifier, an available state of an LUN at a location corresponding to a bitmap, determine, if the available state is available, a reverse table storage location corresponding to a current page as the LUN to obtain a corresponding target table storage PBA, and if the available state is unavailable, jump to the step of adding 1 to the reverse table location identifier until the target table storage PBA is obtained;
the data cache module is used for writing write data corresponding to each data write request of the current page into a write cache corresponding to the data storage PBA, and sequentially writing LBAs corresponding to the data storage PBA of the current page into write caches corresponding to the target table storage PBA;
and the data writing module is used for respectively writing the write data in the DDR into the corresponding solid state disk storage space corresponding to the data storage PBA and writing the LBA corresponding to the write data into the corresponding solid state disk storage space corresponding to the target table storage PBA when the data volume in the DDR reaches a write nand condition.
7. The data writing device according to claim 6, wherein the target reverse table location identifier obtaining module is specifically configured to add 1 to the reverse table location identifier, set the reverse table location identifier to 0 if the reverse table location identifier added with 1 reaches a preset threshold, so as to obtain the target reverse table location identifier, and otherwise, determine the reverse table location identifier added with 1 as the target reverse table location identifier.
8. The data writing apparatus according to claim 6, further comprising:
and the table storage PBA determining module is used for determining the preset PBA on any LUN in advance as the table storage PBA.
9. A data writing apparatus comprising a processor and a memory; wherein,
the memory is used for storing a computer program;
the processor for executing the computer program to implement the data writing method according to any one of claims 1 to 5.
10. A computer-readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the data writing method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911386528.6A CN111190835B (en) | 2019-12-29 | 2019-12-29 | Data writing method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911386528.6A CN111190835B (en) | 2019-12-29 | 2019-12-29 | Data writing method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111190835A true CN111190835A (en) | 2020-05-22 |
CN111190835B CN111190835B (en) | 2022-06-10 |
Family
ID=70707819
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911386528.6A Active CN111190835B (en) | 2019-12-29 | 2019-12-29 | Data writing method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111190835B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111966298A (en) * | 2020-08-24 | 2020-11-20 | 深圳三地一芯电子有限责任公司 | Reverse programming implementation method and device based on Flash memory |
CN112187669A (en) * | 2020-09-11 | 2021-01-05 | 山东云海国创云计算装备产业创新中心有限公司 | Data interaction method, device and equipment and readable storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103136121A (en) * | 2013-03-25 | 2013-06-05 | 中国人民解放军国防科学技术大学 | Cache management method for solid-state disc |
CN103514212A (en) * | 2012-06-27 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Data writing method and system |
US20170109042A1 (en) * | 2015-10-15 | 2017-04-20 | Silicon Motion, Inc. | Data storage device and data maintenance method thereof |
US20170270047A1 (en) * | 2015-10-15 | 2017-09-21 | Silicon Motion, Inc. | Data storage device and data maintenance method thereof |
CN107273306A (en) * | 2017-06-19 | 2017-10-20 | 郑州云海信息技术有限公司 | A kind of digital independent of solid state hard disc, method for writing data and solid state hard disc |
US20180275899A1 (en) * | 2017-03-24 | 2018-09-27 | Seagate Technology Llc | Hardware based map acceleration using forward and reverse cache tables |
CN109144422A (en) * | 2018-08-31 | 2019-01-04 | 浪潮电子信息产业股份有限公司 | Data writing method, device and equipment for solid state disk and storage medium |
-
2019
- 2019-12-29 CN CN201911386528.6A patent/CN111190835B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103514212A (en) * | 2012-06-27 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Data writing method and system |
CN103136121A (en) * | 2013-03-25 | 2013-06-05 | 中国人民解放军国防科学技术大学 | Cache management method for solid-state disc |
US20170109042A1 (en) * | 2015-10-15 | 2017-04-20 | Silicon Motion, Inc. | Data storage device and data maintenance method thereof |
US20170270047A1 (en) * | 2015-10-15 | 2017-09-21 | Silicon Motion, Inc. | Data storage device and data maintenance method thereof |
US20180275899A1 (en) * | 2017-03-24 | 2018-09-27 | Seagate Technology Llc | Hardware based map acceleration using forward and reverse cache tables |
CN107273306A (en) * | 2017-06-19 | 2017-10-20 | 郑州云海信息技术有限公司 | A kind of digital independent of solid state hard disc, method for writing data and solid state hard disc |
CN109144422A (en) * | 2018-08-31 | 2019-01-04 | 浪潮电子信息产业股份有限公司 | Data writing method, device and equipment for solid state disk and storage medium |
Non-Patent Citations (1)
Title |
---|
李想: "基于软件架构的固态硬盘FTL设计", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111966298A (en) * | 2020-08-24 | 2020-11-20 | 深圳三地一芯电子有限责任公司 | Reverse programming implementation method and device based on Flash memory |
CN112187669A (en) * | 2020-09-11 | 2021-01-05 | 山东云海国创云计算装备产业创新中心有限公司 | Data interaction method, device and equipment and readable storage medium |
CN112187669B (en) * | 2020-09-11 | 2022-03-08 | 山东云海国创云计算装备产业创新中心有限公司 | Data interaction method, device and equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111190835B (en) | 2022-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101289931B1 (en) | Method and apparatus for storing data in flash memory using address mapping with various block sizes | |
US9830260B2 (en) | Method for mapping page address based on flash memory and system therefor | |
CN111125447A (en) | Metadata access method, device and equipment and readable storage medium | |
US6711663B2 (en) | Algorithm of flash memory capable of quickly building table and preventing improper operation and control system thereof | |
WO2015185002A1 (en) | Method and device for writing data | |
WO2016086819A1 (en) | Method and apparatus for writing data into shingled magnetic record smr hard disk | |
US20150169465A1 (en) | Method and system for dynamic compression of address tables in a memory | |
US20170123712A1 (en) | Data Deduplication Method and Apparatus | |
US9772790B2 (en) | Controller, flash memory apparatus, method for identifying data block stability, and method for storing data in flash memory apparatus | |
CN111190835B (en) | Data writing method, device, equipment and medium | |
US20140223075A1 (en) | Physical-to-logical address map to speed up a recycle operation in a solid state drive | |
CN105917303B (en) | Controller, method for identifying stability of data block and storage system | |
CN108073359B (en) | Operation method of data storage device | |
CN111459405B (en) | Disk performance optimization method, device, equipment and computer readable storage medium | |
CN109213450B (en) | Associated metadata deleting method, device and equipment based on flash memory array | |
CN112084070B (en) | L2P mapping data recovery method and device, storage medium and electronic equipment | |
US11327939B2 (en) | Method and device for indexing dirty data in storage system page | |
CN107273306B (en) | Data reading and writing method for solid state disk and solid state disk | |
JP2007220107A (en) | Apparatus and method for managing mapping information of nonvolatile memory | |
CN113835639B (en) | I/O request processing method, device, equipment and readable storage medium | |
KR101626218B1 (en) | Block based page mapping method | |
CN116340198B (en) | Data writing method and device of solid state disk and solid state disk | |
WO2016206070A1 (en) | File updating method and storage device | |
US11226738B2 (en) | Electronic device and data compression method thereof | |
CN104899158A (en) | Memory access optimization method and memory access optimization device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |