Address mapping table manager, address mapping table management method and computer equipment
By designing an address mapping table manager in a solid-state drive, using a table modification processor, offset calculator and heat manager for hot and cold management of address heat statistics and data, the high computing power and power consumption problems of the central processor core in these links is solved, and more efficient performance and power consumption management is achieved.
Patent Information
- Application Number
- CN202411804443.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The heat statistics of the address and the hot and cold management of the data consume high computing power and power consumption in the solid-state drive, especially the performance and power consumption of the central processor core when performing these links.
An address map table manager is designed, including a table modification processor, an offset calculator and a heat manager. The table modification processor receives the table modification command, the offset calculator determines the target partition, and the heat manager performs heat statistics and hot and cold management based on the heat histogram to reduce the participation of the central processor core.
It realizes heat statistics of address and hot and cold management of data through hardware, significantly reducing the computing power and power consumption of the central processor core, and improving the performance and efficiency of the solid-state drive.
Smart Images

Figure CN119807086A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an address mapping table manager, an address mapping table management method and a computer device. Background Art
[0002] The physical characteristics of a solid state drive (SSD) require a mapping relationship between the physical address of its internal NAND and the logical address of the host. In order to achieve efficient read and write operations, the SSD needs to maintain an address mapping table that records the correspondence between the logical address and the physical address. However, the maintenance and management of the address mapping table has a significant impact on the performance and power consumption of the SSD.
[0003] In the related art, hardware is usually used to manage the address mapping table inside the SSD to reduce the computing power consumption of the CPU core. To further reduce the computing power consumption of the CPU core, hardware is used to uniformly manage the address mapping table and the number of valid data frames (Valid Data Fragment Count, abbreviated as: vdfc) in the data block.
[0004] However, although the hardware management address mapping table and vdfc have improved the performance and power consumption of the CPU core, the heat statistics of the address and the hot and cold management of the data are still high-computing-power-consuming links, and the computing power and power consumption consumed by the CPU core when executing these links are still high. Summary of the invention
[0005] In view of this, the present invention provides an address mapping table manager to solve the problem that address heat statistics and data hot and cold management are still links that consume high computing power, and the computing power and power consumption consumed by the central processing unit core when executing these links are still high.
[0006] In a first aspect, the present invention provides an address mapping table manager, the address mapping table manager comprising:
[0007] a table change processor, configured to receive a table change command, obtain a comparison address and a logic address in the table change command, determine a source of the table change command based on the comparison address, and send the logic address to an offset calculator when the source of the table change command is a host;
[0008] An offset calculator, configured to receive the logical address, determine a target partition based on the logical address and a preset partition granularity, and send the target partition to a thermal manager;
[0009] A thermal manager is used to receive the target partition, determine a first destination address based on the target partition and the starting address of the thermal histogram, increase the corresponding partition temperature of the thermal histogram based on the first destination address, obtain the temperature of each partition in the thermal histogram at every preset time period, and determine hot zones and cold zones based on the temperature of each partition.
[0010] The address mapping table manager provided in this embodiment expands the address mapping table manager in the related art. When the address mapping table is modified by using the table modification processor, if the source of the table modification command is the host, the offset calculator determines the target partition based on the logical address and the preset partition granularity in the table modification command, and sends the target partition to the thermal manager. The thermal manager increases the heat of the corresponding partition of the thermal histogram based on the target partition and the starting address of the thermal histogram, and obtains the heat of each partition in the thermal histogram at intervals of a preset time period, and determines the hot zone and the cold zone based on the heat of each partition. The hardware is used to implement the heat statistics of the address and the hot and cold management of the data, reducing the computing power and power consumption of the central processing unit core.
[0011] In an optional implementation, the table modification processor is specifically used to:
[0012] When the comparison address is a preset value, determining that the source of the table modification command is a host;
[0013] When the comparison address is not a preset value, it is determined that the source of the table modification command is not a host.
[0014] The address mapping table manager provided in this embodiment can accurately determine the source of the table modification command by checking whether the comparison address is a preset value, thereby achieving the accuracy of modifying the address mapping table.
[0015] In an optional implementation, the address mapping table manager further includes a mask calculator and a valid data frame processor;
[0016] The table change processor is further configured to obtain a physical address in the table change command, determine a second destination address based on a start address of the address mapping table and the logical address when the source of the table change command is a host, and write the physical address into the address mapping table based on the second destination address;
[0017] The table change processor is further configured to, when the source of the table change command is not the host, obtain the original physical address corresponding to the logical address from the address mapping table based on the second destination address, compare the original physical address with the comparison address to obtain a comparison result, and when the comparison result is that the comparison passes, write the physical address into the address mapping table based on the second destination address, and when the comparison result is that the comparison fails, generate a first discard request based on the physical address, and send the first discard request to the mask calculator;
[0018] The mask calculator is used to receive the first discard request, obtain the physical address in the first discard request, determine the first target data block based on the data block mask and the physical address, and send the first target data block to the valid data frame processor;
[0019] The valid data frame processor is used to receive the first target data block, determine a third destination address based on the starting address of the valid data frame processing table and the first target data block, and reduce the valid data frame quantity value of the data block corresponding to the third destination address.
[0020] The address mapping table manager provided in this embodiment generates a first discard request when the original physical address fails to match the comparison address, thereby ensuring the accuracy of the table modification and the security of the data. When the table modification processor sends a discard request, the mask calculator and the valid data frame processor are used to reduce the number of valid data frames of the data block, effectively recovering invalid data frames, optimizing resource utilization, and avoiding memory waste.
[0021] In an optional implementation, the table modification processor is further used to determine the type of the original physical address based on the original physical address and the memory mask after writing the physical address into the address mapping table, and when the type of the original physical address is a flash memory physical address, generate a second discard request based on the original physical address, and send the second discard request to the mask calculator;
[0022] The mask calculator is further used to receive the second discard request, obtain the original physical address in the second discard request, determine the second target data block based on the data block mask and the original physical address, and send the second target data block to the valid data frame processor;
[0023] The valid data frame processor is used to receive the second target data block, determine a fourth destination address based on the starting address of the valid data frame processing table and the second target data block, and reduce the valid data frame quantity value of the data block corresponding to the fourth destination address.
[0024] The address mapping table manager provided in this embodiment processes the second discard request through the mask calculator and the valid data frame processor, determines the second target data block through the data block mask and the original physical address, and reduces the valid data frame quantity value of the corresponding data block, effectively reclaims the flash memory data blocks that are no longer used, optimizes the management of storage resources, and avoids resource waste.
[0025] In an optional implementation, the thermal manager is specifically used for:
[0026] Sorting the partitions based on the order of heat of each partition from high to low to obtain a sorting result;
[0027] Based on the sorting result, determining the heat difference between adjacent sorted partitions;
[0028] When the heat difference is greater than the average heat difference, determining the two partitions corresponding to the heat difference as the target partition combination;
[0029] Based on the target partition combination, determining the hot and cold partition areas;
[0030] For any partition, if the ranking of the partition is higher than the ranking of the hot and cold partitions, determine the partition as a hot zone;
[0031] In the case where the ranking of the partition is not higher than the ranking of the cold and hot partitions, the partition is determined to be a cold zone.
[0032] The address mapping table manager provided in this embodiment determines the heat difference between adjacent partitions based on the sorting result, and determines the target partition combination when the heat difference is greater than the average heat difference, thereby accurately dividing the cold zone and the hot zone. When the system recovers data blocks, it can recover the data of the data blocks in the hot zone to the data blocks with a lower erase count, and recover the data of the data blocks in the cold zone to the data blocks with a higher erase count according to the heat of different areas, thereby achieving wear balancing of the data blocks of the solid-state drive.
[0033] In an optional embodiment, the thermal manager is further used for:
[0034] The heat average difference is determined by the following formula:
[0035] (heat_max–heat_min) / (column_num–1)
[0036] Among them, heat_max is the heat of the highest ranked partition, heat_min is the heat of the lowest ranked partition, and column_num is the total number of partitions.
[0037] The address mapping table manager provided in this embodiment determines the average heat difference, determines the target partition combination when the heat difference is greater than the average heat difference, and then accurately divides the cold area and the hot area through the target partition combination. When the system recovers data blocks, it can recover the data of the data blocks in the hot area to the data blocks with a lower erase count, and recover the data of the data blocks in the cold area to the data blocks with a higher erase count according to the heat of different areas, thereby realizing wear balancing of the data blocks of the solid-state drive.
[0038] In an optional implementation, the thermal manager is specifically used for:
[0039] Sorting the target partition combinations based on the order of the heat of the target partition combinations from high to low;
[0040] Filter out a target partition combination to be determined that is located in the middle position from the sorting results of the target partition combinations;
[0041] The target partition with the lowest ranking in the pending target partition combination is determined as the cold and hot partition area.
[0042] The address mapping table manager provided in this embodiment selects the pending target partition combination located in the middle position from the sorting results of the target partition combination, and determines the target partition with the lowest sorting in the pending target partition combination as the cold and hot partition area, so that the thermal manager can determine the cold and hot partition areas more accurately, thereby achieving the accuracy of the determined cold and hot areas.
[0043] In a second aspect, the present invention provides an address mapping table management method, which is applied to the address mapping table manager of the first aspect or any corresponding implementation manner thereof, the method comprising:
[0044] Based on the table change processor, receiving the table change command, obtaining the comparison address and the logical address in the table change command, determining the source of the table change command based on the comparison address, and sending the logical address to the offset calculator when the source of the table change command is the host;
[0045] Based on the offset calculator, receiving the logical address, determining the target partition based on the logical address and a preset partition granularity, and sending the target partition to the thermal manager;
[0046] Based on the thermal manager, the target partition is received, and based on the target partition and the starting address of the thermal histogram, a first destination address is determined. Based on the first destination address, the corresponding partition heat of the thermal histogram is increased, and the heat of each partition in the thermal histogram is obtained at every preset time period. Based on the heat of each partition, the hot zone and the cold zone are determined.
[0047] The address mapping table management method provided in this embodiment expands the address mapping table manager in the related technology. When the address mapping table is modified by using the table modification processor, if the source of the table modification command is the host, the heat statistics of the address and the hot and cold management of the data are realized through the offset calculator and the thermal manager, thereby reducing the computing power and power consumption of the processor core.
[0048] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the address mapping table management method of the second aspect by executing the computer instructions.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the address mapping table management method of the second aspect.
[0050] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to enable a computer to execute the address mapping table management method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 is a structural block diagram of an address mapping table manager according to an embodiment of the present invention;
[0053] Figure 2 is a structural block diagram of another address mapping table manager according to an embodiment of the present invention;
[0054] Figure 3 is a flow chart of an address mapping table management method according to an embodiment of the present invention;
[0055] Figure 4 is a flow chart of another address mapping table management method according to an embodiment of the present invention;
[0056] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0058] The physical characteristics of the solid-state drive require that the physical address of the NAND inside it cannot be directly mapped to the logical address of the host. In order to meet the read and write requirements of the host, the solid-state drive needs to maintain an address mapping table, which records the correspondence between the logical address and the physical address. The table enables fast data reading and writing. Among them, the address given by the host is the logical address, and the address of the NAND inside the SSD is the physical address.
[0059] In the related art, the address mapping table occupies a large space, and the SSD operates the address mapping table very frequently. If the CPU core is directly operated, since the address mapping table is difficult to hit the cache, using the cache to map the address mapping table will occupy too much chip bus bandwidth. If the memory of the address mapping table is set as non-cache memory, the core directly operates the memory, which will consume a lot of time and affect the core's computing power and power consumption.
[0060] In order to reduce the computing power and power consumption of the core, SSDs in related technologies tend to use hardware to manage the address mapping table. Since register operations are highly efficient, they do not consume the core computing power, and hardware operations on memory can also reduce the core power consumption. At first, some general memory operation hardware was used to modify the address mapping table and vdfc. Since the address mapping table and vdfc are highly correlated and the management method is relatively fixed, it has gradually developed into using hardware to uniformly and automatically manage the address mapping table and vdfc, that is, one instruction operates the source address, destination address, and vdfc at the same time, which greatly reduces the core's participation, saves the core's computing power, and reduces the core's power consumption.
[0061] However, although the hardware management address mapping table and vdfc have improved the core performance and power consumption, the number of data reads and the hot and cold management of data are still the most consuming part of the core computing power. The number of data reads can be reflected by the heat statistics of the address.
[0062] In order to achieve wear leveling of the data blocks of the SSD, data hotness and coldness must be managed. The histogram management method divides the logical address into multiple partitions. Whenever the host operates on the data, the core needs to calculate the host's operating area and operate by itself or call general hardware tools to count the heat of each partition. Then, based on the heat of the current partition and the total number of SSD operations, the hotness of the logical address of the current operation is determined. This series of operations requires frequent context switching, which not only consumes the core's computing power, but also increases the core's power consumption.
[0063] It can be seen that the computing power and power consumption consumed by the core when executing address heat statistics and data hot and cold management are still high.
[0064] An embodiment of the present invention provides an address mapping table manager, which expands the address mapping table manager in the related technology. When the address mapping table is modified by using a table modification processor, if the source of the table modification command is a host, the target partition is determined based on the logical address and preset partition granularity in the table modification command through an offset calculator, and the target partition is sent to a thermal manager. The thermal manager increases the temperature of the corresponding partition of the thermal histogram based on the target partition and the starting address of the thermal histogram, and obtains the temperature of each partition in the thermal histogram at intervals of a preset time period. Based on the temperature of each partition, the hot zone and the cold zone are determined, so as to achieve the effect of using hardware to implement the heat statistics of the address and the hot and cold management of the data, thereby reducing the computing power and power consumption of the central processing unit core.
[0065] It should be noted that the heat statistics of addresses and the hot and cold management operations of data are very fixed. The address mapping table manager is used for synchronous operations. When the address mapping table needs to be modified, the partition heat is counted at the same time, and calculated according to the heat threshold set by the user. The output result is the hot and cold degree of the partition, which provides a processing basis for realizing wear leveling of the data blocks of the solid-state drive, and consumes only very little core power consumption, saving core participation and computing power.
[0066] In this embodiment, an address mapping table manager is provided. Figure 1 is a structural block diagram of an address mapping table manager according to an embodiment of the present invention. Figure 1 As shown, the address mapping table manager includes: a table processor 101, an offset calculator 102 and a thermal manager 103.
[0067] The table modification processor 101 is used to receive a table modification command, obtain a comparison address and a logical address in the table modification command, determine the source of the table modification command based on the comparison address, and send the logical address to the offset calculator when the source of the table modification command is the host.
[0068] Among them, when the address mapping table manager is enabled, the starting address of the address mapping table (address mapping table base address) and the starting address of the heat histogram (heat histogram base address) need to be configured in advance, and then the address mapping table manager is enabled. The address mapping table manager can accept commands from software or other hardware to manage the address mapping table.
[0069] It should be noted that the starting address of the address mapping table and the starting address of the heat histogram exist in the address mapping table manager in the form of registers. The register corresponding to the starting address of the address mapping table is used to calculate the offset according to the starting address of the address mapping table in the memory, that is, the starting address of the address mapping table, during the entire table modification process after receiving the table modification command, and then modify the memory, that is, modify the address mapping table.
[0070] The register corresponding to the starting address of the heat histogram is used to complete granular calculation when processing each table modification command issued by the host, determine the target partition, and use the starting address of the heat histogram in the memory, that is, the starting address of the heat histogram, as the basic offset to increase the heat of the corresponding partition.
[0071] The offset calculator 102 is used to receive the logical address, determine the target partition based on the logical address and the preset partition granularity, and send the target partition to the thermal manager.
[0072] The address mapping table manager includes a granularity selection register, which includes a preset partition granularity value. The user sets the specific number of addresses as a partition according to the needs, and the granularity selection register is set to the number of logical address right shifts, that is, in response to the user's operation, the partition granularity is set in the granularity selection register. Exemplarily, 2.5% of the space of the entire SSD is divided as a granularity.
[0073] When the source of the table modification command is the host, the offset calculator obtains the target partition by dividing the logical address in the table modification command by the preset partition granularity obtained from the granularity selection register.
[0074] That is, the offset calculator calculates the target partition where the logical address is located according to the logical address sent by the host and the granularity configured by the user, and sends the target partition to the thermal manager.
[0075] The thermal manager 103 is used to receive the target partition, determine the first destination address based on the target partition and the starting address of the thermal histogram, increase the corresponding partition heat of the thermal histogram based on the first destination address, obtain the heat of each partition in the thermal histogram at every preset time period, and determine the hot zone and the cold zone based on the heat of each partition.
[0076] Among them, the thermal manager calculates the sum of the target partition and the starting address of the thermal histogram, determines it as the first destination address, and based on the first destination address, increases the heat of the corresponding partition of the thermal histogram corresponding to the first destination address, that is, the heat of the target partition, that is, adds 1 to the heat of the corresponding partition of the thermal histogram.
[0077] It is understandable that the initial values of the heat of the multiple partitions of the heat histogram are 0. The preset time period is preset by the technicians and is not specifically limited here.
[0078] The address mapping table manager provided in this embodiment expands the address mapping table manager in the related art. When the address mapping table is modified by using the table modification processor, if the source of the table modification command is the host, the offset calculator determines the target partition based on the logical address and the preset partition granularity in the table modification command, and sends the target partition to the thermal manager. The thermal manager increases the heat of the corresponding partition of the thermal histogram based on the target partition and the starting address of the thermal histogram, and obtains the heat of each partition in the thermal histogram at intervals of a preset time period, and determines the hot zone and the cold zone based on the heat of each partition. The hardware is used to implement the heat statistics of the address and the hot and cold management of the data, reducing the computing power and power consumption of the central processing unit core.
[0079] In this embodiment, an address mapping table manager is provided. Figure 2 is a structural block diagram of an address mapping table manager according to an embodiment of the present invention. Figure 2 As shown, the address mapping table manager includes: a table processor 201, an offset calculator 202 and a thermal manager 203.
[0080] The table change processor 201 is used to receive a table change command, obtain a comparison address and a logical address in the table change command, determine the source of the table change command based on the comparison address, and send the logical address to the offset calculator when the source of the table change command is the host.
[0081] The table modification processor 201 is specifically used for:
[0082] When the comparison address is a preset value, it is determined that the source of the table modification command is the host.
[0083] The preset value is 0. When the comparison address is 0, it is determined that the source of the table modification command is the host, and there is no need to compare the original physical address corresponding to the logical address with the comparison address, and the address mapping table can be directly modified.
[0084] It is understandable that when processing a command from the host, the comparison address in the table change command is set to 0.
[0085] When the compared address is not a preset value, it is determined that the source of the table modification command is not the host.
[0086] When the comparison address is not 0, it is determined that the source of the table modification command is not the host, and the original physical address corresponding to the logical address needs to be compared with the comparison address to determine whether the address mapping table can be modified.
[0087] The offset calculator 202 is used to receive the logical address, determine the target partition based on the logical address and the preset partition granularity, and send the target partition to the thermal manager. Figure 1 The description of the offset calculator 102 of the illustrated embodiment will not be repeated here.
[0088] The heat manager 203 is used to receive the target partition, determine the first destination address based on the target partition and the starting address of the heat histogram, increase the heat of the corresponding partition in the heat histogram based on the first destination address, obtain the heat of each partition in the heat histogram at every preset time interval, and determine the hot zone and cold zone based on the heat of each partition. For details, please refer to Figure 1 The description of the thermal manager 103 of the illustrated embodiment will not be repeated here.
[0089] like Figure 2 As shown, the address mapping table manager further includes a mask calculator 204 and a valid data frame processor 205 .
[0090] The table modification processor 201 is also used to obtain the physical address in the table modification command. When the source of the table modification command is the host, the second destination address is determined based on the starting address and logical address of the address mapping table, and the physical address is written into the address mapping table based on the second destination address.
[0091] Among them, when the source of the table modification command is the host, the sum of the starting address of the address mapping table and the logical address in the table modification command is calculated and determined as the second destination address. Based on the second destination address, the physical address is written into the address mapping table, thereby completing the modification of the physical address corresponding to the logical address in the address mapping table.
[0092] The table modification processor 201 is also used to, when the source of the table modification command is not the host, obtain the original physical address corresponding to the logical address from the address mapping table based on the second destination address, compare the original physical address with the comparison address to obtain a comparison result, and when the comparison result is that the comparison passes, write the physical address into the address mapping table based on the second destination address, and when the comparison result is that the comparison fails, generate a first discard request based on the physical address, and send the first discard request to the mask calculator.
[0093] Wherein, when the source of the table modification command is not the host, the comparison address in the table modification command is the old physical address corresponding to the logical address in the table modification command. It should be noted that if the physical address of the table modification command is a NAND physical address, the comparison address can be a memory physical address or an old NAND physical address.
[0094] When the original physical address fails to pass the comparison with the comparison address, it is determined that the physical address in the current table modification command is invalid, and a first obsolete request (obsolete request) is generated based on the physical address, and the first obsolete request is sent to the mask calculator.
[0095] The mask calculator 204 is used to receive the first discard request, obtain the physical address in the first discard request, determine the first target data block based on the data block mask and the physical address, and send the first target data block to the valid data frame processor.
[0096] It should be noted that the data block mask exists in the address mapping table manager in the form of a register. When the address mapping table manager is enabled, the mask bit of the data block in the address conversion needs to be set in advance, that is, the data block mask is set and saved in the register.
[0097] It is understandable that the physical address of data on NAND is composed of LUN, block, page, data frame, etc. The area where the block is located may be different in different schemes, and VDFC needs to be calculated in units of blocks, so the block mask needs to be marked. Among them, block is the smallest erase unit of flash memory, and each block includes multiple data frames. Data frame is the smallest data unit of SSD. Usually, each address corresponds to a data frame. If the sector size is 512, SSD will automatically put it into a data frame.
[0098] After obtaining the physical address in the first discard request, the mask calculator determines the first target data block according to the data block mask in the register and the obtained physical address.
[0099] Specifically, an AND operation is performed on the data block mask and the physical address to obtain the first target data block.
[0100] The valid data frame processor 205 is used to receive the first target data block, determine the third destination address based on the start address of the valid data frame processing table and the first target data block, and reduce the valid data frame quantity value of the data block corresponding to the third destination address.
[0101] Among them, the starting address (base address of the vdfc table) of the valid data frame processing table (vdfc table) exists in the address mapping table manager in the form of a register. When the address mapping table is enabled, the starting address of the valid data frame processing table (vdfc table), that is, the starting address of the vdfc table in the memory, needs to be configured in advance.
[0102] The starting address of the valid data frame processing table and the first target data block are added to obtain a third destination address, and a reduction operation is performed on the valid data frame quantity value of the data block corresponding to the third destination address. The reduction operation is a subtraction operation.
[0103] It can be understood that the register corresponding to the start address of the valid data frame processing table is used to calculate which address needs to be dec (minus 1) operated on according to the start address of the valid data frame processing table and the specific block offset.
[0104] It should be noted that after determining the hot zone and the cold zone, in order to achieve wear leveling of the data blocks of the solid state drive, garbage collection (free block, referred to as GC) is performed when there are fewer free blocks, that is, when the number of free blocks is lower than a preset number threshold, garbage collection is performed. Specifically, a full data block (used block) whose vdfc is lower than a preset vdfc threshold is obtained for recycling.
[0105] When the difference in the number of erases (Program / Erase, abbreviated as: pe) between any data block and another data block exceeds a first difference threshold, garbage collection is performed. Specifically, data blocks whose erase times are lower than the preset erase times threshold are obtained for recycling, that is, data blocks with lower pe values are obtained for recycling. It should be noted that all blocks must record the amount of data written to the entire SSD when they are written, in units of one block, that is, when the block is written, how many blocks of data are written to the entire disk, including GC data. This data restriction ensures that each block will not be recycled again in a short period of time after being recycled. Specifically, when the difference in the number of erases (Program / Erase, abbreviated as: pe) between any data block and another data block exceeds a first difference threshold, for any block, if the number of erases of the block is lower than a preset threshold of the number of erases, it is determined whether the difference between the amount of data written to the entire SSD when the block record itself is written and the life of the current SSD exceeds a second difference threshold. If the difference between the amount of data written to the entire SSD when the block record itself is written and the life of the current SSD exceeds the second difference threshold, it is determined that the block is to be recycled. If the difference between the amount of data written to the entire SSD when the block record itself is written and the life of the current SSD does not exceed the second difference threshold, it is determined that the block is not to be recycled.
[0106] Among them, the preset quantity threshold, the preset vdfc threshold, the first difference threshold, the second difference threshold and the preset erasure times threshold are set by technical personnel.
[0107] If the recovered data block is a data block in a hot zone, a free data block with the lowest PE value is screened out, and the data in the recovered data block is written into the free data block with the lowest PE value.
[0108] If the recovered data block is a data block in a cold zone, the free data block with the highest PE value is selected, and the data in the recovered data block is written into the free data block with the highest PE value.
[0109] The address mapping table manager provided in this embodiment can accurately determine the source of the table modification command by checking whether the comparison address is a preset value, thereby achieving the accuracy of modifying the address mapping table.
[0110] The address mapping table manager provided in this embodiment generates a first discard request when the original physical address fails to match the comparison address, thereby ensuring the accuracy of the table modification and the security of the data. When the table modification processor sends a discard request, the mask calculator and the valid data frame processor are used to reduce the number of valid data frames of the data block, effectively recovering invalid data frames, optimizing resource utilization, and avoiding memory waste.
[0111] In some optional embodiments, the table modification processor 201 is also used to determine the type of the original physical address based on the original physical address and the memory mask after writing the physical address into the address mapping table. When the type of the original physical address is a flash memory physical address, a second discard request is generated based on the original physical address, and the second discard request is sent to the mask calculator.
[0112] The memory mask exists in the form of a register in the address mapping table manager. When a write command is issued, the data needs to be moved from the host to the memory. At this time, the physical address needs to be changed to the memory physical address, and then changed to the NAND physical address after the data is written to the NAND. Therefore, the user needs to set the memory mask so that the address mapping manager can determine whether the physical address is a memory physical address or a NAND physical address through the memory mask, and then determine how to operate the vdfc table.
[0113] After the physical address of the table change command is written into the address mapping table, based on the original physical address corresponding to the logical address of the table change command and the memory mask, it is determined whether the original physical address is a flash memory physical address (NAND physical address) or a memory physical address. Specifically, an AND operation is performed on the original physical address and the memory mask to obtain an operation result. If the operation result is all 1, the original physical address is determined to be a memory physical address. If the operation result is not all 1, the original physical address is determined to be a NAND physical address.
[0114] It should be noted that after the table is modified, the original physical address is a NAND physical address, which is generally GC data or data to be modified in the memory. It is necessary to perform a vdfc subtraction operation on the block corresponding to the original physical address in the address mapping table. Among them, the memory mentioned in this embodiment is generally a double data rate (DDR, abbreviated as: DDR) memory.
[0115] The mask calculator 204 is further configured to receive a second discard request, obtain an original physical address in the second discard request, determine a second target data block based on the data block mask and the original physical address, and send the second target data block to the valid data frame processor.
[0116] The mask calculator obtains the original physical address in the second discard request, performs an AND operation on the original physical address and the data block mask, obtains the second target data block, and sends the second target data block to the valid data frame processor.
[0117] The valid data frame processor 205 is used to receive the second target data block, determine the fourth destination address based on the start address of the valid data frame processing table and the second target data block, and reduce the valid data frame quantity value of the data block corresponding to the fourth destination address.
[0118] The valid data frame processor adds the start address of the valid data frame processing table to the second target data block to determine a fourth destination address, and performs a subtraction operation on the valid data frame quantity value of the data block corresponding to the fourth destination address.
[0119] The address mapping table manager provided in this embodiment processes the second discard request through the mask calculator and the valid data frame processor, determines the second target data block through the data block mask and the original physical address, and reduces the valid data frame quantity value of the corresponding data block, effectively reclaims the flash memory data blocks that are no longer used, optimizes the management of storage resources, and avoids resource waste.
[0120] In some optional implementations, the thermal manager 203 is specifically used to:
[0121] Based on the order of the heat of each partition from high to low, the partitions are sorted to obtain the sorting results.
[0122] Based on the sorting results, the heat difference between adjacent partitions is determined.
[0123] When the heat difference is greater than the average heat difference, the two partitions corresponding to the heat difference are determined as the target partition combination.
[0124] Based on the target partition combination, determine the hot and cold partitions.
[0125] For any partition, if the ranking of the partition is higher than the ranking of the hot and cold partitions, the partition is determined to be a hot zone.
[0126] In the case where the ranking of the partition is not higher than the ranking of the hot and cold partitions, the partition is determined to be a cold partition.
[0127] After obtaining the sorting results of multiple partitions, the heat difference between every two adjacent sorted partitions is determined. For example, if there are ten partitions, the heat difference between every two adjacent sorted partitions is obtained, that is, nine heat differences are obtained.
[0128] In the case where any heat difference is greater than the average heat difference, the two partitions corresponding to the heat difference are determined as the target partition combination. For example, if the heat difference between the third-ranked partition and the fourth-ranked partition is greater than the average heat difference, the third-ranked partition and the fourth-ranked partition are determined as the target partition combination.
[0129] The address mapping table manager provided in this embodiment determines the heat difference between adjacent partitions based on the sorting result, and determines the target partition combination when the heat difference is greater than the average heat difference, thereby accurately dividing the cold zone and the hot zone. When the system recovers data blocks, it can recover the data of the data blocks in the hot zone to the data blocks with a lower erase count, and recover the data of the data blocks in the cold zone to the data blocks with a higher erase count according to the heat of different areas, thereby achieving wear balancing of the data blocks of the solid-state drive.
[0130] In some optional implementations, the thermal manager 203 is further configured to:
[0131] The average heat difference is determined by the following formula:
[0132] (heat_max–heat_min) / (column_num–1)
[0133] Among them, heat_max is the heat of the highest ranked partition, heat_min is the heat of the lowest ranked partition, and column_num is the total number of partitions.
[0134] The address mapping table manager provided in this embodiment determines the average heat difference, determines the target partition combination when the heat difference is greater than the average heat difference, and then accurately divides the cold area and the hot area through the target partition combination. When the system recovers data blocks, it can recover the data of the data blocks in the hot area to the data blocks with a lower erase count, and recover the data of the data blocks in the cold area to the data blocks with a higher erase count according to the heat of different areas, thereby realizing wear balancing of the data blocks of the solid-state drive.
[0135] In some optional implementations, the thermal manager 203 is specifically used to:
[0136] Sort the target partition combinations based on their popularity from high to low.
[0137] The target partition combination to be determined that is in the middle position is selected from the sorted results of the target partition combinations.
[0138] The target partition with the lowest ranking in the pending target partition combination is determined as the cold-hot partition.
[0139] It should be noted that if the number of target partition combinations is an odd number, the target partition combination located in the middle position in the sorting result is determined as the pending target partition combination.
[0140] If the number of target partition combinations is even, a pending target partition combination is randomly selected from the two target partition combinations in the middle of the sorting results.
[0141] Alternatively, when the number of target partition combinations is an even number, two target partition combinations in the middle are screened out from the sorting results of the target partition combinations, and the target partition combination with lower popularity among the two target partition combinations in the middle is determined as the pending target partition combination.
[0142] Alternatively, when the number of target partition combinations is an even number, two target partition combinations in the middle are screened out from the sorting results of the target partition combinations, and the target partition combination with higher popularity among the two target partition combinations in the middle is determined as the pending target partition combination.
[0143] The address mapping table manager provided in this embodiment selects the pending target partition combination located in the middle position from the sorting results of the target partition combination, and determines the target partition with the lowest sorting in the pending target partition combination as the cold and hot partition area, so that the thermal manager can determine the cold and hot partition areas more accurately, thereby achieving the accuracy of the determined cold and hot areas.
[0144] In some optional implementations, the thermal manager 203 is specifically used to:
[0145] Based on the number of partitions, a threshold value for the number of partitions is determined.
[0146] Exemplarily, 25% of the number of partitions is the threshold value of the number of partitions.
[0147] It is understandable that the above is merely an exemplary description, and the user may determine the threshold value of the number of partitions based on the number of partitions according to actual needs.
[0148] For any partition, when the sorting result is in the front quantity threshold position, the partition is determined to be a hot zone.
[0149] When the sorting result is not located at the front quantity threshold, the partition is determined to be a cold zone.
[0150] The address mapping table manager provided in this embodiment determines the threshold value of the number of partitions according to the number of partitions, and further determines the hot zone and the cold zone, which has high flexibility.
[0151] According to an embodiment of the present invention, an embodiment of an address mapping table management method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0152] In this embodiment, a method for managing an address mapping table is provided, which can be used for the address mapping table manager shown in the above embodiment. Figure 3is a flow chart of an address mapping table management method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0153] Step S301, based on the table change processor, receiving the table change command, obtaining the comparison address and the logical address in the table change command, determining the source of the table change command based on the comparison address, and sending the logical address to the offset calculator when the source of the table change command is the host.
[0154] Step S302: Based on the offset calculator, a logical address is received, a target partition is determined based on the logical address and a preset partition granularity, and the target partition is sent to the thermal manager.
[0155] Step S303, based on the thermal manager, receive the target partition, determine the first destination address based on the target partition and the starting address of the thermal histogram, increase the corresponding partition heat of the thermal histogram based on the first destination address, obtain the heat of each partition in the thermal histogram at every preset time period, and determine the hot zone and the cold zone based on the heat of each partition.
[0156] The further description of each of the above steps is the same as that of the above corresponding embodiments and will not be repeated here.
[0157] The address mapping table management method provided in this embodiment expands the address mapping table manager in the related technology. When the address mapping table is modified by using the table modification processor, if the source of the table modification command is the host, the heat statistics of the address and the hot and cold management of the data are realized through the offset calculator and the thermal manager, thereby reducing the computing power and power consumption of the processor core.
[0158] In this embodiment, a method for managing an address mapping table is provided. Figure 4 is a flow chart of an address mapping table management method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0159] The first step is to receive the table modification command.
[0160] The second step is to determine whether the source of the table modification command is the host according to the table modification command.
[0161] The third step is to modify the table when the source of the table modification command is the host.
[0162] It is understandable that commands from the host are all used to modify the table directly, while the table modifications of gc and nand need to be compared. The comparison address of nand is the memory address, while the comparison address of gc is the nand address where the recovered data block is located.
[0163] It should be noted that when the source of the table modification command is the host, it is also necessary to perform partition heat statistics and data hot and cold management. For details, please refer to the corresponding description of the aforementioned embodiment, which is not shown in the figure and will not be repeated here.
[0164] When the source of the table modification command is not the host, determine whether it is a hit.
[0165] The determination of whether there is a hit is to determine whether the original physical address and the comparison address are compared successfully.
[0166] In the case of a hit, the table is modified. That is, in the case where the comparison result is that the comparison passes, the physical address is written into the address mapping table based on the second destination address.
[0167] In the case of a miss, the destination address is discarded. That is, in the case where the comparison result is that the comparison fails, a first discard request is generated based on the physical address, and the first discard request is sent to the mask calculator, the mask calculator is used to receive the first discard request, obtain the physical address in the first discard request, determine the first target data block based on the data block mask and the physical address, and send the first target data block to the valid data frame processor; the valid data frame processor is used to receive the first target data block, determine the third destination address based on the starting address of the valid data frame processing table and the first target data block, and reduce the valid data frame quantity value of the data block corresponding to the third destination address.
[0168] The fourth step is to determine whether the original address is nand after the table modification is completed. Determining whether the original address is nand means determining whether the type of the original physical address is a flash memory physical address.
[0169] In the case where the original address is nand, the original address is discarded. Corresponding to the above, in the case where the type of the original physical address is a flash memory physical address, a second discard request is generated based on the original physical address, and the second discard request is sent to the mask calculator; the mask calculator is also used to receive the second discard request, obtain the original physical address in the second discard request, determine the second target data block based on the data block mask and the original physical address, and send the second target data block to the valid data frame processor; the valid data frame processor is used to receive the second target data block, determine the fourth destination address based on the starting address of the valid data frame processing table and the second target data block, and reduce the valid data frame quantity value of the data block corresponding to the fourth destination address.
[0170] If the original address is not nand, no processing is done. Generally, when GC reaches this step, the original address is usually nand, and an original address abandonment process needs to be initiated.
[0171] For the detailed description of the above steps, please refer to the corresponding description of the above embodiments, which will not be repeated here.
[0172] The address mapping table management method provided in this embodiment replaces the CPU's table modification work through hardware integration of frequent and relatively fixed operations, and maintains order within the device without locking, which can effectively reduce latency and CPU pressure, while reducing the power consumption of the entire disk. The hot and cold degrees of automatic statistical data can also effectively reduce write amplification and PE difference, thereby better achieving wear leveling.
[0173] The embodiment of the present invention also provides a computer device, see Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 501, memory 502, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 501 is taken as an example.
[0174] The processor 501 may be a central processing unit, a network processor or a combination thereof. The processor 501 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0175] The memory 502 stores instructions executable by at least one processor 501 , so that the at least one processor 501 executes the method shown in the above embodiment.
[0176] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0177] The memory 502 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 502 may also include a combination of the above types of memory.
[0178] The computer device also includes a communication interface 503, which is used for the computer device to communicate with other devices or a communication network.
[0179] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0180] A part of the present invention 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 the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the 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 may be any available computer-readable storage medium or communication medium accessible to the computer.
[0181] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. An address mapping table manager, characterized in that: The address mapping table manager comprises: a table change processor, configured to receive a table change command, obtain a comparison address and a logic address in the table change command, determine a source of the table change command based on the comparison address, and send the logic address to an offset calculator when the source of the table change command is a host; An offset calculator, configured to receive the logical address, determine a target partition based on the logical address and a preset partition granularity, and send the target partition to a thermal manager; A thermal manager is used to receive the target partition, determine a first destination address based on the target partition and the starting address of the thermal histogram, increase the corresponding partition temperature of the thermal histogram based on the first destination address, obtain the temperature of each partition in the thermal histogram at every preset time period, and determine hot zones and cold zones based on the temperature of each partition.
2. The address mapping table manager according to claim 1, characterized in that: The table modification processor is specifically used for: When the comparison address is a preset value, determining that the source of the table modification command is a host; When the comparison address is not a preset value, it is determined that the source of the table modification command is not a host.
3. The address mapping table manager according to claim 1, characterized in that: The address mapping table manager also includes a mask calculator and a valid data frame processor; The table change processor is further configured to obtain a physical address in the table change command, determine a second destination address based on a start address of the address mapping table and the logical address when the source of the table change command is a host, and write the physical address into the address mapping table based on the second destination address; The table change processor is further configured to, when the source of the table change command is not the host, obtain the original physical address corresponding to the logical address from the address mapping table based on the second destination address, compare the original physical address with the comparison address to obtain a comparison result, and when the comparison result is that the comparison passes, write the physical address into the address mapping table based on the second destination address, and when the comparison result is that the comparison fails, generate a first discard request based on the physical address, and send the first discard request to the mask calculator; The mask calculator is used to receive the first discard request, obtain the physical address in the first discard request, determine the first target data block based on the data block mask and the physical address, and send the first target data block to the valid data frame processor; The valid data frame processor is used to receive the first target data block, determine a third destination address based on the starting address of the valid data frame processing table and the first target data block, and reduce the valid data frame quantity value of the data block corresponding to the third destination address.
4. The address mapping table manager according to claim 3, characterized in that: The table modification processor is further used to determine the type of the original physical address based on the original physical address and the memory mask after writing the physical address into the address mapping table, and if the type of the original physical address is a flash memory physical address, generate a second discard request based on the original physical address, and send the second discard request to the mask calculator; The mask calculator is further used to receive the second discard request, obtain the original physical address in the second discard request, determine the second target data block based on the data block mask and the original physical address, and send the second target data block to the valid data frame processor; The valid data frame processor is used to receive the second target data block, determine a fourth destination address based on the starting address of the valid data frame processing table and the second target data block, and reduce the valid data frame quantity value of the data block corresponding to the fourth destination address.
5. The address mapping table manager according to claim 1, characterized in that: The thermal manager is specifically used for: Sorting the partitions based on the order of heat of each partition from high to low to obtain a sorting result; Based on the sorting result, determining the heat difference between adjacent sorted partitions; When the heat difference is greater than the average heat difference, determining the two partitions corresponding to the heat difference as the target partition combination; Based on the target partition combination, determining the hot and cold partition areas; For any partition, if the ranking of the partition is higher than the ranking of the hot and cold partitions, determine the partition as a hot zone; In the case where the ranking of the partition is not higher than the ranking of the cold and hot partitions, the partition is determined to be a cold zone.
6. The address mapping table manager according to claim 5, characterized in that: The thermal manager is also used to: The heat average difference is determined by the following formula: (heat_max–heat_min) / (column_num–1) Among them, heat_max is the heat of the highest ranked partition, heat_min is the heat of the lowest ranked partition, and column_num is the total number of partitions.
7. The address mapping table manager according to claim 5, characterized in that: The thermal manager is specifically used for: Sorting the target partition combinations based on the order of the heat of the target partition combinations from high to low; Filter out a target partition combination to be determined that is located in the middle position from the sorting results of the target partition combinations; The target partition with the lowest ranking in the pending target partition combination is determined as the cold and hot partition area.
8. A method for managing an address mapping table, characterized in that: The address mapping table manager applied to any one of claims 1 to 7, the method comprising: Based on the table change processor, receiving the table change command, obtaining the comparison address and the logical address in the table change command, determining the source of the table change command based on the comparison address, and sending the logical address to the offset calculator when the source of the table change command is the host; Based on the offset calculator, receiving the logical address, determining the target partition based on the logical address and a preset partition granularity, and sending the target partition to the thermal manager; Based on the thermal manager, the target partition is received, and based on the target partition and the starting address of the thermal histogram, a first destination address is determined. Based on the first destination address, the corresponding partition heat of the thermal histogram is increased, and the heat of each partition in the thermal histogram is obtained at every preset time period. Based on the heat of each partition, the hot zone and the cold zone are determined.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the address mapping table management method described in claim 8 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the address mapping table management method described in claim 8.
Citation Information
Patent Citations
Flash memory and method and system for automatically separating cold and hot data based on same
CN102902628A
Method and system for using solid-state disk as cache of computer
CN103678166A
System for monitoring and managing datacenters
CN107667505A
Memory system and method of controlling temperature thereof
CN111857567A
Address mapping table management device, method and system and computer storage medium
CN111984547A