CN115220664A - SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium - Google Patents

SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115220664A
CN115220664A CN202210997533.6A CN202210997533A CN115220664A CN 115220664 A CN115220664 A CN 115220664A CN 202210997533 A CN202210997533 A CN 202210997533A CN 115220664 A CN115220664 A CN 115220664A
Authority
CN
China
Prior art keywords
mapping table
write
time stamp
last copy
user data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210997533.6A
Other languages
Chinese (zh)
Inventor
王猛
徐伟华
李建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Yilian Information System Co Ltd
Original Assignee
Suzhou Yilian Information System Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Yilian Information System Co Ltd filed Critical Suzhou Yilian Information System Co Ltd
Priority to CN202210997533.6A priority Critical patent/CN115220664A/en
Publication of CN115220664A publication Critical patent/CN115220664A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a method and a device for storing and synchronizing an SSD mapping table and user data, a computer device and a storage medium, wherein the method comprises the following steps: acquiring a read-write request issued by a host; judging whether the read-write request triggers a mapping table to store or not; acquiring timestamp information of a current writing point; the host is powered off; powering on the host computer, and acquiring the last copy data of the mapping table storage area; acquiring write-in information of a user data storage area; judging whether the time stamp in the write-in information is larger than the time stamp in the last copy data or not; judging whether the time stamp in the writing information is equal to the time stamp in the last copy data or not; reading a physical page of a write point; judging whether the physical pages of the write-in point are all written in user data or not; and the last copy of the copied data is effective, and is recovered based on the mapping table stored in the last copy of the copied data, and the read-write request issued by the host is responded. The invention can not interrupt the reading and writing of the user data when the mapping table is stored, thereby greatly improving the performance consistency.

Description

SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of SSD mapping tables, in particular to a method and a device for storing and synchronizing an SSD mapping table and user data, computer equipment and a storage medium.
Background
SSD (solid state disk) has been widely used in various occasions, and has been gradually replacing the conventional HDD in the PC market at present, providing better experience for users in terms of reliability and performance.
The SSD internally uses NAND as a medium for data storage, the host accesses the SSD based on logical addresses (LBA), and the SSD internally maintains a logical-to-physical address mapping table (L2P table) indicating physical addresses where corresponding logical address data is stored. For the host command, which carries LBA address information, the SSD internally converts it into LPA addresses (e.g., LBA0-7 corresponds to LPA0, LBA8-15 corresponds to LPA1 \8230;); and an L2P table maintained in the memory with an LPA index and a GPPA (physical NAND address) value. If the command is a read command, inquiring an L2P table in the memory according to the LPA address to obtain a physical address GPPA for storing data, further initiating the reading of a corresponding address, and returning the data to the host; if the command is a write command, the SSD internally allocates a physical address for storing the relevant data, and updates the corresponding physical address to the corresponding LPA index in the L2P table.
In the existing SSD, a mapping table from a logical address to a physical address is maintained in a memory, so as to speed up address query and update of a host read/write command.
Since the content of the memory is lost when there is a power failure, the mapping table in the memory needs to be periodically saved to the NAND, and the writing (validation) of the mapping table and the writing (validation) of the user data are dependent: the user data must be written/validated before the corresponding mapping table can be written/validated, otherwise, an exception of reading the unwritten user data occurs during recovery. To achieve this goal, when the mapping table is written, the reading and writing of the host need to be suspended, the operation that the mapping table is submitted to the back-end NAND is completed, then the writing of the mapping table is performed, and the reading and writing processing of the host is resumed after the writing of the mapping table is completed. The process is called synchronization and is used for ensuring the writing sequence of user data and a mapping table, and the processing of the host reading and writing requests needs to be suspended in the process, and the submitted requests are recycled, so that the performance of the host is temporarily reduced, and the performance consistency is greatly influenced.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method and a device for storing and synchronizing an SSD mapping table and user data, computer equipment and a storage medium.
In order to solve the technical problem, the invention adopts the following technical scheme:
in a first aspect, the present embodiment provides a method for synchronizing a SSD mapping table with user data storage, including the following steps:
acquiring a read-write request issued by a host;
judging whether the read-write request triggers a mapping table to store or not;
if the read-write request triggers the storage of the mapping table, acquiring the timestamp information of the current write point;
storing a mapping table to be stored and the timestamp information of the current writing point into a NAND mapping table storage area;
the host is powered off;
powering on the host computer, and acquiring the last copy data of the mapping table storage area;
acquiring writing information of a user data storage area;
comparing the time stamp in the last copy data with the time stamp in the written information;
judging whether the time stamp in the write-in information is larger than the time stamp in the last copy data or not;
if the time stamp in the written information is not larger than the time stamp in the last copy data, judging whether the time stamp in the written information is equal to the time stamp in the last copy data or not;
if the time stamp in the writing information is equal to the time stamp in the last copy data, reading the writing point physical page corresponding to each DIE in the last copy data;
judging whether the physical pages of the write-in points corresponding to all DIE are written in user data or not;
and if the physical page of the write-in point corresponding to each DIE is written in the user data, the last copy data is valid, and the recovery is carried out based on the mapping table stored in the last copy data, so as to respond to the read-write request issued by the host.
The further technical scheme is as follows: in the step of obtaining the current write-in point timestamp information, the write-in point timestamp information includes a physical block number, a physical block timestamp, and a write-in point physical page number of each DIE.
The further technical scheme is as follows: after the step of determining whether the timestamp in the write information is equal to the timestamp in the last copy of data, the method further includes: and if the time stamp in the write information is not equal to the time stamp in the last copy data, the last copy data is invalid, the copy data before the last copy data is checked, and the acquisition of the write information in the user data storage area is skipped to execute.
The further technical scheme is as follows: after the step of determining whether the write point physical pages corresponding to the respective DIE are all written with the user data, the method further includes: and if the user data is not written into the physical pages of the writing points corresponding to the DIE, skipping to execute the last copy data to be invalid, and checking the previous copy data of the last copy data.
In a second aspect, the present embodiment provides an SSD mapping table and user data storage synchronization apparatus, including: the device comprises a first acquisition unit, a first judgment unit, a second acquisition unit, a storage unit, a power failure unit, a power-on acquisition unit, a third acquisition unit, a comparison unit, a second judgment unit, a third judgment unit, a reading unit, a fourth judgment unit and a recovery response unit;
the first obtaining unit is used for obtaining a read-write request issued by a host;
the first judging unit is used for judging whether the reading and writing request triggers the storage of the mapping table;
the second obtaining unit is used for obtaining the timestamp information of the current writing point if the reading and writing request triggers the mapping table to store;
the storage unit is used for storing the mapping table to be stored and the timestamp information of the current writing point into a NAND mapping table storage area;
the power down unit is used for powering down the host;
the power-on acquisition unit is used for powering on the host computer and acquiring the last copy data of the mapping table storage area;
the third obtaining unit is used for obtaining the writing information of the user data storage area;
the comparison unit is used for comparing the time stamp in the last copy data with the time stamp in the writing information;
the second judging unit is used for judging whether the time stamp in the written information is larger than the time stamp in the last copy data;
the third judging unit is configured to judge whether the timestamp in the write information is equal to the timestamp in the last copy data if the timestamp in the write information is not greater than the timestamp in the last copy data;
the reading unit is used for reading the writing point physical page corresponding to each DIE in the last copy data if the time stamp in the writing information is equal to the time stamp in the last copy data;
the fourth judging unit is configured to judge whether the user data is written into the writing point physical pages corresponding to each DIE;
and the recovery response unit is used for enabling the last copy data to be valid if the user data is written into the write-in point physical page corresponding to each DIE, recovering based on a mapping table stored in the recovery response unit, and responding to the read-write request issued by the host.
The further technical scheme is as follows: in the second obtaining unit, the write-in point timestamp information includes a physical block number, a physical block timestamp, and a write-in point physical page number of each DIE.
The further technical scheme is as follows: further comprising: and the checking and skipping unit is used for checking the copy data before the last copy data if the time stamp in the written information is not equal to the time stamp in the last copy data, and skipping to execute the acquired written information in the user data storage area.
The further technical scheme is as follows: further comprising: and the skipping unit is used for skipping to execute the last copy data invalidity and checking the previous copy data of the last copy data if the write point physical pages corresponding to the DIEs are not written with the user data.
In a third aspect, this embodiment provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor implements the SSD mapping table and user data storage synchronization method as described above when executing the computer program.
In a fourth aspect, the present embodiment provides a storage medium storing a computer program, the computer program comprising program instructions, which when executed by a processor, can implement the SSD mapping table and user data saving synchronization method as described above.
Compared with the prior art, the invention has the beneficial effects that: when the mapping table is stored, the reading and writing of user data can not be interrupted, and the performance consistency is greatly improved.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of a typical read-write scenario for an SSD;
FIG. 2 is a diagram illustrating a scenario of storing a trigger mapping table in the conventional read/write process;
fig. 3 is a schematic flowchart of a method for synchronizing the SSD mapping table and the user data storage according to an embodiment of the present invention;
fig. 4 is a schematic view of a first application scenario of the SSD mapping table and the user data storage synchronization method according to the embodiment of the present invention;
fig. 5 is a schematic view of an application scenario of a SSD mapping table and a user data storage synchronization method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of an SSD mapping table and a user data storage synchronization apparatus provided by an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
Please refer to the typical read/write flow of SSD shown in fig. 1:
the host sends a command to the SSD hardware module;
after receiving the command, the SSD hardware module PCIe/NVMe transfers the command to the firmware module for processing;
the SSD firmware front-end module splits the command into mapped units (typically 4 KB);
submitting an operation request to a buffer management module and distributing a read-write buffer;
if the command is a write command, establishing data transmission with the host according to the allocated buffer area, and informing the host that the command is finished after the data transmission is finished;
if the command is a read command, submitting an operation request to a mapping table management module;
the mapping table management module is responsible for allocating corresponding physical addresses (write commands) according to the logical addresses or converting the logical addresses into NAND physical addresses (read commands);
submitting an operation request to a back-end module, and enabling the back-end module to initiate a read/write request for the NAND according to the physical address;
waiting for the NAND read/write operation request to complete;
if the command is a read command, after the data Ready is Ready, the data transmission from the NAND Cache Register (NAND memory) to the host is started.
Please refer to the scenario shown in fig. 2, where the mapping table is triggered to be saved during the read/write process:
along with accumulation of read-write requests of a host, a plurality of table entries in a mapping table in a memory are changed since the last storage, if power is lost at a certain moment, the mapping table needs to be reconstructed by scanning a corresponding user area, the consumed time is long, in order to guarantee the reconstruction time after the power is lost, a mapping table part can be periodically triggered to be stored on an NAND, and when the mapping table is triggered to be stored, strict synchronization is needed in order to guarantee the writing/validation sequence of user data and mapping table data;
the mapping table management module suspends the processing of the host read-write command;
waiting for the NAND read-write request processing of all the submitted back-end modules to be completed (ensuring that the user data is completely written/validated);
starting the storage of the mapping table in the NAND storage area (writing/validation of mapping table data);
and the mapping table management module recovers the host read-write command processing.
During the storage of the mapping table, a specific synchronization action needs to be performed, which causes interruption of command processing of the host and further causes performance fluctuation.
Referring to the specific embodiment shown in fig. 3, the present invention discloses a method for synchronizing the SSD mapping table and the user data storage, comprising the following steps:
s1, acquiring a read-write request issued by a host;
s2, judging whether the read-write request triggers a mapping table to store or not; if the read-write request does not trigger the storage of the mapping table, returning to execute the read-write request issued by the acquisition host;
s3, if the read-write request triggers the storage of the mapping table, acquiring the timestamp information of the current write point;
in an embodiment, in the step S3, the write-in point timestamp information includes a physical block number, a physical block timestamp, and a write-in point physical page number of each DIE.
S4, storing the mapping table to be stored and the timestamp information of the current writing point in a NAND mapping table storage area;
in a specific embodiment, after the step S4, the method further includes: and circularly executing the steps S1 to S4.
S5, powering down the host;
s6, powering on the host to obtain the last copy data of the mapping table storage area;
s7, acquiring write-in information of the user data storage area;
in an embodiment, in step S7, the write information includes a write point physical block number, a physical block timestamp, and a write point physical page number of each DIE.
S8, comparing the time stamp in the last copy data with the time stamp in the written information;
in particular, the time stamp in the last copy of data is compared with the time stamp in the written information, i.e. the two time stamps are compared, which is earlier or which is later.
Specifically, the physical block timestamp: the time stamp of the physical block corresponding to the write-in point of the user data area is a monotonically increasing integer, the size can be directly compared, and the time of the physical block of the time stamp in the copy data and the time stamp of the write-in point of the current user data area are compared.
S9, judging whether the time stamp in the written information is larger than the time stamp in the last copy data or not; and if the time stamp in the write information is greater than that in the last copy data, skipping to execute the last copy data to be effective, recovering based on a mapping table stored in the last copy data, and responding to a read-write request issued by the host.
Specifically, by determining which of the time stamp in the write information and the time stamp in the last copy of the data is later.
S10, if the time stamp in the written information is not larger than the time stamp in the last copy data, namely the time stamp in the written information is not later than the time stamp in the last copy data, judging whether the time stamp in the written information is equal to the time stamp in the last copy data or not; if the time stamp in the write information is not equal to the time stamp in the last copy data, the last copy data is invalid, the copy data before the last copy data is checked, and the step of obtaining the write information in the user data storage area is skipped to execute, namely the step S14;
specifically, checking the last copy of the data refers to changing the aforementioned checking process again, but changing the copy of the mapping region from the last to the previous.
S11, if the time stamp in the written information is equal to the time stamp in the last copy data, namely the time stamp in the written information is the same as the time stamp in the last copy data, reading the write-in point physical page corresponding to each DIE in the last copy data;
s12, judging whether the physical pages of the writing points corresponding to all DIEs are written with user data; and if the physical pages of the write points corresponding to the DIE are not all written with the user data, skipping to execute the last copy data to be invalid, and checking the previous copy data of the last copy data.
And S13, if the write-in point physical page corresponding to each DIE writes user data, the last copy of data is valid, the data is recovered based on a mapping table stored in the last copy of data, and a read-write request issued by the host is responded.
Specifically, the recovery based on the mapping table stored therein refers to reading the content of the mapping table storage area into the memory. Responding to the read/write request issued by the host refers to processing the host read/write command, specifically referring to the host read/write process of fig. 1, which should not be repeated here.
Referring to the application scenario diagram shown in fig. 4, the SSD includes: a DIE, an independent operation unit, which contains a plurality of physical blocks; block, physical Block, independent erase unit, containing multiple physical pages; page, physical Page, minimum read-write unit, which must erase the entire physical block before it is written to and overwritten again; an SSD is internally composed of a plurality of DIEs to improve capacity and concurrency performance, and for convenience of description, the invention is described by two DIEs, namely DIE0 and DIE1;
the internal NAND of the SSD is divided into a plurality of areas, and at least comprises the following areas:
a user data storage area for storing user data;
the mapping table storage area is used for storing mapping table data;
a user data storage area, where a user data write-in point at any time is composed of a next physical Block of each DIE, such as Block X shown in the figure, and further, in order to represent the sequence of data write-in, there is a user data timestamp corresponding to TS _ X (the timestamp is monotonically increased, and corresponding timestamp information is increased when a group of physical blocks is newly allocated every time);
a mapping table holding area, each complete Copy (Copy data) containing several physical pages, each physical page consisting of:
part of mapping table entries in the memory L2P table: which has changed after the last storage;
the user area timestamp is used for indicating the position of a corresponding user data area writing point when the mapping table is stored, and it needs to be noted that, because asynchronous operation exists between the mapping table management module and the rear-end module, when the writing point information is recorded, the physical position of the corresponding user data area is already distributed but writing may not be completed;
the user zone timestamp format of the mapping table Copy further contains the following information:
the writing point physical block number refers to the physical block number of the writing point in the user data area;
the physical block timestamp refers to a timestamp of a physical block corresponding to a writing point of the user data area;
the current Page number written in by each DIE writing point physical block is as follows: DIE0 Page X/DIE 1 Page Y.
When the mapping table is triggered to be stored, special synchronous operation is not needed, the user area time stamp information is synchronously stored in the copy stored in the mapping table, the storage of the mapping table and the reading and writing of the user data at the rear end can be finished in parallel, and the judgment processing is carried out only when the synchronization of the mapping table and the user data is left to be recovered when the subsequent power failure occurs. The host power failure process is rare, the synchronization during frequent storage is transferred to the rare synchronization during recovery, and the performance consistency during operation can be greatly improved.
Referring to the application scenario diagram shown in fig. 5, a processing flow after abnormal power failure and power up is as follows:
the timestamp information of the user data area of the last two copies of the mapping table storage area is as follows:
Copy N:
writing a point physical block number X in a user data area;
writing a point physical block writing point time stamp TS _ X in the user data area;
user data area write point physical page: DIE0, page 1; DIE1, page 1;
Copy N+1:
writing a point physical block number X in a user data area;
writing a point physical block writing point time stamp TS _ X in the user data area;
user data area write point physical page: DIE0, page 4; DIE1, page 4.
The current write point of the user data area is:
the current write point physical block number X;
a current write point physical block write point timestamp TS _ X;
user data area write point physical page: DIE0, page 4; DIE1, page 3.
In this scenario, in the mapping table holding region COPY N +1, the mapping tables of the corresponding DIE1 and page 4 are already valid, and in the actual user data region, the corresponding DIE1 and page 4 have not been written (still empty), and if the COPY N +1 is used for recovery by mistake, the user data will point to a blank physical page, which may cause an exception.
In the invention, the physical page of the DIE corresponding to the user data area stored in the mapping table COPY can be read firstly, if the physical page is empty, the current mapping table COPY is invalid, and the COPY (COPY N) of the last mapping table is returned for trying; and if the physical page of the write point of the user data area pointed by COPY N is all non-empty, it indicates that it is valid, and it can be used to perform mapping table recovery.
The invention can not interrupt the reading and writing of the user data when the mapping table is stored, thereby greatly improving the performance consistency.
Referring to fig. 6, the present invention further discloses a device for storing and synchronizing the SSD mapping table and the user data, including: a first obtaining unit 10, a first judging unit 20, a second obtaining unit 30, a storing unit 40, a power-down unit 50, a power-up obtaining unit 60, a third obtaining unit 70, a comparing unit 80, a second judging unit 90, a third judging unit 100, a reading unit 110, a fourth judging unit 120 and a recovery responding unit 130;
the first obtaining unit 10 is configured to obtain a read-write request issued by a host;
the first judging unit 20 is configured to judge whether the read-write request triggers a mapping table to be stored;
the second obtaining unit 30 is configured to obtain timestamp information of a current write point if the read-write request triggers storage of the mapping table;
the storage unit 40 is configured to store the mapping table that needs to be stored and the timestamp information of the current write point in the NAND mapping table storage area;
the power down unit 50 is used for powering down the host;
the power-on obtaining unit 60 is configured to power on the host computer to obtain the last copy data of the mapping table storage area;
the third obtaining unit 70 is configured to obtain write information of the user data storage area;
the comparing unit 80 is configured to compare the timestamp in the last copy of data with the timestamp in the written information;
the second judging unit 90 is configured to judge whether the timestamp in the write information is greater than the timestamp in the last copy data;
the third determining unit 100 is configured to determine whether the timestamp in the written information is equal to the timestamp in the last copy of data if the timestamp in the written information is not greater than the timestamp in the last copy of data;
the reading unit 110 is configured to read, if the timestamp in the write information is equal to the timestamp in the last copy data, a write point physical page corresponding to each DIE in the last copy data;
the fourth determining unit 120 is configured to determine whether the user data is written in the writing point physical page corresponding to each DIE;
the recovery response unit 130 is configured to, if the write point physical page corresponding to each DIE writes user data, determine that the last copy data is valid, perform recovery based on a mapping table stored in the recovery response unit, and respond to a read/write request issued by the host.
In the second obtaining unit 30, the write-in point timestamp information includes a physical block number, a physical block timestamp, and a write-in point physical page number of each DIE.
Wherein, the device still includes: and a checking and skipping unit 140, configured to, if the timestamp in the write information is not equal to the timestamp in the last copy data, invalidate the last copy data, check a copy data before the last copy data, and skip execution of the obtaining of the write information in the user data storage area.
Wherein, the device still includes: and the skipping unit is used for skipping to execute the last copy data invalidity and checking the previous copy data of the last copy data if the write point physical pages corresponding to the DIEs are not written with the user data.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation processes of the SSD mapping table, the user data storage synchronization apparatus, and each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, no further description is provided here.
The SSD mapping table and user data storage synchronizing means may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application; the computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 7, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032 include program instructions that, when executed, cause the processor 502 to perform an SSD mapping table and user data storage synchronization method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 may execute a method for synchronizing the SSD mapping table and the user data storage.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the scope of the present application as such may be used with a computer device 500, and that a particular computer device 500 may include more or less components than those shown, or some of the components may be combined, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to perform the steps of:
s1, acquiring a read-write request issued by a host;
s2, judging whether the read-write request triggers a mapping table to store or not;
s3, if the read-write request triggers a mapping table to store, acquiring timestamp information of a current write point;
s4, storing the mapping table to be stored and the timestamp information of the current write point into a NAND mapping table storage area;
s5, powering down the host;
s6, powering on the host computer, and acquiring the last copy data of the storage area of the mapping table;
s7, acquiring writing information of a user data storage area;
s8, comparing the time stamp in the last copy data with the time stamp in the written information;
s9, judging whether the time stamp in the written information is larger than the time stamp in the last copy data or not;
step S10, if the time stamp in the written information is not larger than the time stamp in the last copy data, judging whether the time stamp in the written information is equal to the time stamp in the last copy data or not;
step S11, if the time stamp in the write-in information is equal to the time stamp in the last copy data, reading the write-in point physical page corresponding to each DIE in the last copy data;
step S12, judging whether the physical pages of the write points corresponding to all DIE are written with user data;
and S13, if the write-in point physical pages corresponding to all DIE write user data, the last copy data is valid, and the recovery is carried out based on the mapping table stored in the last copy data, so as to respond to the read-write request issued by the host.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing relevant hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program comprises program instructions that, when executed by a processor, implement the SSD mapping table and user data saving synchronization method described above. The storage medium stores a computer program comprising program instructions which, when executed by a processor, implement the method described above. The program instructions include the steps of:
step S1, obtaining a read-write request issued by a host;
s2, judging whether the read-write request triggers a mapping table to store or not;
s3, if the read-write request triggers a mapping table to store, acquiring timestamp information of a current write point;
s4, storing the mapping table to be stored and the timestamp information of the current write point into a NAND mapping table storage area;
s5, powering down the host;
s6, powering on the host computer, and acquiring the last copy data of the mapping table storage area;
s7, acquiring writing information of a user data storage area;
s8, comparing the time stamp in the last copy data with the time stamp in the written information;
s9, judging whether the time stamp in the written information is larger than the time stamp in the last copy data or not;
step S10, if the time stamp in the written information is not larger than the time stamp in the last copy data, judging whether the time stamp in the written information is equal to the time stamp in the last copy data or not;
step S11, if the time stamp in the writing information is equal to the time stamp in the last copy data, reading the writing point physical page corresponding to each DIE in the last copy data;
step S12, judging whether the physical pages of the write points corresponding to all DIE are written with user data;
and S13, if the write-in point physical pages corresponding to all DIE write user data, the last copy data is valid, and the recovery is carried out based on the mapping table stored in the last copy data, so as to respond to the read-write request issued by the host.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media of program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
The above embodiments are preferred implementations of the present invention, and besides, the present invention can be implemented in other ways, and any obvious substitutions without departing from the concept of the present invention are within the protection scope of the present invention.

Claims (10)

  1. The method for storing and synchronizing the SSD mapping table and the user data is characterized by comprising the following steps of:
    acquiring a read-write request issued by a host;
    judging whether the read-write request triggers a mapping table to store or not;
    if the read-write request triggers the storage of the mapping table, acquiring the timestamp information of the current write point;
    storing a mapping table to be stored and the timestamp information of the current writing point into a NAND mapping table storage area;
    the host is powered off;
    powering on the host computer, and acquiring the last copy data of the mapping table storage area;
    acquiring write-in information of a user data storage area;
    comparing the time stamp in the last copy data with the time stamp in the written information;
    judging whether the time stamp in the written information is larger than the time stamp in the last copy data;
    if the time stamp in the written information is not larger than the time stamp in the last copy data, judging whether the time stamp in the written information is equal to the time stamp in the last copy data or not;
    if the time stamp in the writing information is equal to the time stamp in the last copy data, reading the writing point physical page corresponding to each DIE in the last copy data;
    judging whether the physical pages of the write-in points corresponding to all DIE are written in user data or not;
    and if the physical page of the write-in point corresponding to each DIE is written in the user data, the last copy data is valid, and the recovery is carried out based on the mapping table stored in the last copy data, so as to respond to the read-write request issued by the host.
  2. 2. The method as claimed in claim 1, wherein in the step of obtaining the timestamp information of the current writing point, the timestamp information of the writing point includes a physical block number, a physical block timestamp, and a writing point physical page number of each DIE.
  3. 3. The method for synchronizing SSD mapping tables with user data storage according to claim 1, wherein after the step of determining whether the timestamp in the written information is equal to the timestamp in the last copy of data, further comprising: and if the time stamp in the write information is not equal to the time stamp in the last copy data, the last copy data is invalid, the copy data before the last copy data is checked, and the acquisition of the write information in the user data storage area is skipped to execute.
  4. 4. The method for storing and synchronizing the SSD mapping tables and the user data according to claim 3, wherein after the step of determining whether the user data is written in the write point physical pages corresponding to the respective DIE, the method further comprises: and if the physical pages of the write points corresponding to the DIE are not all written with the user data, skipping to execute the last copy data to be invalid, and checking the previous copy data of the last copy data.
  5. The SSD mapping table and user data storage synchronizing device is characterized by comprising: the device comprises a first acquisition unit, a first judgment unit, a second acquisition unit, a storage unit, a power failure unit, a power-on acquisition unit, a third acquisition unit, a comparison unit, a second judgment unit, a third judgment unit, a reading unit, a fourth judgment unit and a recovery response unit;
    the first obtaining unit is used for obtaining a read-write request issued by a host;
    the first judging unit is used for judging whether the reading and writing request triggers the storage of the mapping table;
    the second obtaining unit is used for obtaining the timestamp information of the current write-in point if the read-write request triggers the storage of the mapping table;
    the storage unit is used for storing the mapping table to be stored and the timestamp information of the current writing point into a NAND mapping table storage area;
    the power down unit is used for powering down the host;
    the power-on acquisition unit is used for powering on the host computer and acquiring the last copy data of the storage area of the mapping table;
    the third obtaining unit is used for obtaining the writing information of the user data storage area;
    the comparison unit is used for comparing the time stamp in the last copy data with the time stamp in the written information;
    the second judging unit is used for judging whether the time stamp in the written information is larger than the time stamp in the last copy data;
    the third judging unit is configured to judge whether the timestamp in the write information is equal to the timestamp in the last copy data if the timestamp in the write information is not greater than the timestamp in the last copy data;
    the reading unit is used for reading the writing point physical page corresponding to each DIE in the last copy data if the time stamp in the writing information is equal to the time stamp in the last copy data;
    the fourth judging unit is configured to judge whether the user data is written into the writing point physical pages corresponding to each DIE;
    and the recovery response unit is used for enabling the last copy data to be valid if the user data is written into the write-in point physical page corresponding to each DIE, recovering based on a mapping table stored in the recovery response unit, and responding to the read-write request issued by the host.
  6. 6. The device for storing and synchronizing the SSD mapping table with the user data as claimed in claim 5, wherein the write point timestamp information in the second obtaining unit comprises a physical block number, a physical block timestamp, and a write point physical page number of each DIE.
  7. 7. The SSD mapping table and user data storage synchronizing device of claim 5, further comprising: and the checking and skipping unit is used for checking the copy data before the last copy data if the time stamp in the written information is not equal to the time stamp in the last copy data, and skipping to execute the acquired written information in the user data storage area.
  8. 8. The SSD mapping table and user data storage synchronizing device of claim 7, further comprising: and the skipping unit is used for skipping to execute the last copy data invalidity and checking the previous copy data of the last copy data if the write point physical pages corresponding to the DIEs are not written with the user data.
  9. 9. A computer device comprising a memory having stored thereon a computer program and a processor that, when executing the computer program, implements the SSD mapping table and user data saving synchronization method of any of claims 1-4.
  10. 10. A storage medium, characterized in that the storage medium stores a computer program comprising program instructions which, when executed by a processor, implement the SSD mapping table and user data saving synchronization method of any of claims 1-4.
CN202210997533.6A 2022-08-19 2022-08-19 SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium Pending CN115220664A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210997533.6A CN115220664A (en) 2022-08-19 2022-08-19 SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210997533.6A CN115220664A (en) 2022-08-19 2022-08-19 SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115220664A true CN115220664A (en) 2022-10-21

Family

ID=83616171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210997533.6A Pending CN115220664A (en) 2022-08-19 2022-08-19 SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115220664A (en)

Similar Documents

Publication Publication Date Title
USRE48736E1 (en) Memory system having high data transfer efficiency and host controller
US10983955B2 (en) Data unit cloning in memory-based file systems
KR100734823B1 (en) Method and apparatus for morphing memory compressed machines
CN108431783B (en) Access request processing method and device and computer system
US9081692B2 (en) Information processing apparatus and method thereof
CN101840362A (en) Method and device for achieving copy-on-write snapshot
US10754785B2 (en) Checkpointing for DRAM-less SSD
CN106294205B (en) Cache data processing method and device
US11960396B2 (en) Method and computer program product for performing data writes into a flash memory
CN111324303A (en) SSD garbage recycling method and device, computer equipment and storage medium
JP2017527877A (en) Method and apparatus for reading / writing data from / to flash memory and user equipment
CN114780448A (en) Method and device for quickly copying data, computer equipment and storage medium
CN116755625A (en) Data processing method, device, equipment and readable storage medium
CN111563052A (en) Cache method and device for reducing read delay, computer equipment and storage medium
CN116225334A (en) Cold and hot data storage method, device and medium
CN110737607A (en) Method and device for managing HMB memory, computer equipment and storage medium
WO2016206070A1 (en) File updating method and storage device
EP4044015A1 (en) Data processing method and apparatus
CN110928890B (en) Data storage method and device, electronic equipment and computer readable storage medium
WO2023193630A1 (en) Peak detection method and apparatus, and computer device and storage medium
CN108958657B (en) Data storage method, storage device and storage system
US20230142948A1 (en) Techniques for managing context information for a storage device
CN115220664A (en) SSD mapping table and user data storage synchronization method and device, computer equipment and storage medium
CN115587050A (en) Mapping table garbage recovery efficiency method and device, computer equipment and medium
CN109002265B (en) Data processing method and related 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