Mapping table updating method and storage device
By establishing the second mapping table in the memory module and writing when it completely covers the first mapping table, the problem of long mapping table update time in the prior art is solved, and more efficient memory module operation is achieved.
Patent Information
- Application Number
- CN202410764355.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-06-14
AI Technical Summary
When updating the mapping table in the memory module, the existing technology requires frequent reading and writing back of the mapping table, resulting in an increase in update time.
A mapping table update method is proposed. By receiving sequential write instructions, a second mapping table is established, and when the second mapping table completely covers the first mapping table, it is written into the memory module to replace the first mapping table, reducing reads. Fetch and write times.
The speed of updating the mapping table is improved, the number of reads of the memory module is reduced, and the operating efficiency of the memory module is improved.
Smart Images

Figure CN118349186B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a memory management technology, and in particular to a mapping table updating method and a storage device. Background Art
[0002] Smart phones, tablet computers and personal computers have grown rapidly in the past few years, resulting in a rapid increase in consumer demand for storage media. Since rewritable non-volatile memory modules (e.g., flash memory) have the characteristics of data non-volatility, power saving, small size, and no mechanical structure, they are very suitable for being built into the various portable multimedia devices listed above.
[0003] Generally speaking, when data is stored in a rewritable non-volatile memory module, the memory controller will store mapping information related to the data in a mapping table. For example, the mapping information includes the logical address to which the data belongs and the physical address actually used to store the data. Later, when the data is to be read, the memory controller can obtain the physical address used to store the data according to the mapping information in the mapping table and read the data from the physical address.
[0004] In some implementations, part of the mapping table is first stored in the rewritable non-volatile memory module. When data is to be written to the rewritable non-volatile memory module, the memory controller must first read the mapping table from the rewritable non-volatile memory module, such as caching it in a memory. The memory controller then modifies the mapping table to record the new logical address and physical address, and finally writes the modified mapping table back to the rewritable non-volatile memory module. Since when the mapping table is updated, the mapping table stored in the rewritable non-volatile memory module needs to be read and then updated based on the mapping table, this will undoubtedly increase the time to update the mapping table. Summary of the invention
[0005] In order to solve the above problem, the present invention provides a mapping table updating method and a storage device, which can improve the speed of updating the mapping table.
[0006] An embodiment of the present invention provides a mapping table updating method for a memory module, wherein the memory module includes a plurality of physical units and stores a first mapping table. The mapping table updating method includes: receiving a sequential write instruction from a host system, obtaining a plurality of first logical units to be written by the sequential write instruction; obtaining a starting physical unit corresponding to the sequential write instruction, and calculating a plurality of first physical units required to complete the sequential write instruction; establishing a second mapping table based on the first logical unit and the first physical unit; and if the second mapping table completely covers the first mapping table, writing the second mapping table into the memory module to replace the first mapping table. The first mapping table reflects the mapping relationship between the physical units and the logical units in the memory module before receiving the sequential write instruction.
[0007] From another perspective, an embodiment of the present invention proposes a storage device, including a connection interface unit, a memory module and a memory controller. The connection interface unit is used to connect to a host system. The memory controller is connected to the connection interface unit and the memory module, and the memory module includes a plurality of physical units and stores a first mapping table. The memory controller is used to perform a plurality of steps: receiving a sequential write instruction from the host system, obtaining a plurality of first logical units to be written by the sequential write instruction; obtaining a starting physical unit corresponding to the sequential write instruction, and calculating a plurality of first physical units required to complete the sequential write instruction; establishing a second mapping table based on the first logical unit and the first physical unit; and if the second mapping table completely covers the first mapping table, writing the second mapping table into the memory module to replace the first mapping table. The first mapping table reflects the mapping relationship between the physical units and the logical units in the memory module before receiving the sequential write instruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a schematic diagram of a storage device according to an embodiment of the present invention;
[0009] Figure 2 is a schematic diagram of a management memory module according to an embodiment of the present invention;
[0010] Figure 3 is a flow chart showing a method for updating a mapping table according to an embodiment;
[0011] Figure 4 is a schematic diagram showing a mapping table according to an embodiment. DETAILED DESCRIPTION
[0012] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0013] Figure 1is a schematic diagram of a storage device according to an embodiment of the present invention. Figure 1 The data storage system includes a storage device 10 and a host system 11. The host system 11 can be any type of computer system, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, an industrial computer, a game console, a server or a vehicle-mounted computer, etc., and the type of the host system 11 is not limited thereto.
[0014] The storage device 10 is connected to the host system 11 and is used to store data from the host system 11. For example, the storage device 10 may include a solid state drive, a USB flash drive, a memory card, or other types of non-volatile storage devices. The host system 11 may communicate with the storage device 10 through an embedded Multi-Media Card (embedded Multi-Media Card, eMMC), a universal flash memory (Universal FlashStorage, UFS), a fast peripheral component interconnect (Peripheral Component Interconnect Express, PCIExpress), a fast non-volatile memory (Non-Volatile Memory Express, NVM express), a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA), a universal serial bus (Universal Serial Bus, USB) or other types of connection interface standards. Therefore, the host system 11 can store data to the storage device 10 and / or read data from the storage device 10.
[0015] The storage device 10 includes a connection interface unit 101, a memory module 102, and a memory controller 103. The connection interface unit 101 is used to connect the storage device 10 to the host system 11. For example, the connection interface unit 101 can support connection interface standards such as eMMC, UFS, PCI Express, NVM express, SATA, PCI Express, or USB. The storage device 10 can communicate with the host system 11 (e.g., exchange signals and / or data) via the connection interface unit 101.
[0016] The memory module 102 is used to store data. The memory module 102 may include one or more rewritable non-volatile memory modules. Each rewritable non-volatile memory module may include one or more memory cell arrays. The memory cells in the memory cell array store data in the form of voltage. For example, the memory module 102 may include a single level cell (SLC) NAND flash memory module, a multi level cell (MLC) NAND flash memory module, a triple level cell (TLC) NAND flash memory module, a quad level cell (QLC) NAND flash memory module and / or other memory modules having the same or similar characteristics.
[0017] The memory controller 103 is connected to the connection interface unit 101 and the memory module 102. The memory controller 103 can be regarded as the control core of the memory device 10 and is used to control the memory device 10. For example, the memory controller 103 can be responsible for controlling and / or managing the entire or partial operation of the memory device 10. For example, the memory controller 103 may include a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSP), programmable controllers, application specific integrated circuits (ASIC), programmable logic devices (PLD) or other similar devices or combinations of these devices. In one embodiment, the memory controller 103 includes a flash memory controller.
[0018] In one embodiment, the memory controller 103 may further include a buffer memory, a power management circuit, an encoding circuit, a decoding circuit and / or various other types of circuit modules, which are not limited by the present invention. The buffer memory is used to cache data. The power management circuit is used to manage the power of the storage device 10. The encoding circuit is used to encode the data to be stored in the memory module 102 to generate an error correction code (and / or an error checking code). The decoding circuit is used to decode the data read from the memory module 102 to correct possible errors in the read data. For example, the encoding circuit and / or the decoding circuit may use various encoding / decoding algorithms such as Low Density Parity Check Code (LDPC code), BCH code, Reed-Solomon code (RS code), Exclusive OR (XOR) code, etc. to encode and decode data.
[0019] The memory module 102 may receive a command sequence from the memory controller 103 and access the storage unit according to the command sequence. For example, when data is to be stored, the memory controller 103 may send a write command sequence to the memory module 102 to instruct the memory module 102 to store the data in a specific storage unit. When data is to be read, the memory controller 103 may send a read command sequence to the memory module 102 to instruct the memory module 102 to read data from a specific storage unit. When data is to be deleted, the memory controller 103 may send an erase command sequence to the memory module 102 to instruct the memory module 102 to erase the data stored in the specific storage unit. In addition, the memory controller 103 may also send other types of command sequences to the memory module 102 to instruct the memory module 102 to perform corresponding operations, which is not limited by the present invention.
[0020] Figure 2 FIG. 1 is a schematic diagram of a management memory module according to an embodiment of the present invention. Figure 1 and Figure 2 The memory module 102 includes a plurality of physical units 201 ( 1 ) to 201 (B). Each physical unit includes a plurality of storage cells and is used for non-volatile storage of data.
[0021] In one embodiment, a physical unit may include multiple physical sectors. For example, the data capacity of a physical sector may be 512 bytes (Bytes, B), and a physical unit may include 8 physical sectors. However, the data capacity of a physical sector and / or the total number of physical sectors included in a physical unit may be adjusted according to practical needs, and the present invention is not limited thereto. In one embodiment, a physical unit may be regarded as a physical page. For example, the data capacity of a physical page may be 4 kilobytes (4KB), and the present invention is not limited thereto.
[0022] In one embodiment, a physical page is the minimum unit for synchronously writing data in the memory module 102. For example, when a programming operation is performed on a physical page to write data to the physical page, multiple memory cells in the physical page can be synchronously programmed to store corresponding data. For example, when programming a physical page, a write voltage can be applied to the physical page to change the threshold voltage of at least some of the memory cells in the physical page. The threshold voltage of each memory cell can reflect the bit data stored in the memory cell.
[0023] In one embodiment, the memory module 102 may include a plurality of physical blocks. Each physical block may include a plurality of physical cells. In particular, a plurality of physical cells (e.g., physical pages) in the same physical block may be erased simultaneously. For example, when erasing a physical block, an erase voltage may be applied to a plurality of physical pages in the physical block to change the threshold voltage of at least a portion of the memory cells in these physical pages and clear the bit data stored in each memory cell in these physical pages.
[0024] In one embodiment, the memory controller 103 may logically associate the physical units 201(1)-201(A) with the data area 21 and associate the physical units 201(A+1)-201(B) with the spare area 22. The physical units 201(1)-201(A) in the data area 21 are used to store data (also referred to as user data) from the host system 11. For example, each physical unit in the data area 21 may store valid data and / or invalid data. In addition, the physical units 201(A+1)-201(B) in the spare area 22 do not store data.
[0025] In one embodiment, if a physical unit does not store valid data, the physical unit can be associated with the idle area 22. In one embodiment, the idle area 22 is also called a free pool. In addition, the physical unit associated with the idle area 22 can be erased to clear the data in the physical unit.
[0026] In one embodiment, when data (i.e., user data) from the host system 11 needs to be stored, the memory controller 103 may select one or more physical units from the idle area 22 and instruct the memory module 102 to store the data from the host system 11 into the selected physical units. At the same time, the selected physical units may be associated with the data area 21.
[0027] In one embodiment, the memory controller 103 may configure a plurality of logical units 230(1)-230(C) to map the physical units 201(1)-201(A) in the data area 21. For example, a logical unit may correspond to a logical block address (LBA) or other logical management unit (e.g., a logical page). A logical unit may be mapped to one or more physical units in the data area 21.
[0028] In one embodiment, if a physical unit is currently mapped by any logical unit, the memory controller 103 may determine that the data currently stored in the physical unit includes valid data. Conversely, if a physical unit is not currently mapped by any logical unit, the memory controller 103 may determine that the physical unit does not currently store any valid data (and / or the data in the physical unit are all invalid data).
[0029] In one embodiment, the memory controller 103 may record the mapping relationship between the logical unit and the physical unit in a logic-to-physical mapping table (hereinafter referred to as the mapping table). When receiving an access instruction (such as a read instruction, a write instruction, a delete instruction or other types of instructions) from the host system 11, the memory controller 103 may instruct the memory module 102 to perform the corresponding operation behavior according to the information in the mapping table. Here, there are multiple mapping tables, each of which records part of the logical units and the physical units, and these mapping tables will be stored in the memory module 102. When the memory controller 103 receives a sequential write instruction from the host system, the memory module 102 can read only a part of the mapping table for update, which can reduce the number of times the mapping table is read. The mapping table update method will be described in detail below.
[0030] Figure 3 is a flowchart showing a method for updating a mapping table according to an embodiment. This method is executed by the memory controller 103 and will not be described in detail below. Figure 3In step 301, a sequential write instruction is received from the host system 11, and a plurality of first logical units to be written by the sequential write instruction are obtained. The sequential write instruction includes the data content to be written, the length of the written data, and the starting logical unit. According to the starting logical unit and the length of the written data, continuous first logical units can be obtained. For example, if the starting logical unit is the logical unit coded as 0 and the length of the written data is 29 logical units, the plurality of first logical units to be written are the logical units coded as 0-28.
[0031] In step 302, the starting physical unit corresponding to the sequential write instruction is obtained, and the multiple first physical units required to complete the sequential write instruction are calculated. When the memory controller 103 executes the sequential write instruction, the corresponding starting physical unit can be obtained. For example, after the memory controller 103 executes the previous write instruction, it can know which physical unit is currently used, and the next physical unit can be used as the starting physical unit of the current sequential write instruction. Alternatively, the memory controller 103 temporarily stores the most recently used mapping relationships, and the starting physical unit can be obtained based on these mapping relationships. The present disclosure does not limit how to obtain the starting physical unit. Since a physical block is written from front to back, the sequential write instruction will use continuous physical units, so the subsequent continuous physical units can be calculated based on the starting physical unit and the length of the written data. For example, the starting physical unit is a physical unit coded as p, and the length of the written data is 29 physical units, then the above-mentioned first physical unit is a physical unit coded as p~(p+28), where p is a positive integer.
[0032] It can be understood that the first logic unit includes a starting logic unit, and the first physical unit includes a starting physical unit.
[0033] In step 303, a second mapping table is established based on the first logical unit and the first physical unit. In this embodiment, each mapping table records the mapping relationship of a certain number of logical units. For example, a mapping table can record the mapping relationship of 10 logical units, and the sequential write instruction in the above example will correspond to 3 second mapping tables. Figure 4 is a schematic diagram showing a mapping table according to an embodiment. Figure 4 The second mapping table 401 records the logical units coded 0 to 9, which are mapped to the physical units coded p to p+9 respectively; the second mapping table 402 records the logical units coded 10 to 19, which are mapped to the physical units coded p+10 to p+19 respectively; the second mapping table 403 records the logical units coded 20 to 28, which are mapped to the physical units coded p+20 to p+28 respectively.
[0034] Specifically, the second mapping table is established according to the first logical unit and the first physical unit, that is, the logical address corresponding to the first logical unit and the physical address of the first physical unit are obtained, and the second mapping table is constructed according to the logical address and the physical address.
[0035] In step 304, it is determined whether the second mapping table completely covers the first mapping table. Here, the mapping table originally stored in the memory module 102 is called the first mapping table, and the first mapping table reflects the mapping relationship between the physical unit and the logical unit in the memory module 102 before receiving the sequential write instruction. The logical unit (also called the second logical unit) included in the first mapping table can be obtained in advance. For example, the memory controller 103 additionally records relevant information, including the range of the logical units included in each mapping table. When the sequential write instruction is received, it can be known which first mapping tables are needed. Figure 4 The first mapping tables 411 to 413 are also shown, wherein the first mapping table 411 records the mapping relationship of the logical units with codes 0 to 9, the first mapping table 412 records the mapping relationship of the logical units with codes 10 to 19, and the first mapping table 413 records the mapping relationship of the logical units with codes 20 to 29. Here, it can be determined whether the logical units recorded in the second mapping table completely include the logical units recorded in the first mapping table. If so, it is determined that the second mapping table completely covers the corresponding first mapping table. For example, the logical units recorded in the second mapping table 401 completely include the logical units recorded in the first mapping table 411, so the second mapping table 401 completely covers the first mapping table 411. Similarly, the second mapping table 402 also completely covers the first mapping table 412. However, the second mapping table 403 does not include the logical unit with code 29, and the logical units recorded in the second mapping table 403 do not completely include the logical units recorded in the first mapping table 413, so the second mapping table 403 does not completely cover the first mapping table 413.
[0036] If the second mapping table completely covers the first mapping table, in step 305, the second mapping table is written into the memory module 102 to replace the first mapping table. Figure 4In the example, the second mapping tables 401 and 402 completely cover the first mapping tables 411 and 412 respectively, and the mapping relationships recorded in the first mapping tables 411 and 412 will all be updated, and these old mapping relationships are invalid, and the first mapping tables 411 and 412 have become invalid data. Therefore, the second mapping tables 401 and 402 can be directly written to the memory module 102 without reading the first mapping tables 411 and 412 from the memory module 102, and these first mapping tables 411 and 412 will be discarded. In other words, if the logical unit recorded in the second mapping table completely includes the logical unit recorded in the first mapping table, the second mapping table will be written into the memory module 102. In one embodiment, the first mapping table 411 is originally stored in the first physical block of the memory module 102. When the second mapping table 401 is to be written, the second mapping table 401 will be written into another second physical block, and this second physical block is different from the first physical block. In addition, it is also determined that the first mapping table in the first physical block is invalid data, for example, it can be determined that the first mapping table in the first physical block is not mapped to any logical address. The prior art is to first read the first mapping table 411, 412 from the memory module 102, and then write it back to the memory module 102 after updating, but the above method does not need to read the first mapping table 411, 412, which can reduce the data read to increase the speed of updating the mapping table.
[0037] In one embodiment, if the second mapping table does not completely cover the first mapping table, in step 306, the first mapping table is read from the memory module 102, a third mapping table can be obtained based on the read first mapping table and the second mapping table, and then the third mapping table is written into the memory module 102 to replace the first mapping table. Figure 4 In the example, the logical units in the second mapping table 403 do not completely include the logical units in the first mapping table 413, and the logical unit 420 (code-named 29) is not included. Therefore, it is necessary to read the first mapping tables 411, 412, and 413 from the memory module 102 (read into the memory controller 103), and then obtain the mapping relationship 420 of the logical units that are not included from the first mapping tables 411, 412, and 413, and write this mapping relationship 420 into the second mapping table 403 to obtain the updated third mapping table (including the content of the original second mapping table 403 plus the mapping relationship 420). After writing, the third mapping table includes the mapping relationship of the logical units code-named 20 to 29. Finally, the third mapping table is written into the memory module 102 to replace the first mapping table. In this way, the third mapping table records valid mapping relationships, and the first mapping table can be discarded.
[0038] In another embodiment, when there are multiple first mapping tables, if the second mapping table does not completely cover all the first mapping tables, the first mapping tables that are not completely covered are read from the memory module 102, and a third mapping table can be obtained based on the read first mapping table and the second mapping table, and then the third mapping table is written into the memory module 102 to replace the first mapping table. Figure 4 In the example, the logical units in the second mapping table 403 do not completely include the logical units in the first mapping table 413, and the logical unit 420 (code-named 29) is not included. Therefore, it is necessary to read the first mapping table 413 from the memory module 102 (read into the memory controller 103), and then obtain the mapping relationship 420 of the logical units that are not included from the first mapping table 413, and write this mapping relationship 420 into the second mapping table 403 to obtain the updated third mapping table (including the content of the original second mapping table 403 plus the mapping relationship 420). After writing, the third mapping table includes the mapping relationship of the logical units code-named 20~29. Finally, the third mapping table is written into the memory module 102 to replace the first mapping table. In this way, the third mapping table records valid mapping relationships, and the first mapping table can be discarded.
[0039] In one embodiment, the first mapping table 413 is originally stored in the first physical block of the memory module 102. When the third mapping table is to be written, the third mapping table is written into another second physical block, which is different from the first physical block. In addition, the first mapping table 413 in the first physical block is also determined to be invalid data.
[0040] In addition, in another embodiment, in order to further reduce the reading of the first mapping table, when there are multiple first mapping tables and the second mapping table does not completely cover all the first mapping tables, a second physical unit in the physical unit is determined, wherein the second physical unit only stores the first mapping table that is not covered by the second mapping table. Then, when updating the mapping table, only the first mapping table covered by the second mapping table and not covered by the second mapping table stored in other physical units except the second physical unit is read, and the mapping relationship of the unincluded logical unit is obtained from the first mapping table covered by the second mapping table and not covered by the second mapping table, and the mapping relationship of the unincluded logical unit is written into the second mapping table to generate a third mapping table, and the third mapping table is stored in a second physical block, which is different from the first physical block storing the first mapping table, and the data stored in the second physical unit is determined as valid data, and the data in the physical units storing all the first mapping tables except the second physical unit is determined as invalid data, and in the subsequent garbage collection process, the data stored in the second physical unit is moved to the second physical block.
[0041] For example, when there are three physical units (pages) storing the first mapping table, assuming that each physical unit is 16KB and each first mapping table is 4KB, that is, a total of 12 first mapping tables are stored, wherein the three physical units are named A, B, and C, and the 12 first mapping tables are named al, physical unit A stores the first mapping table ad, physical unit B stores the first mapping table eh, physical unit C stores the first mapping table il, and the second mapping table completely covers the first mapping table hl and the part covering the first mapping table g. At this time, if the mapping table is updated, the first mapping tables e, f, and g stored in physical unit B are read, and the mapping relationship of the logical units in the first mapping tables e, f, and g that are not included in the second mapping table are obtained, and the mapping relationship of the logical units that are not included is written into the second mapping table to generate a third mapping table, and the third mapping table is stored in the second physical block, and the data stored in physical unit A is determined as valid data, and the data stored in physical units B and C are determined as invalid data, and in the subsequent garbage collection process, the data stored in physical unit A is moved to the second physical block.
[0042] Figure 4 The process is for sequential write instructions. Since the logical units and physical units required for the sequential write instructions can be calculated in advance, step 303 can be completed before the write data corresponding to the sequential write instruction is completely written into the memory module 102. In other words, step 303 and the operation of writing data into the memory module 102 can be executed in parallel. In some embodiments, step 303 can be executed during the waiting interval of writing data into the memory module 102 (for example, during the period when the memory module 102 replies "flash program busy"), thereby avoiding updating the mapping table after the data write instruction is completed, thereby improving the updating speed of the mapping table.
[0043] According to the above disclosure, when the second mapping table completely covers the first mapping table, there is no need to read the first mapping table from the memory module 102 , which can reduce the time for updating the mapping table and the number of times the mapping table is read from the memory module 102 .
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A mapping table updating method, It is characterized in that Used in a memory module, the memory module includes a plurality of physical units and stores a first mapping table, the mapping table updating method includes: Receiving a sequential write instruction from a host system, and obtaining a plurality of first logical units to be written by the sequential write instruction; Obtaining the starting physical unit corresponding to the sequential write instruction, and calculating a plurality of first physical units required to complete the sequential write instruction; Establishing a second mapping table according to the first logical unit and the first physical unit; and If the second mapping table completely covers the first mapping table, writing the second mapping table into the memory module to replace the first mapping table, wherein the first mapping table reflects the mapping relationship between the physical units and the logical units in the memory module before receiving the sequential write instruction; The step of obtaining the first logic unit to be written by the sequential write instruction comprises: According to the starting logic unit of the sequential write instruction and the write data length, the continuous first logic unit is obtained, The step of calculating the first physical unit required to complete the sequential write instruction includes: According to the starting physical unit and the length of the written data, obtaining the first continuous physical units; The step of establishing the second mapping table according to the first logical unit and the first physical unit includes: Before the write data corresponding to the sequential write instruction is completely written into the memory module, the second mapping table is established according to the first logical unit and the first physical unit.
2. The mapping table updating method according to claim 1, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein if the second mapping table completely covers the first mapping table, the step of writing the second mapping table into the memory module comprises: If the first logical units recorded in the second mapping table include all the second logical units, the second mapping table is written into the memory module.
3. The mapping table updating method according to claim 1, It is characterized in that The first mapping table is stored in a first physical block of the memory module, wherein the step of writing the second mapping table into the memory module to replace the first mapping table comprises: writing the second mapping table into a second physical block of the memory module, the second physical block being different from the first physical block; and Determine that the first mapping table in the first physical block is invalid data.
4. The mapping table updating method according to claim 1, It is characterized in that Also includes: If the second mapping table does not completely cover the first mapping table, reading the first mapping table from the memory module; as well as A third mapping table is acquired according to the first mapping table and the second mapping table, and the third mapping table is written into the memory module to replace the first mapping table.
5. The mapping table updating method according to claim 4, It is characterized in that The first mapping table has a plurality of sheets, and if the second mapping table does not completely cover the first mapping table, the step of reading the first mapping table from the memory module comprises: If the second mapping table does not completely cover all of the first mapping tables, the first mapping tables that are not completely covered are read from the memory module.
6. The mapping table updating method according to claim 4, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein if the second mapping table does not completely cover the first mapping table, the step of reading the first mapping table from the memory module comprises: If the first logical units recorded in the second mapping table do not include all the second logical units, the first mapping table is read from the memory module.
7. The mapping table updating method according to claim 4, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein the steps of obtaining a third mapping table according to the first mapping table and the second mapping table, and writing the third mapping table into the memory module include: Obtaining a mapping relationship of the second logical unit that is not included from the first mapping table; writing the mapping relationship of the second logic unit that is not included into the second mapping table to obtain the third mapping table; and The third mapping table is written into the memory module.
8. The mapping table updating method according to claim 4, It is characterized in that The first mapping table is stored in a first physical block of the memory module, wherein the step of writing the third mapping table into the memory module to replace the first mapping table comprises: Writing the third mapping table into a second physical block of the memory module, the second physical block being different from the first physical block; and Determine that the first mapping table in the first physical block is invalid data.
9. A storage device, It is characterized in that include: A connection interface unit for connecting to a host system; A memory module, comprising a plurality of physical units and storing a first mapping table; as well as a memory controller connected to the connection interface unit and the memory module, The memory controller is configured to perform a plurality of steps: Receiving a sequential write instruction from a host system, and obtaining a plurality of first logical units to be written by the sequential write instruction; Obtaining the starting physical unit corresponding to the sequential write instruction, and calculating a plurality of first physical units required to complete the sequential write instruction; Establishing a second mapping table according to the first logical unit and the first physical unit; as well as If the second mapping table completely covers the first mapping table, writing the second mapping table into the memory module to replace the first mapping table, wherein the first mapping table reflects the mapping relationship between the physical units and the logical units in the memory module before receiving the sequential write instruction; The step of obtaining the first logic unit to be written by the sequential write instruction comprises: According to the starting logic unit of the sequential write instruction and the write data length, the continuous first logic unit is obtained, The step of calculating the first physical unit required to complete the sequential write instruction includes: According to the starting physical unit and the length of the written data, obtaining the first continuous physical units; The step of establishing the second mapping table according to the first logical unit and the first physical unit includes: Before the write data corresponding to the sequential write instruction is completely written into the memory module, the second mapping table is established according to the first logical unit and the first physical unit.
10. The storage device according to claim 9, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein if the second mapping table completely covers the first mapping table, the step of writing the second mapping table into the memory module comprises: If the first logical units recorded in the second mapping table include all the second logical units, the second mapping table is written into the memory module.
11. The storage device according to claim 9, It is characterized in that The first mapping table is stored in a first physical block of the memory module, wherein the step of writing the second mapping table into the memory module to replace the first mapping table comprises: writing the second mapping table into a second physical block of the memory module, the second physical block being different from the first physical block; and Determine that the first mapping table in the first physical block is invalid data.
12. The storage device according to claim 9, It is characterized in that Also includes: If the second mapping table does not completely cover the first mapping table, reading the first mapping table from the memory module; as well as A third mapping table is acquired according to the first mapping table and the second mapping table, and the third mapping table is written into the memory module to replace the first mapping table.
13. The storage device according to claim 12, It is characterized in that The first mapping table has a plurality of sheets, and if the second mapping table does not completely cover the first mapping table, the step of reading the first mapping table from the memory module comprises: If the second mapping table does not completely cover all of the first mapping tables, the first mapping tables that are not completely covered are read from the memory module.
14. The storage device according to claim 12, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein if the second mapping table does not completely cover the first mapping table, the step of reading the first mapping table from the memory module comprises: If the first logical units recorded in the second mapping table do not include all the second logical units, the first mapping table is read from the memory module.
15. The storage device according to claim 12, It is characterized in that The first mapping table is used to record a plurality of second logical units, wherein the steps of obtaining a third mapping table according to the first mapping table and the second mapping table, and writing the third mapping table into the memory module include: Obtaining a mapping relationship of the second logical unit that is not included from the first mapping table; writing the mapping relationship of the second logic unit that is not included into the second mapping table to obtain the third mapping table; and The third mapping table is written into the memory module.
16. The storage device according to claim 12, It is characterized in that The first mapping table is stored in a first physical block of the memory module, wherein the step of writing the third mapping table into the memory module to replace the first mapping table comprises: Writing the third mapping table into a second physical block of the memory module, the second physical block being different from the first physical block; and Determine that the first mapping table in the first physical block is invalid data.
