Address information updating method, storage device and controller thereof
By detecting and updating multiple continuous incremental logs of addresses, the reconstruction process of address mapping tables in storage devices is optimized, and the problems of low bandwidth utilization and reconstruction speed in the prior art are solved, thereby achieving higher device performance.
Patent Information
- Application Number
- CN202510153348.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-06-17
AI Technical Summary
In storage devices, during the reconstruction process of address mapping tables, the prior art is difficult to effectively optimize bandwidth utilization and reconstruction speed, resulting in a large amount of data processing in the background and affecting device performance.
By detecting the address continuity of multiple continuous incremental logs, the target incremental log is determined in response to multiple continuous incremental logs with continuous addresses, and the mapping relationship of the same operation address in the storage unit is updated based on the target incremental logs.
It improves the bandwidth utilization and reconstruction speed of storage units during address information reconstruction, reduces the amount of data processing in the background, and improves equipment performance.
Smart Images

Figure CN120161997A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage devices, and more particularly, to an address information updating method, a storage device and its controller. Background Art
[0002] In a storage device, such as a solid state drive (SSD), for example, an address mapping table (logical address to physical address, L2P) records the mapping from the logical address space to the physical address space. Further, when new data is written to the storage space of the storage device or the data in the storage space is erased, the mapping relationship between the logical address and the physical address changes. Usually, an incremental log can be used to record the corresponding address mapping relationship changes, and then the address mapping table can be updated and rebuilt according to the incremental log. How to optimize the rebuilding process of the address mapping table is crucial for improving the device performance. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide an address information updating method, a storage device and its controller, which can improve the bandwidth utilization rate and the rebuilding speed of the storage unit during the address information rebuilding process by simultaneously updating the mapping relationships of corresponding multiple consecutive operation addresses in the storage unit based on multiple consecutive incremental logs with consecutive addresses, thereby reducing the amount of background processing data and improving the device performance.
[0004] In a first aspect, an embodiment of the present invention provides an address information updating method, the method comprising:
[0005] Detecting the address continuity of multiple consecutive incremental logs;
[0006] In response to having multiple consecutive incremental logs with consecutive addresses, determining a target incremental log;
[0007] Updating the mapping relationships of the same operation addresses in the storage unit based on each of the target incremental logs.
[0008] Further, the method further comprises:
[0009] Reading a predetermined size of address information from the storage unit to a cache unit according to the operation address corresponding to the currently to-be-updated incremental log, wherein the address range of the address information includes the operation address corresponding to the to-be-updated incremental log.
[0010] Further, the updating the mapping relationships of the same operation addresses in the storage unit based on each of the target incremental logs includes:
[0011] Update the address information in the cache unit according to the operation addresses corresponding to the respective target incremental logs;
[0012] Write back the updated address information to the storage unit.
[0013] Further, the detecting the address continuity of multiple consecutive incremental logs includes:
[0014] Sequentially detect whether the operation addresses corresponding to adjacent incremental logs are continuous until the operation addresses corresponding to the currently detected adjacent incremental logs are not continuous.
[0015] Further, in response to having multiple consecutive incremental logs with continuous addresses, determining the target incremental logs includes:
[0016] In response to the number of the multiple consecutive incremental logs with continuous addresses being greater than a predetermined value, determine the first predetermined consecutive incremental logs among the multiple consecutive incremental logs with continuous addresses as the target incremental logs;
[0017] In response to the number of the multiple consecutive incremental logs with continuous addresses not being greater than a predetermined value, determine the multiple consecutive incremental logs with continuous addresses as the target incremental logs.
[0018] Further, the detecting the address continuity of multiple consecutive incremental logs includes:
[0019] Detect whether the operation addresses corresponding to adjacent predetermined incremental logs are continuous;
[0020] The determining the target incremental logs in response to having multiple consecutive incremental logs with continuous addresses includes:
[0021] In response to the operation addresses corresponding to adjacent predetermined incremental logs being continuous, determine the adjacent predetermined incremental logs as the target incremental logs.
[0022] Further, the method further includes:
[0023] Determine the flushing ratio of the incremental logs and the periodic logs according to the number of incremental logs of different consecutive types within the update period, where the consecutive type is determined based on the number of consecutive incremental logs with continuous addresses.
[0024] In a second aspect, an embodiment of the present invention provides a storage device controller, where the storage device controller includes:
[0025] A storage unit configured to store an address mapping table, where the address mapping table is used to record the mapping relationship between logical addresses and physical addresses;
[0026] A cache unit, configured to cache the address information and updated address information of a predetermined size read from the storage unit;
[0027] A control unit, configured to execute the method as described above.
[0028] In a third aspect, an embodiment of the present invention provides a storage device, which includes:
[0029] The storage device controller as described above;
[0030] A storage space, for storing data.
[0031] In a fourth aspect, an embodiment of the present invention provides an electronic device, which includes:
[0032] The storage device as described above;
[0033] A host, configured to send a data processing request to the storage device and receive a data processing result from the storage device.
[0034] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program or data is stored, and when the computer program is executed by a processor, the method as described above is implemented.
[0035] In a sixth aspect, an embodiment of the present invention provides a log update device, which includes:
[0036] A detection unit, configured to detect the address continuity of multiple consecutive incremental logs;
[0037] A determination unit, configured to determine a target incremental log in response to multiple consecutive incremental logs with continuous addresses;
[0038] An update unit, configured to update the mapping relationship of the same operation addresses in the storage unit based on each of the target incremental logs.
[0039] In the embodiment of the present invention, by detecting the address continuity of multiple consecutive incremental logs, determining a target incremental log in response to multiple consecutive incremental logs with continuous addresses, and updating the mapping relationship of the same operation addresses in the storage unit based on each target incremental log. Thus, in this embodiment, by simultaneously updating the mapping relationships of corresponding multiple consecutive operation addresses in the storage unit based on multiple consecutive incremental logs with continuous addresses during the address information reconstruction process, the bandwidth utilization rate and reconstruction speed of the storage unit during address information reconstruction are improved, thereby reducing the amount of background processed data and improving the device performance. Description of the Drawings
[0040] Through the following description of the embodiments of the present invention with reference to the accompanying drawings, the above and other objects, features, and advantages of the present invention will become more apparent. In the drawings:
[0041] Figure 1 is a schematic diagram of the incremental log of the embodiment of the present invention;
[0042] Figure 2 is a schematic diagram of the address mapping table of the embodiment of the present invention;
[0043] Figure 3 is a schematic diagram of the relationship between the periodic log and the incremental log of the address mapping table of the embodiment of the present invention;
[0044] Figure 4 is a schematic diagram of the address mapping table update process of a comparative example;
[0045] Figure 5 is a flowchart of the address information update method of the embodiment of the present invention;
[0046] Figure 6 is a schematic diagram of the address mapping table update process of the embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of the address information update device of the embodiment of the present invention;
[0048] Figure 8 is a schematic diagram of the storage device of the embodiment of the present invention;
[0049] Figure 9 is a schematic diagram of the electronic device of the embodiment of the present invention. Detailed Embodiments
[0050] The following is a description of the present application based on embodiments, but the present application is not limited to these embodiments. In the following detailed description of the present application, some specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. In order to avoid obscuring the essence of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0051] In addition, those of ordinary skill in the art should understand that the accompanying drawings provided herein are for illustrative purposes only, and the drawings are not necessarily drawn to scale.
[0052] Unless the context clearly requires otherwise, the words "including", "comprising", and the like in the entire application document should be interpreted in an inclusive sense rather than an exclusive or exhaustive sense; that is, the meaning of "including but not limited to".
[0053] In the description of this application, it should be understood that terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0054] For the solutions described in this specification and embodiments, if they involve personal information processing, they will be processed on the premise of having a legal basis (such as obtaining the consent of the personal information subject or being necessary for performing a contract), and will only be processed within the specified or agreed scope. If a user refuses to process personal information other than the necessary information required for basic functions, it will not affect the user's use of basic functions.
[0055] In the embodiments of the present invention, a solid-state drive is mainly used as an example of a storage device for detailed description. It should be understood that the type of the storage device is not limited in this embodiment, that is, any storage device that uses an address mapping table to record the relationship between logical addresses and physical addresses and is updated and rebuilt based on an incremental log can adopt the embodiments of the present invention, and the specific implementation processes of various storage devices will not be described in detail one by one here.
[0056] A solid-state drive is a hard disk that uses non-volatile memory to store data and is usually implemented using flash memory technology. A solid-state drive consists of a controller and a storage space. Among them, the storage space uses flash memory, such as NAND flash memory. The controller is responsible for data read, write, and erase operations, as well as functions such as error correction, garbage collection, and wear leveling to ensure the lifespan of the solid-state drive.
[0057] Figure 1 It is a schematic diagram of the incremental log in the embodiments of the present invention. Figure 2 It is a schematic diagram of the address mapping table in the embodiments of the present invention. After receiving a write command from the host, the solid-state drive writes the corresponding data into the storage space, which will change the mapping relationship of the corresponding address. Usually, an incremental log is used to store the address mapping relationship corresponding to these write commands. As Figure 1 shown, the incremental log stores the mapping relationship of LBA-FPA corresponding to data processing commands. Among them, the data processing command can be any command that changes the data address mapping relationship, such as a write command, an erase command, etc. Among them, LBA (Logical Block Address) is the host logical address, and FPA (Flash Physical Address) is the flash physical address of the storage space of the storage device. The address mapping table (L2P table) is used to record the mapping relationship between the data logical address and the physical address of the data stored in the storage space. As Figure 2As shown, the L2P epitope is an array with LBA as the subscript, and the array content is FPA. Further, the storage device usually flushes a snapshot of the L2P table (i.e., the periodic log) to the corresponding storage through the incremental log every certain time or when certain conditions are met to save the L2P table. The L2P table snapshot contains the complete L2P table state at a certain point in time. By creating such snapshots periodically, the data recovery time and complexity when the main L2P table is lost or damaged can be reduced.
[0058] Figure 3 is a schematic diagram of the relationship between the periodic log and the incremental log flushing of the address mapping table in the embodiment of the present invention. As Figure 3 shown, the storage space 32 of the storage device is used to store data, and the storage unit 31 in the controller of the storage device is used to store the snapshot of the L2P table, that is, the periodic log. When executing a data processing command, for example, after storing data in the storage space 32, an incremental log corresponding to the data processing command is generated. For example, incremental logs z1 - z4. Taking the periodic update of the L2P table as an example, after a certain time interval T, the flushing operation of the incremental log is triggered, that is, the update of the address mapping relationship in the incremental log is merged into the L2P table represented by the latest periodic log to update and reconstruct the L2P table. Among them, the storage unit 31 can use DDR (Double Data Rate SDRAM, double data rate synchronous dynamic random access memory). However, it should be understood that the storage type adopted by the storage unit 31 in this embodiment is not limited, and it can be configured based on the actual situation of the storage device, and no further examples are given here.
[0059] In a cycle T, the amount of incremental log data generated is Ds. Taking data writing as an example, if the data writing speed of the storage device is stable, the amount of incremental log data generated in a cycle T is also fixed. When reconstructing the L2P table, due to the bandwidth constraint of the storage unit 31, it can only accept an incremental log with a total data volume of D. If the total size of the L2P table is fixed at Dt, then the total amount of system background data flushed in cycle T is Ds + Dt / (D / Ds) = (1 + Dt / D) * Ds. According to this formula, increasing the amount of incremental log data that the storage unit 31 can accept during L2P table reconstruction can reduce the total amount of data sent in cycle T, and thus reduce the background traffic in the running state. This can enable the storage device to give more backend traffic to the input / output path of the IO, thereby optimizing the device performance.
[0060] If the total amount of incremental log data that the storage unit 31 can accept during L2P table reconstruction is increased, the incremental log required to reconstruct and update a complete L2P periodic log increases. When the bandwidth or bandwidth utilization rate of the storage unit 31 remains unchanged, it will cause the L2P table reconstruction and update time to become longer.
[0061] Figure 4 It is a schematic diagram of the address mapping table update process of a comparative example. The physical addresses FPA in the L2P table are arranged in the order of the logical addresses LBA. Taking the data access size of storage unit 41 as 64B and the size of one incremental log as 4B as an example, the data access size of storage unit 41 varies according to different types of hardware devices of storage types and different configurations. Based on different types of storage devices, the size of its incremental log also varies according to the actual situation. Here, only the data access size of storage unit 41 being 64B and the size of one incremental log being 4B are taken as examples for illustration, but it should be understood that this is not limited thereto. As Figure 4 shown, in this comparative example, during the periodic log update and reconstruction process, each time an incremental log LBA-FPA with a data volume of 4B is updated, the control unit 42 controls the execution of steps S41-S43. Among them, in step S41, the control unit 42 reads a corresponding data area of 64B size from the storage unit 41 based on the operation address LBA corresponding to the incremental log to be updated, and this data area includes the operation address LBA. In step S42, the address mapping relationship of the same operation address LBA in this data area is updated based on the incremental log LBA-FPA. In step S43, the updated 64B data area is written back to the storage unit 41. Thus, it can be seen that although only 4B of data volume needs to be updated for updating one incremental log, the storage unit 41 actually reads 64B of data and writes back 64B of data, resulting in a large read-write amplification, which seriously affects the bandwidth utilization rate of the storage unit 41.
[0062] Furthermore, in the actual data processing scenario, there are many situations where a continuous plurality of LBAs are processed together, such as write operations of a continuous plurality of LBAs, etc. In this scenario, the operation addresses LBA corresponding to multiple consecutive incremental logs generated by writing data are consecutive. If multiple consecutive incremental logs with consecutive addresses can be updated simultaneously, the read-write process of the storage unit will be reduced to a large extent. Based on this, this embodiment provides an address information update method, a storage device and its controller, so as to improve the bandwidth utilization rate and reconstruction speed of the storage unit during the address information reconstruction process by simultaneously updating the mapping relationships of corresponding multiple consecutive operation addresses in the storage unit based on multiple consecutive incremental logs with consecutive addresses, thereby reducing the background processing data volume and improving the device performance.
[0063] Figure 5 It is a flowchart of the address information update method of the embodiment of the present invention. Among them, the address information is also the address mapping table (L2P table). As Figure 5 shown, the address information update method of the embodiment of the present invention includes the following steps:
[0064] Step S110, detect the address continuity of multiple consecutive incremental logs. Among them, the first incremental log among the multiple consecutive incremental logs is the incremental log to be updated currently.
[0065] In an alternative implementation, in this embodiment, it is detected whether the operation addresses corresponding to the data processing commands recorded in multiple consecutive incremental logs are continuous. For example, if it is detected that the operation addresses corresponding to the consecutive incremental logs r1 - r4 are LBA, LBA + 1, LBA + 2, and LBA + 3 respectively, it indicates that the operation addresses corresponding to the consecutive incremental logs r1 - r4 have address continuity.
[0066] In another alternative implementation, in this embodiment, a data model that meets the address continuity condition can be pre - constructed. When the detected consecutive multiple incremental logs meet this data model, it is determined that these incremental logs have address continuity. It should be understood that this embodiment does not limit the specific method of detecting whether the consecutive incremental logs have address continuity, as long as it can detect whether the operation addresses corresponding to the incremental logs are continuous.
[0067] Further optionally, in this embodiment, it is sequentially detected whether the operation addresses corresponding to adjacent incremental logs are continuous until the operation addresses corresponding to the currently detected adjacent incremental logs are not continuous. For example, assume that the current incremental log set z includes 6 incremental logs r1 - r6, and the corresponding operation addresses are: LBA, LBA + 1, LBA + 2, LBA + 3, LBA + 10, LBA + 11. In this embodiment, after detecting that the operation addresses LBA and LBA + 1 corresponding to the incremental logs r1 and r2 are continuous, the address continuity of the operation addresses corresponding to the incremental logs r2 and r3 is continuously detected. After detecting that the operation addresses LBA + 1 and LBA + 2 corresponding to the incremental logs r2 and r3 are continuous, the address continuity of the operation addresses corresponding to the incremental logs r3 and r4 is continuously detected. After detecting that the operation addresses LBA + 2 and LBA + 3 corresponding to the incremental logs r3 and r4 are continuous, the address continuity of the operation addresses corresponding to the incremental logs r4 and r5 is continuously detected. At this time, it is detected and determined that the operation addresses LBA + 3 and LBA + 10 corresponding to the incremental logs r4 and r5 are not continuous, and this address continuity detection operation is stopped.
[0068] In another alternative implementation, this embodiment detects whether the operation addresses corresponding to adjacent predetermined incremental logs are continuous. Herein, this embodiment does not limit the specific value of the number of the detected predetermined incremental logs, which can be calculated and configured according to the actual situation of the storage device. Further, the number of the detected predetermined incremental logs can be determined according to system resources, for example, determined according to the number of commands aggregated by a command processing aggregation unit in a controller of the storage device, etc.
[0069] Further, this embodiment can determine the maximum number M of incremental logs that can be updated by a single read / write operation of a storage unit according to the actual situation of the storage device. In one alternative implementation, this embodiment can determine this maximum number M as the number of the detected predetermined incremental logs. In another alternative implementation, the number of the detected predetermined incremental logs in this embodiment can include multiple. For example, assuming that the above maximum number M is greater than 2, this embodiment can simultaneously perform the following detections: detecting whether the operation addresses corresponding to adjacent 2 incremental logs are continuous, detecting whether the operation addresses corresponding to adjacent 3 incremental logs are continuous, …, detecting whether the operation addresses corresponding to adjacent M-1 incremental logs are continuous, detecting whether the operation addresses corresponding to adjacent M incremental logs are continuous. It should be understood that in such a detection method, a sequential detection method is adopted, that is, for detecting whether the operation addresses corresponding to adjacent 2 incremental logs are continuous, detecting whether the operation addresses corresponding to the first incremental log and the second incremental log are continuous. If they are continuous, then continue to detect whether the operation addresses corresponding to the second incremental log and the third incremental log are continuous to detect whether the operation addresses corresponding to adjacent 3 incremental logs are continuous until it is detected that the operation addresses of adjacent incremental logs are not continuous, or the Mth incremental log is detected. Thereby, the calculation amount of the address continuity detection can be further reduced.
[0070] Further, in order to minimize the number of read / write operations of the storage unit, this embodiment selects the maximum value of the incremental logs with continuous operation addresses to perform the current incremental log update operation. For example, if it is detected that the operation addresses corresponding to adjacent 2, 3, …, M-1, M incremental logs are all continuous, then perform the current incremental log update operation based on these M incremental logs. If it is detected that the operation addresses corresponding to adjacent 2, 3, …, M-1 incremental logs are continuous and the operation addresses corresponding to adjacent M incremental logs are continuous, then perform the current incremental log update operation based on the first M-1 incremental logs.
[0071] Further, in this embodiment, it is also possible to first detect whether the operation addresses corresponding to adjacent M incremental logs are continuous. When the operation addresses corresponding to adjacent M incremental logs are not continuous, detect whether the operation addresses corresponding to adjacent M - 1 incremental logs are continuous, until multiple consecutive incremental logs with continuous operation addresses are detected, or the first incremental log and the second incremental log among these M consecutive incremental logs are not continuous. It should be understood that in such a detection method, a reverse detection method is adopted, that is, for detecting whether the operation addresses corresponding to adjacent M incremental logs are continuous, first detect whether the operation addresses corresponding to the Mth incremental log and the (M - 1)th incremental log are continuous. If they are not continuous, directly determine that the operation addresses corresponding to adjacent M incremental logs are not continuous. Then, use the same method to detect whether the operation addresses corresponding to adjacent M - 1 incremental logs are continuous. Thus, the computational complexity of address continuity detection can be further reduced.
[0072] Step S120, in response to multiple consecutive incremental logs with continuous addresses, determine the target incremental log.
[0073] In an alternative implementation, if the detection method of successively detecting whether the operation addresses corresponding to adjacent incremental logs are continuous until the operation addresses corresponding to the currently detected adjacent incremental logs are not continuous is adopted, this embodiment determines the target incremental log in the following manner.
[0074] Due to the system resource limitations of the storage device, there is a maximum limit on the number of incremental logs that can be updated each time the storage unit performs an incremental log update operation. This embodiment needs to determine whether the number of multiple consecutive incremental logs with continuous addresses detected by the above detection meets this maximum limit, so as to avoid the situation where the update operation cannot be executed or is executed incorrectly. Specifically, in response to the number of multiple consecutive incremental logs with continuous addresses being greater than a predetermined value, the first predetermined consecutive incremental logs among the multiple consecutive incremental logs with continuous addresses are determined as the target incremental log. In response to the number of multiple consecutive incremental logs with continuous addresses not being greater than the predetermined value, the multiple consecutive incremental logs with continuous addresses are determined as the target incremental log. Among them, the above predetermined value can be the above maximum limit or less than the maximum limit, and this embodiment does not limit this. Further, the number of the first predetermined consecutive incremental logs among the multiple consecutive incremental logs with continuous addresses is also the predetermined value.
[0075] Further, if the number of multiple consecutive incremental logs with consecutive addresses is greater than a predetermined value, after performing the current update operation, before performing the next update operation, it is possible to continue to determine whether the number of unupdated incremental logs in the multiple consecutive incremental logs with consecutive addresses is greater than the predetermined value, and then perform the corresponding update operation in a similar manner. Thus, when a relatively large number of consecutive addresses are used for the corresponding data processing request, this implementation method can obtain a combination of incremental logs for multiple consecutive update operations through one address continuity determination, further improving the update efficiency.
[0076] In another alternative implementation method, if a detection method of detecting whether the operation addresses corresponding to adjacent predetermined incremental logs are consecutive is adopted, in response to the operation addresses corresponding to adjacent predetermined incremental logs being consecutive, this embodiment determines the adjacent predetermined incremental logs as target incremental logs. Since the number of incremental logs to be detected is limited during the address continuity detection, when the operation addresses corresponding to adjacent predetermined incremental logs are consecutive, these incremental logs are determined as target incremental logs.
[0077] Step S130, update the mapping relationship of the same operation address in the storage unit based on each target incremental log.
[0078] In an alternative implementation method, this embodiment implements the corresponding update operation through a cache unit. It should be understood that this embodiment does not limit how to implement the method of simultaneously updating the periodic log (i.e., the L2P table snapshot) using multiple incremental logs, as long as the corresponding function can be achieved.
[0079] Further, this embodiment reads address information of a predetermined size from the storage unit to the cache unit according to the operation address corresponding to the currently to-be-updated incremental log. The storage unit stores an L2P table. The address range of the address information includes the operation address corresponding to the to-be-updated incremental log. For example, assuming that the operation address of the currently to-be-updated incremental log is LBA, address information of a predetermined size is read starting from address LBA in the L2P table stored in the storage unit. Further, the predetermined size can be determined according to the data access size of the storage unit.
[0080] Further, this embodiment updates the address information in the cache unit according to the operation address corresponding to each target incremental log, and writes the updated address information back to the storage unit.
[0081] Taking four target incremental logs as an example, where the operation addresses corresponding to the target incremental logs are LBA, LBA + 1, LBA + 2, and LBA + 3 respectively, the address mapping relationships of LBA, LBA + 1, LBA + 2, and LBA + 3 in the address information are updated based on the address mapping relationships corresponding to the target incremental logs, and the updated address information of a predetermined size is written back to the storage unit to complete the current update operation.
[0082] Further, if no other incremental logs with an address continuity relationship are detected based on the currently to-be-updated incremental log, this embodiment determines the currently to-be-updated incremental log as the target incremental log, reads the address information of a predetermined size from the storage unit to the cache unit according to the operation address corresponding to the currently to-be-updated incremental log, updates the address information in the cache unit according to the operation address corresponding to the target incremental log, and writes the updated address information back to the storage unit.
[0083] Based on the above corresponding implementation methods, this embodiment can process each incremental log in the current cycle in sequence to achieve the reconstruction and update of the periodic log.
[0084] Figure 6 It is a schematic diagram of the address mapping table update process of the embodiment of the present invention. Taking the data access size of the storage unit 61 as 64B and the size of one incremental log as 4B as an example, the data access size of the storage unit 61 varies according to different types of storage hardware devices and different configurations. Based on different types of storage devices, the size of the incremental log also varies according to the actual situation. Here, only the data access size of the storage unit 61 being 64B and the size of one incremental log being 4B are taken as examples for illustration, but it should be understood that this is not limited thereto. Such as Figure 6As shown, in this embodiment, during the periodic log update and reconstruction process, the control unit 62 detects the address continuity of the incremental log r1 and multiple incremental logs after the incremental log r1 based on the current incremental log r1 to be updated. The specific detection process can adopt any of the above implementation manners and will not be elaborated here. If 4 consecutive incremental logs r1 - r4 with continuous addresses are detected. Among them, the incremental log r1 is LBA0 - FPA0, the incremental log r2 is LBA1 - FPA1, the incremental log r3 is LBA2 - FPA2, and the incremental log r4 is LBA3 - FPA3. Further, the control unit 62 controls the execution of steps S61 - S63 to complete the current update operation. Among them, in step S61, the control unit 62 reads the corresponding 64B - sized address information including the operation address LBA0 from the address data LBA0 stored in the storage unit 61 based on the operation address LBA0 corresponding to the incremental log r1 to be updated into the cache unit 63. In step S62, the address mapping relationships of the same operation addresses LBA0 - LBA3 in the address information in the cache unit 63 are updated based on the incremental logs r1 - r4. In step S63, the updated 64B - sized address information is written back from the cache unit 63 to the storage unit 61. It should be understood that this embodiment does not limit the execution order of the address continuity detection step of the control unit 62 and the step of reading the predetermined - sized address information from the storage unit 61, and they can be executed sequentially or in parallel.
[0085] It can be seen that in this embodiment, by detecting the address continuity, multiple consecutive incremental logs with continuous addresses can be updated simultaneously to Figure 6 take the 4 consecutive incremental logs with continuous addresses shown as an example. In the read - write update operation of the storage unit 61, 16B of data volume is updated at a time. Compared with Figure 4 the 4B of data volume updated in the read - write update operation in the comparative example, this embodiment reduces the read - write amplification of the storage unit, improves the bandwidth utilization rate of the storage unit, reduces the number of read - write operations of the storage unit in the case of the same incremental log data volume, thereby improving the periodic log reconstruction speed, further reducing the background processing data volume, and improving the device performance.
[0086] Further, in this embodiment, the flushing ratio of the incremental log and the periodic log is determined according to the number of different consecutive types of incremental logs within the update period. Among them, the consecutive type is determined based on the number of consecutive incremental logs with continuous addresses.
[0087] Taking M as the maximum limit of the incremental log that can be updated each time an incremental log update operation is performed by a storage unit determined based on the system resource limit of the storage device, the continuous types may include the type with the number of consecutive incremental logs with consecutive addresses being M, the type with the number of consecutive incremental logs with consecutive addresses being M - 1, …, the type with the number of consecutive incremental logs with consecutive addresses being 1. In this embodiment, the flushing ratio of the incremental log and the periodic log is determined by counting the number of incremental logs of different continuous types.
[0088] In an alternative implementation, in this embodiment, the flushing ratio DumpRatio of the incremental log and the periodic log is determined by the following formula:
[0089]
[0090] where wj (1 ≤ j ≤ M) is the weight coefficient corresponding to the type with the number of consecutive incremental logs with consecutive addresses being j, and cntj is the total amount of incremental logs corresponding to the type with the number of consecutive incremental logs with consecutive addresses being j. is the total amount of incremental logs processed in the current period. Among them, the above weight coefficient can be determined and adjusted according to the actual statistical situation, and this embodiment does not limit this.
[0091] Furthermore, in this embodiment, the incremental logs of adjacent predetermined types (for example, the types with the number of consecutive incremental logs with consecutive addresses being 2 and 3) can be merged, and the corresponding weight coefficients can be adjusted to further improve the convenience of calculating DumpRatio. Taking the above M = 4 as an example, in this embodiment, the flushing ratio DumpRatio of the incremental log and the periodic log is determined by the following formula:
[0092]
[0093] where w1 is the weight coefficient corresponding to the type that updates a single incremental log, w2 is the weight coefficient corresponding to the type that updates 2 and 3 consecutive incremental logs with consecutive addresses, w3 is the weight coefficient corresponding to the type that updates 4 consecutive incremental logs with consecutive addresses, cnt1 is the total amount of incremental logs corresponding to the type that updates a single incremental log, cnt2 is the total amount of incremental logs corresponding to the type that updates 2 and 3 consecutive incremental logs with consecutive addresses, and cnt3 is the total amount of incremental logs corresponding to the type that updates 4 consecutive incremental logs with consecutive addresses.
[0094] It should be understood that the above formula for calculating the DumpRatio is merely exemplary, and the present embodiment is not limited thereto. Further, the present embodiment can adjust the calculation method of the DumpRatio according to the actual configuration of the storage device and / or the characteristics of the operation addresses corresponding to the data processing commands processed in the current cycle, and no further examples will be given here.
[0095] Further, based on the above formula, when the operation addresses corresponding to the data processing commands within the cycle are completely random, the bandwidth of the storage unit cannot be reused at all. At this time, the amount of data that can be received for downsampling cannot be increased. Assuming that the amount of incremental log downsampling data within the cycle is A, and the amount of L2P cycle log downsampling data is A / w1. Assuming w1 = 1 / 4, then the amount of L2P cycle log downsampling data is 4A. At this time, the background system bandwidth is 5A. If the operation addresses corresponding to the data processing commands within the cycle are all detected to be consecutive according to the maximum limit M, assuming that the amount of incremental log downsampling data within the cycle is A, and the amount of L2P cycle log downsampling data is A / wM. Assuming wM = 1, then the amount of L2P cycle log downsampling data is A, and the background system bandwidth is 2A. Compared with the L2P cycle log reconstruction and update method that does not detect address continuity and directly assumes completely random operation addresses, the amount of downsampling data is reduced by 60%. Among them, the amount of incremental log downsampling data A within the cycle is determined by the write bandwidth size. It should be understood that the above is only an example of reducing the background downsampling data that can be achieved by the present embodiment, and the specific values in the actual application scenario need to be statistically calculated according to the above formula or other methods.
[0096] The embodiment of the present invention detects the address continuity of multiple consecutive incremental logs, determines the target incremental logs in response to the multiple consecutive incremental logs with continuous addresses, and updates the mapping relationship of the same operation addresses in the storage unit based on each target incremental log. Thus, in the process of reconstructing the address information, the present embodiment simultaneously updates the mapping relationships of multiple corresponding consecutive operation addresses in the storage unit based on multiple consecutive incremental logs with continuous addresses, improving the bandwidth utilization rate and reconstruction speed of the storage unit during address information reconstruction, thereby reducing the amount of background processed data and improving the device performance.
[0097] Figure 7 It is a schematic diagram of the address information updating device according to the embodiment of the present invention. As Figure 7 shown, the address information updating device 7 according to the embodiment of the present invention includes a detection unit 71, a determination unit 72, and an update unit 73.
[0098] The detection unit 71 is configured to detect the address continuity of multiple consecutive incremental logs. The determination unit 72 is configured to determine a target incremental log in response to multiple consecutive incremental logs having continuous addresses. The update unit 73 is configured to update the mapping relationship of the same operation address in the storage unit based on each of the target incremental logs.
[0099] Further, the address information update device 7 of this embodiment further includes a reading unit, which is configured to read a predetermined size of address information from the storage unit to the cache unit according to the operation address corresponding to the currently to-be-updated incremental log, and the address range of the address information includes the operation address corresponding to the to-be-updated incremental log.
[0100] Further, the update unit 73 includes an update subunit and a write-back subunit. Among them, the update subunit is configured to update the address information in the cache unit according to the operation address corresponding to each of the target incremental logs. The write-back subunit is configured to write the updated address information back to the storage unit.
[0101] Further, the detection unit 71 is further configured to sequentially detect whether the operation addresses corresponding to adjacent incremental logs are continuous until the operation addresses corresponding to the currently detected adjacent incremental logs are not continuous.
[0102] Further, the determination unit 72 is further configured to, in response to the number of multiple consecutive incremental logs having continuous addresses being greater than a predetermined value, determine the first predetermined consecutive incremental logs among the multiple consecutive incremental logs having continuous addresses as the target incremental logs, and in response to the number of multiple consecutive incremental logs having continuous addresses not being greater than the predetermined value, determine the multiple consecutive incremental logs having continuous addresses as the target incremental logs.
[0103] Further, the detection unit 71 is further configured to detect whether the operation addresses corresponding to adjacent predetermined incremental logs are continuous. The determination unit 72 is further configured to, in response to the operation addresses corresponding to adjacent predetermined incremental logs being continuous, determine the adjacent predetermined incremental logs as the target incremental logs.
[0104] Further, the address information update device 7 of this embodiment further includes a ratio calculation unit, which is configured to determine the flushing ratio of the incremental logs and the periodic logs according to the number of incremental logs of different continuous types within the update period, and the continuous type is determined based on the number of consecutive incremental logs having continuous addresses.
[0105] In an embodiment of the present invention, by detecting the address continuity of multiple consecutive incremental logs, in response to multiple consecutive incremental logs with continuous addresses, target incremental logs are determined, and the mapping relationship of the same operation addresses in the storage unit is updated based on each target incremental log. Thus, in this embodiment, during the address information reconstruction process, based on multiple consecutive incremental logs with continuous addresses, the mapping relationships of corresponding multiple consecutive operation addresses in the storage unit are updated simultaneously, improving the bandwidth utilization rate and reconstruction speed of the storage unit during address information reconstruction, thereby reducing the amount of background processed data and improving the device performance.
[0106] Figure 8 is a schematic diagram of a storage device according to an embodiment of the present invention. As Figure 1 shown, the storage device 8 in this embodiment includes a controller 81 and a storage space 82. Among them, the storage space 82 is used to store data. Optionally, the storage device in this embodiment uses a non-volatile memory to store data. Further, the storage space 82 is implemented by using flash memory technology. For example, the storage space 82 can use NAND flash memory. It should be understood that this embodiment does not limit the flash memory technology used by the storage space 82. The controller 81 can be an integrated circuit chip with corresponding signal processing capabilities, and is used to perform operations such as reading, writing, and erasing on the data in the storage space 82.
[0107] Further, the controller 81 in this embodiment includes a control unit 811, a storage unit 812, and a cache unit 813. Among them, the storage unit 812 is configured to store an address mapping table. Among them, the address mapping table is used to record the mapping relationship between the logical address and the physical address. Optionally, the address mapping table in the storage unit 812 can be a periodic log, that is, an L2P table snapshot. The cache unit 813 is configured to cache a predetermined size of address information read from the storage unit 812 and the updated address information.
[0108] The control unit 811 is configured to, during the L2P table reconstruction and update process, read a predetermined size of address information from the storage unit 812 to the cache unit 813 according to the operation address corresponding to the current incremental log to be updated, and detect the address continuity of multiple consecutive incremental logs (that is, the current incremental log to be updated and the incremental logs after the current incremental log to be updated). Among them, the address range of the address information includes the operation address corresponding to the incremental log to be updated. Further, the control unit 811, in response to multiple consecutive incremental logs with continuous addresses, determines the target incremental logs, and updates the mapping relationship of the same operation addresses in the storage unit based on each target incremental log.
[0109] Further, the control unit 811 may include a front-end control module (FE, Front End), an intermediate control module (FTL, Flash Translation Layer), and a back-end control module (BE, Back End). The front-end control module is used to perform functions such as protocol parsing and request queue management on the received data processing requests. The intermediate control module is used to map the logical address corresponding to the data processing request to a specific physical storage unit, and implement functions such as wear leveling, garbage collection, bad block management, and partition structure planning. The back-end control module is used to perform interaction operations with the physical storage medium (i.e., the storage space 82), such as issuing read / write, erase, garbage collection, and other commands to the storage space 82. The control unit 811 of this embodiment realizes the data reading function through the FE module, the FTL module, and the BE module.
[0110] Further, in this embodiment, the address continuity statistics of the incremental log can be added in the FE module or the FTL module, or a detection module can be independently set in the control unit 811 to implement the address continuity statistics of the incremental log. This embodiment does not limit this, as long as the corresponding address continuity detection can be realized.
[0111] Further, the control unit 811 is further configured to determine the flushing ratio of the incremental log and the periodic log according to the number of incremental logs of different continuous types within the update period. Wherein, the continuous type is determined based on the number of continuous incremental logs with continuous addresses. It should be understood that the specific calculation method of the flushing ratio can refer to the above embodiments and will not be described in detail here.
[0112] The storage device according to the embodiment of the present invention detects the address continuity of multiple continuous incremental logs, responds to multiple continuous incremental logs with continuous addresses, determines the target incremental log, and updates the mapping relationship of the same operation address in the storage unit based on each target incremental log. Thus, in this embodiment, by simultaneously updating the mapping relationships of multiple corresponding continuous operation addresses in the storage unit based on multiple continuous incremental logs with continuous addresses during the address information reconstruction process, the bandwidth utilization rate and the reconstruction speed of the storage unit during address information reconstruction are improved, thereby reducing the amount of background processed data and improving the device performance.
[0113] Figure 9 is a schematic diagram of the electronic device according to the embodiment of the present invention. As Figure 9 shown, the electronic device 9 of this embodiment includes a storage device 91 and a host 92. Among them, the host 92 is configured to send data processing commands to the storage device 91 and receive data processing results from the storage device 91. Optionally, the host 92 may be a data processing device capable of reading data in the storage device, and this embodiment does not limit the type of the host 92.
[0114] The storage device 91 in the electronic device 9 of this embodiment includes a controller and a storage space for storing data. Further, the controller of this embodiment includes a control unit, a storage unit, and a cache unit. Among them, the storage unit is configured to store an address mapping table. Among them, the address mapping table is used to record the mapping relationship between logical addresses and physical addresses. Optionally, the address mapping table in the storage unit can be a periodic log, that is, a snapshot of the L2P table. The cache unit is configured to cache a predetermined size of address information read from the storage unit and updated address information. The control unit is configured to, during the L2P table reconstruction and update process, read a predetermined size of address information from the storage unit to the cache unit according to the operation address corresponding to the current incremental log to be updated, and detect the address continuity of multiple consecutive incremental logs (that is, the current incremental log to be updated and the incremental logs after the current incremental log to be updated). Among them, the address range of the address information includes the operation address corresponding to the incremental log to be updated. Further, in response to multiple consecutive incremental logs with continuous addresses, the control unit determines the target incremental logs, and updates the mapping relationship of the same operation address in the storage unit based on each target incremental log. Further, the control unit is also used to determine the downbrush ratio of the incremental log and the periodic log according to the number of incremental logs of different continuous types within the update period. Among them, the continuous type is determined based on the number of consecutive incremental logs with continuous addresses. It should be understood that the specific calculation method of the downbrush ratio can refer to the above embodiment and will not be specifically described here.
[0115] It should be understood that the specific process of the controller of the above storage device 91 to implement the reconstruction and update of the periodic log can refer to the above embodiment and will not be elaborated in detail here.
[0116] In the electronic device of the embodiment of the present invention, the storage device of the electronic device detects the address continuity of multiple consecutive incremental logs, and in response to multiple consecutive incremental logs with continuous addresses, determines the target incremental logs, and updates the mapping relationship of the same operation address in the storage unit based on each target incremental log. Thus, in this embodiment, by simultaneously updating the mapping relationships of multiple corresponding consecutive operation addresses in the storage unit based on multiple consecutive incremental logs with continuous addresses during the address information reconstruction process, the bandwidth utilization rate and reconstruction speed of the storage unit during address information reconstruction are improved, thereby reducing the amount of background processed data and improving the device performance.
[0117] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, and the computer-readable program is used for a computer to execute the above-mentioned partial or all method embodiments.
[0118] That is, those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program is stored in a storage medium, including several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0119] The foregoing are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for updating address information, characterized in that: The method comprises: Check the address continuity of multiple consecutive incremental logs; In response to a plurality of continuous incremental logs having continuous addresses, determining a target incremental log; The mapping relationship of the same operation address in the storage unit is updated based on each of the target incremental logs.
2. The method according to claim 1, characterized in that: The method further comprises: According to the corresponding operation address of the incremental log to be updated, address information of a predetermined size is read from the storage unit to the cache unit, and the address range of the address information includes the corresponding operation address of the incremental log to be updated.
3. The method according to claim 2, characterized in that The updating of the mapping relationship of the same operation address in the storage unit based on each of the target incremental logs includes: Updating the address information in the cache unit according to the operation address corresponding to each of the target incremental logs; The updated address information is written back to the storage unit.
4. The method according to claim 1, characterized in that: The detecting of the address continuity of the plurality of consecutive incremental logs comprises: Whether the operation addresses corresponding to adjacent incremental logs are continuous is detected in sequence until the operation addresses corresponding to the adjacent incremental logs currently detected are discontinuous.
5. The method according to claim 4, characterized in that In response to a plurality of continuous incremental logs having continuous addresses, determining a target incremental log includes: In response to the number of the plurality of continuous incremental logs with continuous addresses being greater than a predetermined value, determining a first predetermined continuous incremental log among the plurality of continuous incremental logs with continuous addresses as a target incremental log; In response to the number of the plurality of continuous incremental logs with continuous addresses being not greater than a predetermined value, the plurality of continuous incremental logs with continuous addresses are determined as target incremental logs.
6. The method according to claim 1, characterized in that The detecting of the address continuity of the plurality of consecutive incremental logs comprises: Check whether the operation addresses corresponding to adjacent predetermined incremental logs are continuous; In response to the plurality of continuous incremental logs having continuous addresses, determining the target incremental log comprises: In response to the fact that the operation addresses corresponding to the adjacent predetermined incremental logs are continuous, the adjacent predetermined incremental logs are determined as target incremental logs.
7. The method according to claim 1, characterized in that The method further comprises: The flush ratio of the incremental log and the periodic log is determined according to the number of incremental logs of different continuous types within the update cycle, wherein the continuous type is determined based on the number of continuous incremental logs with continuous addresses.
8. A storage device controller, characterized in that: The storage device controller comprises: A storage unit configured to store an address mapping table, wherein the address mapping table is used to record a mapping relationship between a logical address and a physical address; a cache unit configured to cache address information of a predetermined size and updated address information read from the storage unit; A control unit configured to execute the method according to any one of claims 1 to 7.
9. A storage device, characterized in that: The storage device comprises: The storage device controller according to claim 8; Storage space, used to store data.
10. An electronic device, characterized in that: The electronic device comprises: The storage device as claimed in claim 9; The host is configured to send a data processing request to the storage device and receive a data processing result from the storage device.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or data, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
12. A log updating device, characterized in that: The device comprises: a detection unit configured to detect address continuity of a plurality of consecutive incremental logs; a determination unit configured to determine a target incremental log in response to a plurality of continuous incremental logs having continuous addresses; The updating unit is configured to update the mapping relationship of the same operation address in the storage unit based on each of the target incremental logs.
Citation Information
Cited By
Address information updating method, storage device, and controller thereof
WO2026171116A1