A method, device, system and electronic equipment for processing recorded data

By synchronizing the recorded data in the initial buffer of the solid state drive to the target buffer, the problem of low reliability of the recording table in the first power-on mode of the solid state drive is solved, and the effect of reading reliable recorded data during factory repair is achieved.

CN119201010BActive Publication Date: 2025-02-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411722197.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-28
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In the first power-on mode of the SSD, the record table previously stored in the NAND SLC may be lost or incorrect, reducing the reliability of the record table.

Method used

By obtaining the recorded data in the initial buffer in the solid state drive and syncing it to the target buffer. When the SSD enters first power-on mode, record data is read from the target buffer. The recorded data in the initial buffer is erased in the first power-on mode, while the recorded data in the target buffer is retained.

Benefits of technology

Ensure that when the SSD returns to the factory to enter the first power-on mode, it can read high-reliability record data from the target buffer, improve the utilization rate of the faulty disk and reduce production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention relates to the field of storage technology, and discloses a method, device, system and electronic device for processing recorded data, the method comprising: obtaining recorded data cached in an initial buffer in a solid-state hard disk; synchronizing the recorded data to a target buffer; reading the recorded data from the target buffer when the solid-state hard disk enters the first power-on mode; wherein the recorded data cached in the initial buffer is erased when the solid-state hard disk enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid-state hard disk enters the first power-on mode. The method provided by the above scheme synchronizes the recorded data in the initial buffer to the target buffer, so as to ensure that the solid-state hard disk can read the recorded data with higher reliability from the target buffer when it enters the first power-on mode during the return to factory repair process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a method, device, system and electronic device for processing recorded data. Background Art

[0002] Solid State Disk (SSD) stores data based on NAND particles. The number of times NAND particles are erased and written limits their service life. Data erased from NAND particles is in units of logical blocks. Therefore, how to maintain the record data of the number of erase times for each logical block in each NAND particle has become a key research topic.

[0003] In the related art, a record table is usually used to record the number of times each logic block in each NAND particle in the solid-state drive is erased, and the NAND Flash storage technology NAND SLC (Single-Level Cell) is used to store the record table.

[0004] However, after long-term operation of the SSD, the SSD may fail and will be powered off for maintenance. During the maintenance process, the SSD will enter the first power-on mode. In this mode, the record table previously stored in the NAND SLC may be lost or erroneous, reducing the reliability of the record table. Summary of the invention

[0005] The present application provides a method, device, system and electronic device for processing recorded data to solve the defects of the related art that a highly reliable record table cannot be obtained in the first power-on mode.

[0006] The first aspect of the present application provides a method for processing recorded data, comprising:

[0007] Obtaining the record data cached in the initial buffer in the solid state drive;

[0008] Synchronizing the recorded data to a target buffer;

[0009] When the solid state drive enters the first power-on mode, reading the recorded data from the target buffer;

[0010] The recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode.

[0011] In an optional implementation, synchronizing the recorded data to a target buffer includes:

[0012] Creating a record data cache unit in the target cache;

[0013] Creating a record table in the record data cache unit;

[0014] The record data is synchronously cached to the corresponding target record table.

[0015] In an optional implementation, the creating a data buffer area in the target buffer includes:

[0016] Obtaining the capacity of the solid state drive;

[0017] Determining a target creation quantity of the record data cache unit according to the capacity of the solid state drive;

[0018] Creating a record data cache unit in the target buffer according to the target creation quantity;

[0019] The target creation quantity is negatively correlated with the capacity of the solid state drive.

[0020] In an optional implementation manner, creating a record data cache unit in the target buffer according to the target creation quantity includes:

[0021] According to the target creation quantity, a corresponding number of record data cache units are created in each data cache area of ​​the target cache;

[0022] The record data cache unit corresponds to the record table one by one.

[0023] In an optional implementation, the synchronously caching the record data to the corresponding target record table includes:

[0024] Obtaining the header file of the record table in each of the record data cache units;

[0025] Filtering a target record table from a plurality of record tables according to the header files of each of the record tables;

[0026] The record data is synchronously cached to the target record table.

[0027] In an optional implementation, the step of screening a target record table from a plurality of record tables according to the header files of each of the record tables includes:

[0028] According to the header files of each of the record tables, determining whether each record data buffer unit of the target buffer is in an empty state;

[0029] When each record data cache unit is in an empty state, the record table on the first record data cache unit is used as the target record table.

[0030] In an optional embodiment, the method further includes:

[0031] In the case that not every record data cache unit is in an empty state, the full state record data cache unit with the highest version number is used as the target record data cache unit;

[0032] Determine whether the data cache area to which the target record data cache unit belongs is a non-full data cache area;

[0033] In the case that the data cache area to which the target record data cache unit belongs is a non-full data cache area, the record table on the first empty record data cache unit in the non-full data cache area is used as the target record table.

[0034] In an optional embodiment, the method further includes:

[0035] In the case that the data cache area to which the target record data cache unit belongs is a full data cache area, performing data erasing processing on the first full record data cache unit in the full data cache area to convert the full record data cache unit into an empty record data cache unit;

[0036] The record table on the record data cache unit in the empty state is used as the target record table.

[0037] In an optional implementation, the synchronously caching the record data to the target record table includes:

[0038] generating a check code for the recorded data according to the content of the recorded data;

[0039] Writing the check code of the record data into the header file of the target record table;

[0040] The content of the record data is written into the main body file of the target record table.

[0041] In an optional embodiment, the method further includes:

[0042] Obtaining an average erase time of the target buffer;

[0043] In the process of synchronously caching the record data to the target record table, when the record data writing blocking time reaches the average erasing time, suspending the writing of the record data;

[0044] When the next recording data synchronization cache is triggered, continue writing the last paused recording data.

[0045] In an optional implementation manner, obtaining the average erase time of the target buffer includes:

[0046] In the case that the target buffer has not been subjected to data erasure processing, acquiring an erase unit size of the target buffer;

[0047] An average erasure time of the target buffer is determined according to an erase unit size of the target buffer.

[0048] In an optional embodiment, the method further includes:

[0049] In the case where the target buffer has been subjected to data erasure processing, obtaining the time taken for each data erasure operation;

[0050] The average erasing time of the target buffer is determined according to the time taken for each data erasing operation and the number of data erasing processes.

[0051] In an optional implementation, the step of creating a record data cache unit in the target cache includes:

[0052] Determining a target size of the recorded data cache unit according to an erase unit size of the target cache;

[0053] Creating a record data cache unit in the target buffer according to the target size of the record data cache unit;

[0054] Wherein, the target size of the record data cache unit is an integer multiple of the erase unit size.

[0055] In an optional implementation manner, the reading the recorded data from the target buffer includes:

[0056] Selecting the record data cache unit with the highest current version number from the target cache as the record data cache unit to be read;

[0057] The record data is read from the to-be-read record data cache unit.

[0058] In an optional implementation manner, the reading the record data from the to-be-read record data cache unit includes:

[0059] Reading the content of the record data from the main body file of the to-be-read record table of the to-be-read record data cache unit;

[0060] Read the check code of the record data from the header file of the record table to be read;

[0061] An integrity check is performed on the content of the read record data based on the check code to obtain an integrity check result.

[0062] A second aspect of the present application provides a recording data processing device, comprising:

[0063] An acquisition module, used for acquiring the record data cached in the initial buffer in the solid state drive;

[0064] A synchronization module, used for synchronizing the recorded data to a target buffer;

[0065] A reading module, used for reading the recorded data from the target buffer when the solid state drive enters the first power-on mode;

[0066] The recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode.

[0067] The third aspect of the present application provides a recording data processing system, comprising: a solid state hard disk and a recording data processor; the solid state hard disk comprises an initial buffer and a target buffer;

[0068] The recorded data processor processes the recorded data of the solid state drive based on the method described in the first aspect and various possible designs of the first aspect.

[0069] A fourth aspect of the present application provides an electronic device, comprising: at least one processor and a memory;

[0070] The memory stores computer-executable instructions;

[0071] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.

[0072] A fifth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.

[0073] The sixth aspect of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the method described in the first aspect and various possible designs of the first aspect.

[0074] The technical solution of this application has the following advantages:

[0075] The present application provides a method, device, system and electronic device for processing recorded data, the method comprising: obtaining recorded data cached in an initial buffer in a solid-state hard disk; synchronizing the recorded data to a target buffer; reading recorded data from the target buffer when the solid-state hard disk enters the first power-on mode; wherein the recorded data cached in the initial buffer is erased when the solid-state hard disk enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid-state hard disk enters the first power-on mode. The method provided by the above scheme synchronizes the recorded data in the initial buffer to the target buffer, so as to ensure that the solid-state hard disk can read the recorded data with higher reliability from the target buffer when it enters the first power-on mode during the return to factory repair process. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0077] Figure 1 A flowchart of a method for processing recorded data provided in an embodiment of the present application;

[0078] Figure 2 A schematic diagram of the structure of an exemplary target buffer provided in an embodiment of the present application;

[0079] Figure 3 A schematic diagram of the overall process of the recorded data processing method provided in an embodiment of the present application;

[0080] Figure 4 A schematic diagram of the structure of a recording data processing device provided in an embodiment of the present application;

[0081] Figure 5 A schematic diagram of the structure of a recording data processing system provided in an embodiment of the present application;

[0082] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0083] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0085] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0086] In related technologies, the NAND particles used to store data in SSDs have a certain number of erase and write times, and PE Cycle (PE for short) is usually used to represent the erase and write times of Flash memory. NAND is erased in units of blocks, and data maintenance is required for the erase times information of each block on each NAND particle. This is used to achieve wear leveling and evaluate SSD lifespan.

[0087] The PE table of each BLOCK is usually stored in the NAND SLC as metadata. After the firmware is powered on, the PE table is restored to the DDR. HOST writes, GC erases, and writes all refer to the PE table to achieve wear leveling.

[0088] The size of the PE table is related to the design capacity of the SSD and the size of the NAND block it uses, and is between 1KB and 26KB.

[0089] NAND SLC has the characteristic of fast erasing and writing. When the SSD loses power abnormally, the PE table can still be saved by relying on the power of the SSD backup capacitor. However, the PE table stored in NAND SLC is not fixedly stored in a certain block because NAND SLC also requires wear leveling. Therefore, when the SSD needs to be returned to the factory for rework or repair after a failure, and other scenarios where user data does not need to be saved, the PE table in NAND SLC may be unreliable and lose its reference value.

[0090] In response to the above problems, the embodiments of the present application provide a method, device, system and electronic device for processing recorded data, the method comprising: obtaining the recorded data cached in the initial buffer in the solid-state hard disk; synchronizing the recorded data to the target buffer; reading the recorded data from the target buffer when the solid-state hard disk enters the first power-on mode; wherein the recorded data cached in the initial buffer is erased when the solid-state hard disk enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid-state hard disk enters the first power-on mode. The method provided by the above scheme synchronizes the recorded data in the initial buffer to the target buffer, so as to ensure that the solid-state hard disk can read the recorded data with higher reliability from the target buffer when it enters the first power-on mode during the factory repair process.

[0091] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0092] The embodiment of the present application provides a method for processing recorded data, which is used to cache the recorded data of a solid-state hard disk reliably, so as to ensure that when the solid-state hard disk is returned to the factory for repair and enters the first power-on mode, the recorded data with high reliability can be read from the solid-state hard disk. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used for processing the recorded data of a solid-state hard disk.

[0093] like Figure 1 FIG. 1 is a flow chart of a method for processing recorded data provided in an embodiment of the present application, the method comprising:

[0094] Step 101, obtaining the record data cached in the initial buffer in the solid state drive.

[0095] The recorded data includes the erasure times of each logic block in each NAND particle of the solid state drive SSD.

[0096] Among them, the initial cache specifically refers to the NAND SLC cache in the solid-state drive. The NAND SLC cache has the characteristics of fast erasing and writing, but the NAND SLC cache itself may fail, that is, the failure of the solid-state drive SSD returned to the factory for repair may be caused by the NAND SLC cache, and the NAND SLC cache will be initialized when entering the first power-on mode, causing the previously cached data to be erased.

[0097] Step 102, synchronizing the recorded data to the target buffer.

[0098] Among them, the target cache specifically refers to the NOR Flash cache in the solid-state drive. The NOR Flash cache is a non-volatile memory. NOR Flash usually has a longer service life than the NAND SLC cache. The NOR Flash cache has higher reliability in data caching and is often used to store very important data such as the firmware code of the solid-state drive. When the solid-state drive enters the first power-on mode, the NOR Flash cache will not perform data erasure processing, that is, the data cached before this will be retained.

[0099] Step 103 : when the solid state drive enters the first power-on mode, read the recorded data from the target buffer.

[0100] The recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode.

[0101] It should be noted that the first power-on mode mentioned in the embodiments of the present application mainly refers to the first power-on mode entered by the solid-state drive in specific scenarios such as being returned to the factory for rework or repair, rather than the first power-on mode entered when the product is powered on for the first time.

[0102] Specifically, by synchronizing the recorded data to the target buffer, when the SSD enters the first power-on mode, the recorded data in the target buffer is read, and when the SSD is not powered on for the first time, the recorded data in the initial buffer is read. Therefore, when the SSD is returned to the factory for rework or repair, and no user data needs to be saved, the SSD enters the first power-on mode. Since the data in the NAND SLC and TLC will be completely erased in the first power-on mode, the firmware can read the recorded data in the target buffer, and realize the inheritance of recorded data in specific scenarios such as returning to the factory for rework or repair.

[0103] On the basis of the above embodiment, in order to efficiently synchronize the recorded data in the target buffer to facilitate the subsequent recorded data management, as an implementable method, in one embodiment, the recorded data is synchronized to the target buffer, including:

[0104] Step 1021, creating a record data cache unit in the target cache;

[0105] Step 1022, creating a record table in the record data cache unit;

[0106] Step 1023, synchronously cache the record data to the corresponding target record table.

[0107] The record table is the PE table, which is a special area in the SSD for storing and managing metadata related to the NAND Flash chip, such as the above-mentioned record data.

[0108] Specifically, in one embodiment, the capacity of the solid state drive may be obtained; based on the capacity of the solid state drive, the target creation number of the record data cache unit may be determined; and according to the target creation number, the record data cache unit may be created in the target buffer.

[0109] Among them, the number of target creations is negatively correlated with the capacity of the SSD.

[0110] It should be noted that the erasing and writing speed of the NOR Flash cache is relatively slow, especially its data erasing operation will consume a lot of time. The erasing logic of writing the NOR Flash cache is to erase first and then write. Therefore, in order to avoid the target cache in a small-capacity solid-state hard disk from performing too many data erasing operations and seriously affecting its performance, the embodiment of the present application determines the target creation quantity of the data cache unit according to the capacity of the solid-state hard disk, and balances the impact of the capacity of the solid-state hard disk and the number of erase times of the target cache on its overall performance.

[0111] Specifically, in one embodiment, according to the target creation quantity, a corresponding number of record data cache units are created in each data cache area of ​​the target cache.

[0112] Among them, the record data cache unit corresponds to the record table one by one.

[0113] For example, Figure 2 As shown, it is a schematic diagram of the structure of an exemplary target cache provided by an embodiment of the present application. Taking the capacity of a solid-state drive of 16T as an example, there is only one SECTION_A_1 (data cache unit A1) in REGION_A (data cache area A), and there is only one SECTION_B_1 (data cache unit B1) in REGION_B (data cache area B). The size of each data cache unit SECTION is 13KB. For an 8TB SSD, its PE table is half of 16TB, so there are 2 SECTIONs in each REGION, with a size of 6.5KB. By analogy, for a 2TB SSD, there are 8 SECTIONs in each REGION.

[0114] Specifically, in one embodiment, in order to implement normative caching of cached data in a target cache, the header file of the record table in each record data cache unit can be obtained; based on the header file of each record table, a target record table can be filtered from multiple record tables; and the record data can be synchronously cached to the target record table.

[0115] It should be noted that if Figure 2 As shown in the figure, the data cache unit SECTION is divided into two parts: the header file SECTION_HEADER of the record table and the body file SECTION_BODY of the record table. SECTION_HEADER contains SECTION_VERISON (version number), SECTION_LENGTH (length), and SECTION_CRC (check code). Among them, SECTION_VERISON is increased by 1 every time it is written, which is used to distinguish the new and old of different SECTIONs. SECTION_LENGTH is the length of SECTION_BODY, which is used to find the position of the next SECTION_HEADER. SECTION_CRC is the check value of the CRC32 check algorithm of the SECTION_BODY area, which is used to check the integrity of the SECTION_BODY data.

[0116] Specifically, in one embodiment, it can be determined whether each record data cache unit of the target cache is in an empty state based on the header file of each record table; when each record data cache unit is in an empty state, the record table on the first record data cache unit is used as the target record table.

[0117] Specifically, Figure 2 As shown, the record data cache units in each data cache area are arranged in order from 1 to n. When each record data cache unit is in an empty state, it indicates that the current record data cache is the first record data cache of the target cache, so the record table on the record data cache unit sorted at the front is used as the target record table, that is, Figure 2 The record table on SECTION_A_1 (data cache unit A1) is used as the target record table, and the data cache unit is actually the record table.

[0118] Accordingly, in one embodiment, when not every record data cache unit is in an empty state, the full state record data cache unit with the highest version number is used as the target record data cache unit; it is determined whether the data cache area to which the target record data cache unit belongs is a non-full data cache area; when the data cache area to which the target record data cache unit belongs is a non-full data cache area, the record table on the first empty state record data cache unit in the non-full data cache area is used as the target record table.

[0119] It should be noted that in order to further ensure the reliability of the data caching results in the target cache, the embodiments of the present application back up each other in each data cache area in the target cache. The full-state record data cache unit with the highest version number is the record data cache unit with the latest written record data. Then the data cache area to which it belongs is also the data cache area with the latest written record data. Therefore, when the data cache area to which the target record data cache unit belongs is a non-full data cache area, the record table on the first empty-state record data cache unit in the non-full data cache area is used as the target record table, so that the current latest acquired record data is written to the data cache area with the latest version, so as to continuously keep the version of the data cache area up to date.

[0120] Accordingly, in one embodiment, when the data cache area to which the target record data cache unit belongs is a full data cache area, data erasure processing is performed on the first full-state record data cache unit in the full data cache area to convert the full-state record data cache unit into an empty-state record data cache unit; the record table on the empty-state record data cache unit is used as the target record table.

[0121] Specifically, since the target cache writes record data cache units in sequence, the first full record data cache unit is generally the record data cache unit with the lowest version number. Therefore, the record data cache unit is selected to be erased to convert the full record data cache unit into an empty record data cache unit, and then the latest acquired record data is written into the record data cache unit.

[0122] Specifically, in one embodiment, if the target buffer includes two data buffer areas, when the data buffer area to which the target record data buffer unit belongs is a full data buffer area, it can be determined whether the other data buffer area is in an empty state. If the other data buffer area is in an empty state, the record table on the first empty record data buffer unit on the other data buffer area is used as the target record table. If the other data buffer area is in a full state or a state that is neither full nor empty, the data on the data buffer area_B (the other data buffer area) is erased to select an empty record data buffer unit on the data buffer area_B, and the record table on the empty record data buffer unit is used as the target record table.

[0123] Furthermore, in one embodiment, a check code of the recorded data may be generated according to the content of the recorded data; the check code of the recorded data may be written into a header file of the target record table; and the content of the recorded data may be written into a body file of the target record table.

[0124] The generated check code is the check value obtained based on the CRC32 check algorithm. When the check code of the record data is written into the header file of the target record table, the version number and length in the header file of the target record table will also be updated.

[0125] Specifically, the embodiment of the present application first defines the status of the record data cache unit and the data cache area. If the data of the header file SECTION_XX_HEADER read out of any record data cache unit is all 0xff, then the SECTION is a record data cache unit EMPTY_SECTION in an empty state. If the data read out of SECTION_XX_HEADER is not all 0xff, but the crc32 check of SECTION_XX_HEADER fails, then the SECTION is a fault record data cache unit BAD_SECTION. If the data read out of SECTION_XX_HEADER is not all 0xff, and the crc32 check of SECTION_XX_HEADER succeeds, then the SECTION is a record data cache unit FULL_SECTION in a full state. If all SECTIONs in a data cache area REGION are EMPTY_SECTION, then the REGION is a data cache area EMPTY_REGION in an empty state. If all SECTIONs in a REGION are BAD_SECTION or FULL_SECTION, then the REGION is a full data cache FULL_REGION. If all SECTIONs in a REGION have both EMPTY_SECTION and BAD_SECTION or FULL_SECTION, then the REGION is the most recently used CURRENT_REGION, and is also the data cache in a non-full and non-empty state to which the target record data cache unit belongs, and can also be collectively referred to as a non-full data cache.

[0126] Accordingly, in one embodiment, during the process of reading record data from the target buffer, the record data cache unit with the highest current version number may be selected from the target buffer as the record data cache unit to be read; and the record data is read from the record data cache unit to be read.

[0127] Among them, the record data cache unit with the highest current version number is the record data cache unit to which the record data was written most recently. The PE table cached by this record data cache unit is closest to the actual situation of the solid-state hard disk. Therefore, this data cache unit is used as the record data cache unit to be read, and then the record data is read from the record data cache unit to be read.

[0128] Specifically, in one embodiment, the content of the record data can be read from the main file of the record table to be read of the record data cache unit to be read; the check code of the record data can be read from the header file of the record table to be read; and the integrity of the content of the read record data can be checked based on the check code to obtain an integrity check result.

[0129] Specifically, first read the content of the recorded data from the main file, encode the check code according to the read content, obtain the current check code, and judge whether the read content is complete by comparing the difference between the current check code and the check code of the recorded data read from the header file, that is, perform integrity check on the content of the read recorded data to obtain the integrity check result. Among them, if the integrity check result is incomplete, it means that the recorded data may have been damaged and further processing is required, such as rereading the data or trying to recover the data.

[0130] Based on the above embodiment, since the erase speed of the target buffer is relatively slow, in order to avoid the write operation to the target buffer affecting the overall service interaction performance of the solid state drive, as an implementable manner, in one embodiment, the method further includes:

[0131] Step 201, obtaining the average erasing time of the target buffer;

[0132] Step 202, in the process of synchronously caching the record data to the target record table, when the record data writing blocking time reaches the average erasing time, suspending the writing of the record data;

[0133] Step 2031, when the next recording data synchronization cache is triggered, continue writing the recording data that was paused last time.

[0134] Specifically, when the record data write congestion time reaches the average erase time, it is determined that the current write operation to the target cache takes a long time. If writing continues, it will affect the response of the solid-state drive to other services. Therefore, in order to ensure the overall business interaction performance of the solid-state drive, the write operation to the target cache is suspended at this time, that is, the writing of record data is suspended. When writing record data to the target cache next time, continue to write the record data that was suspended last time. After writing the record data that was suspended last time, write the record data to be written currently.

[0135] Specifically, in one embodiment, when the target buffer has not undergone data erasure processing, the erase unit size of the target buffer is obtained; and according to the erase unit size of the target buffer, the average erase time of the target buffer is determined.

[0136] Among them, the erase unit size of the target cache can be 4K, 32K and 64K, and the typical consumption time is 40ms, 120ms and 200ms respectively. It can be seen that the larger the erase unit, the shorter the single byte consumption and the higher the efficiency, but a single command will block I / O. The larger the erase unit, the longer the overall I / O blocking time. In order to reduce the time of blocking I / O, the embodiment of the present application selects a 4K erase unit. And, in the case that the target cache has not undergone data erasure processing, the typical consumption time of the 4K erase unit of 40ms is used as the average erase time of the target cache. At the same time, the write size is dynamically adjusted according to the average erase time, and the blocking time of PE write and PE erase is adjusted to the same time, which effectively reduces the impact of the long I / O blocking time of SSD saving PE table, reduces the maximum I / O delay, improves the consistency of I / O, and improves the user QOS experience.

[0137] For example, the typical time consumed for 4K erasure is 40 ms, but the time is not fixed and is related to the working time and working temperature of the target buffer. When erasing 4K, record the time of each 4K erasure and calculate its average time t_erase_ave (average erase time). If the saved PE table has not undergone the erase process, set t_erase_ave=40ms. The target buffer can be written as 1 byte and 256 bytes. When writing a large amount of data, the average time per byte of 256 bytes is the shortest. Calculate the blocking io time with t_erase_ave. When executing PE write, implement a step-by-step write strategy. Each time the PE table is updated, when 256 bytes are written, the current write blocking time is recorded. When the write blocking time is less than t_erase_ave, continue to write the next 256 bytes until the write blocking time is greater than or equal to t_erase_ave, then exit the current write process, wait for the next PE table update, and continue to write the remaining data until it is finished. If power outage occurs before the PE table is fully written, the current PE table becomes invalid and the backup PE table is used. Similarly, if power outage occurs while a PE table is being erased by 4K, the current PE table becomes invalid and the backup PE table is used. Increasing the PE of all physical blocks on the entire disk by 1 triggers the PE table of the target cache to be saved. Therefore, even if the backup PE table is used, the PE table only differs from the actual maximum by 1, which meets the accuracy requirements of the PE table of the target cache. When encountering the process of erasing the target cache, the PE table only differs from the actual maximum by 7 (each REGION is 28KB, and 4KB can be erased 7 times), which also meets the accuracy requirements of the PE table of the target cache.

[0138] Specifically, in one embodiment, when the target cache has undergone data erasure processing, the time taken for each data erasure operation is obtained; and the average erasure time of the target cache is determined based on the time taken for each data erasure operation and the number of data erasure processing times.

[0139] Exemplarily, assuming that the target cache undergoes two data erasure operations, and the two times are t1 and t2 respectively, then the average erasure time of the target cache is (t1+t2) / 2.

[0140] Specifically, in one embodiment, during the process of creating the record data cache unit, the target size of the record data cache unit can be determined according to the erase unit size of the target cache; and the record data cache unit can be created in the target cache according to the target size of the record data cache unit.

[0141] The target size of the record data cache unit is an integer multiple of the erase unit size.

[0142] For example, since the PE table of an SSD with a maximum capacity of 16TB is 26KB, and since the erase granularity of the target buffer is 4KB, the space allocated to the target buffer for a single PE table is 26KB rounded up to 4K, that is, the target size of the record data cache unit is 28KB. If a PE table is added for backup, 56KB of target buffer space is allocated to implement the method provided in the embodiment of the present application, that is, two buffer areas REGION_A and REGION_B are allocated.

[0143] For example, Figure 3 As shown, it is a schematic diagram of the overall process of the recorded data processing method provided in the embodiment of the present application, and the overall steps are as follows:

[0144] Step 1, design the data structure saved in the PE table, which consists of a PE table header file (SECTION_HEADER) + a PE table body file (SECTION_BODY). SECTION_HEADER mainly includes the version number (SECTION_VERSION) of the PE table, the length of the data segment of the PE table (SECTION_LENGTH), and the CRC32 checksum (CRC32) of the PE table. SECTION_BODY contains the actual PE table data. The PE value of each BLOCK is recorded as a 16-bit unsigned number.

[0145] Step 2, allocate the target cache space to the PE table. Since the PE table of the SSD with a maximum capacity of 16TB is 26KB, and the erase granularity (erase unit size) of the target cache is 4KB, the target cache space allocated to a single PE table is 26KB rounded up to 4K, which is 28KB. Add a PE table for backup, and allocate 56KB of target cache space to implement this solution. After allocating norflash space according to the maximum capacity, the capacity is halved, and the length of the PE table is halved, that is, the PE table of the 8TB SSD is 13KB, and the PE table of the 4TB SSD is 6.5KB..., then the number of backups of the target cache space increases by 1 times. That is, the 8TB SSD has 4 backups, and the 4TB SSD has 8 backups... The backups are SECTION_A_1, SETTION_A_2...

[0146] Step 3, taking 8TB SSD, 4 backups as an example, its PE table length is SECTION_LENGTH, and the target cache allocation area is SECTION_A_1, SECTION_A_2, SECTION_B_1, SECTION_B_2, that is, 4 backups.

[0147] Step 4, when the number of PEs in the entire disk increases by 1 and the PE table needs to be saved, read the headers of SECTION_A_1, SECTION_A_2, SECTION_B_1, and SECTION_B_2, and read the data structure size of SECTION_HEADER.

[0148] Step 5, read the header file of each record data cache unit, that is, read the SECTION_HEADER of the four SECTIONs. If the SECTION_HEADER data of the four SECTIONs is all 0xff, it is considered that the SSD has never saved the PE table. Both REGIONs are EMPTY_REGION, then the current PE data is saved in SECTION_A_1, and the SECTION_VERSION of SECTION_HEADER is written to 1 first.

[0149] Step 6, assign SECTION_LENGTH in SECTION_HEADER to SECTION_LENGTH, and then write the actual PE data in SECTION_BODY. Since the length of 8T SECTION_BODY is greater than 256 bytes, only 256 bytes are written, and the current cumulative writing time is recorded. When the time is less than t_erase_ave (if there is no 4K erase process, it is replaced by 40ms), continue to write the next 256 bytes. When the time is greater than t_erase_ave (if there is no 4K erase process, it is replaced by 40ms), exit the current writing process, wait for the next PE update, and continue writing until the 8T SECTION_BODY is completely cut, and calculate the check value according to the CRC32 algorithm based on the data in SECTION_HEADER, and write it in the CRC32 position in SECTION_HEADER. Wait for the next PE table update.

[0150] Step 7, if there is a FULL_SECTION among the four SECTIONs, find the FULL_SECTION with the largest SECTION_VERSION, and determine whether the REGION it is in is the CURRENT_REGION, that is, it is not full. If it is the CURRENT_REGION, add 1 to the SECTION_VERSION and write it to the EMPTY_SECTION position of the CURRENT_REGION, and execute step 6.

[0151] Step 8, if REGION in step 7 is FULL_REGION, assuming it is REGION_A, the first full state recording data cache unit in the full data cache area (FULL_REGION) is erased to convert the full state recording data cache unit into an empty state recording data cache unit.

[0152] Step 9: Erase SECTION_A1 and SECTION_A2 at a 4KB granularity. Erase 4KB from the end of SECTION_A2 first, and record the time t1 required to erase 4KB.

[0153] Step 10, execute step 4. If you reach step 8, continue to erase the end of SECTION_A2 and offset 4KB forward, record the time t2 for 4K erasing, and calculate its average time (t1+t2) / 2.

[0154] Step 11, until the entire REGION is completely erased, the average erase time is t_erase_ave. That is, the target buffer is erased in units of data buffer areas REGION_A and REGION_B (if the erase process is executed, the entire REGION must be erased before the write process can be executed). SECTION_A_n is the unit of writing the target buffer (one SECTIONON is a complete PE table).

[0155] Step 12, execute step 4, reach step 7, and write the latest version of the PE table into the target buffer through step 7.

[0156] Step 13, if the power is off and then on, you only need to find the PE table with a complete SECTION_HEADER and the largest SECTION_VERSION among SECTION_A1, SECTION_A2, SECTION_B1, and SECTION_B2.

[0157] Step 14: If an abnormal power failure occurs, directly execute step 4 after powering on.

[0158] The embodiment of the present application provides a method for processing recorded data, including obtaining recorded data cached in an initial buffer in a solid-state hard disk; synchronizing the recorded data to a target buffer; and reading recorded data from the target buffer when the solid-state hard disk enters the first power-on mode; wherein the recorded data cached in the initial buffer is erased when the solid-state hard disk enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid-state hard disk enters the first power-on mode. The method provided by the above scheme synchronizes the recorded data in the initial buffer to the target buffer to ensure that the solid-state hard disk can read the recorded data with higher reliability from the target buffer when it enters the first power-on mode during the factory repair process, thereby improving the utilization rate of the faulty disk and reducing production costs. In addition, the use of a dual-REGION multi-SECTION PE table backup mechanism can realize abnormal power-off processing during PE writing and PE erasing. Even if the PE table is damaged due to abnormal power-off, the backup PE table still meets the use requirements. In addition, by calculating the average erase time and taking this time as a reference, the number of target cache writes is dynamically adjusted, which effectively reduces the impact of the long I / O blocking time of the SSD PE table write process, reduces the maximum I / O delay, and improves the user QOS experience.

[0159] The embodiment of the present application provides a recorded data processing device, which is used to execute the recorded data processing method provided by the above embodiment.

[0160] like Figure 4, which is a schematic diagram of the structure of a recording data processing device provided in an embodiment of the present application. The recording data processing device 40 comprises: an acquisition module 401 , a synchronization module 402 and a reading module 403 .

[0161] Among them, the acquisition module is used to obtain the record data cached in the initial buffer in the solid state drive; the synchronization module is used to synchronize the record data to the target buffer; the reading module is used to read the record data from the target buffer when the solid state drive enters the first power-on mode.

[0162] The recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode.

[0163] Regarding the record data processing device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0164] The recorded data processing device provided in the embodiment of the present application is used to execute the recorded data processing method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0165] An embodiment of the present application provides an electronic device for executing the recorded data processing method provided in the above embodiment.

[0166] The embodiment of the present application provides a recorded data processing system, which is used to execute the recorded data processing method provided in the above embodiment.

[0167] like Figure 5 The figure is a schematic diagram of the structure of the recording data processing system provided by the embodiment of the present application. The recording data processing system comprises: a solid state hard disk and a recording data processor; the solid state hard disk comprises an initial buffer and a target buffer.

[0168] The recorded data processor processes the recorded data of the solid state drive based on the recorded data processing method provided in the above embodiment.

[0169] Regarding the record data processing system in this embodiment, the specific manner in which each part performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0170] The recorded data processing system provided in the embodiment of the present application is used to execute the recorded data processing method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0171] like Figure 6FIG. 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 60 includes: at least one processor 61 and a memory 62 .

[0172] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the recorded data processing method provided in the above embodiment.

[0173] The electronic device provided in the embodiment of the present application is used to execute the recorded data processing method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0174] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the recorded data processing method provided in any of the above embodiments is implemented.

[0175] The storage medium containing computer executable instructions provided in the embodiment of the present application can be used to store computer executable instructions of the recording data processing method provided in the aforementioned embodiment. Its implementation method and principle are the same and will not be repeated here.

[0176] An embodiment of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the recorded data processing method provided in the above-mentioned embodiment.

[0177] The embodiments of the present application provide a computer program product that can be used to execute computer instructions of the recording data processing method provided in the aforementioned embodiments. The implementation method and principle are the same and will not be repeated here.

[0178] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0179] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0180] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0181] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0182] A part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0183] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application 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 application.

Claims

1. A method for processing recorded data, characterized in that: include: Acquire recorded data cached in an initial buffer in a solid state drive; the recorded data includes the number of times each logic block in each NAND particle of the solid state drive is erased; Synchronizing the recorded data to a target buffer; When the solid state drive enters the first power-on mode, reading the recorded data from the target buffer; Wherein, the recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode; The method further comprises: Obtaining an average erase time of the target buffer; In the process of synchronously caching the record data to the target record table, when the record data writing blocking time reaches the average erasing time, suspending the writing of the record data; When the next record data synchronization cache is triggered, continue writing the last paused record data; The obtaining the average erasing time of the target buffer comprises: In the case that the target buffer has not been subjected to data erasure processing, acquiring an erase unit size of the target buffer; Determining an average erasure time of the target buffer according to an erase unit size of the target buffer; In the case where the target buffer has been subjected to data erasure processing, obtaining the time taken for each data erasure operation; The average erasing time of the target buffer is determined according to the time taken for each data erasing operation and the number of data erasing processes.

2. The method according to claim 1, characterized in that The step of synchronizing the recorded data to a target buffer comprises: Creating a record data cache unit in the target cache; Creating a record table in the record data cache unit; The record data is synchronously cached to the corresponding target record table.

3. The method according to claim 2, characterized in that The step of creating a data buffer in the target buffer comprises: Obtaining the capacity of the solid state drive; Determining a target creation quantity of the record data cache unit according to the capacity of the solid state drive; Creating a record data cache unit in the target buffer according to the target creation quantity; The target creation quantity is negatively correlated with the capacity of the solid state drive.

4. The method according to claim 3, characterized in that The step of creating a record data cache unit in the target cache according to the target creation quantity includes: According to the target creation quantity, a corresponding number of record data cache units are created in each data cache area of ​​the target cache; The record data cache unit corresponds to the record table one by one.

5. The method according to claim 2, characterized in that: The step of synchronously caching the record data to a corresponding target record table includes: Obtaining the header file of the record table in each of the record data cache units; Filtering a target record table from a plurality of record tables according to the header files of each of the record tables; The record data is synchronously cached to the target record table.

6. The method according to claim 5, characterized in that The step of screening a target record table from a plurality of record tables according to the header files of each of the record tables comprises: According to the header files of each of the record tables, determining whether each record data buffer unit of the target buffer is in an empty state; When each record data cache unit is in an empty state, the record table on the first record data cache unit is used as the target record table.

7. The method according to claim 6, characterized in that The method further comprises: In the case that not every record data cache unit is in an empty state, the full state record data cache unit with the highest version number is used as the target record data cache unit; Determine whether the data cache area to which the target record data cache unit belongs is a non-full data cache area; In the case that the data cache area to which the target record data cache unit belongs is a non-full data cache area, the record table on the first empty record data cache unit in the non-full data cache area is used as the target record table.

8. The method according to claim 7, characterized in that The method further comprises: In the case that the data cache area to which the target record data cache unit belongs is a full data cache area, performing data erasing processing on the first full record data cache unit in the full data cache area to convert the full record data cache unit into an empty record data cache unit; The record table on the record data cache unit in the empty state is used as the target record table.

9. The method according to claim 5, characterized in that The step of synchronously caching the record data to the target record table includes: generating a check code for the recorded data according to the content of the recorded data; Writing the check code of the record data into the header file of the target record table; The content of the record data is written into the main body file of the target record table.

10. The method according to claim 1, characterized in that The step of creating a record data cache unit in the target cache includes: Determining a target size of the recorded data cache unit according to an erase unit size of the target cache; Creating a record data cache unit in the target buffer according to the target size of the record data cache unit; Wherein, the target size of the record data cache unit is an integer multiple of the erase unit size.

11. The method according to claim 1, characterized in that: The step of reading the recorded data from the target buffer comprises: Selecting the record data cache unit with the highest current version number from the target cache as the record data cache unit to be read; The record data is read from the to-be-read record data cache unit.

12. The method according to claim 11, characterized in that The step of reading the record data from the to-be-read record data cache unit comprises: Reading the content of the record data from the main body file of the to-be-read record table of the to-be-read record data cache unit; Read the check code of the record data from the header file of the record table to be read; An integrity check is performed on the content of the read record data based on the check code to obtain an integrity check result.

13. A recording data processing device, characterized in that: include: An acquisition module, used to acquire the record data cached in the initial buffer in the solid state drive; the record data includes the number of erasures of each logic block in each NAND particle of the solid state drive; A synchronization module, used for synchronizing the recorded data to a target buffer; A reading module, used for reading the recorded data from the target buffer when the solid state drive enters the first power-on mode; Wherein, the recorded data cached in the initial buffer is erased when the solid state drive enters the first power-on mode, and the recorded data cached in the target buffer is retained when the solid state drive enters the first power-on mode; The synchronization module is also used Obtaining an average erase time of the target buffer; In the process of synchronously caching the record data to the target record table, when the record data writing blocking time reaches the average erasing time, suspending the writing of the record data; When the next record data synchronization cache is triggered, continue writing the last paused record data; The obtaining the average erasing time of the target buffer comprises: In the case that the target buffer has not been subjected to data erasure processing, acquiring an erase unit size of the target buffer; Determining an average erasure time of the target buffer according to an erase unit size of the target buffer; In the case where the target buffer has been subjected to data erasure processing, obtaining the time taken for each data erasure operation; The average erasing time of the target buffer is determined according to the time taken for each data erasing operation and the number of data erasing processes.

14. A recording data processing system, characterized in that: include: A solid state hard disk and a recording data processor; the solid state hard disk includes an initial buffer and a target buffer; The recorded data processor processes the recorded data of the solid state drive based on the method according to any one of claims 1 to 12.

15. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 12.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 12 is implemented.

17. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Solid state disk data recovery method, terminal device, electronic device and storage medium

    CN118152181A

  • Flash memory storage system and read / write and delete methods therefor

    WO2016123748A1