Mapping segment management method and device, electronic equipment and storage medium

By dynamically partitioning and storing L2P mapping tables on cold and hot caches, the problems of poor write performance and high latency caused by large mapping table capacity are solved, thereby improving the write performance of solid-state drives and the lifespan of flash memory.

CN121070809APending Publication Date: 2025-12-05SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511220089.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

In existing technologies, the large capacity of L2P mapping tables leads to long random write times, high latency, and poor write performance.

Method used

By dynamically partitioning and storing the L2P mapping table on the cold and hot caches according to hot and cold data, the update efficiency of the mapping table is improved, the writing of invalid data is reduced, the power-on rebuild time is shortened, and the performance and lifespan of the SSD are improved.

Benefits of technology

By using hot and cold cache partitioning for storage, the write performance of solid-state drives is improved, write latency is reduced, and the lifespan of flash memory is extended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070809A_ABST
    Figure CN121070809A_ABST
Patent Text Reader

Abstract

The invention discloses a mapping segment management method and device, electronic equipment and a storage medium, and relates to the technical field of storage. The method comprises the following steps: acquiring the total access times of a plurality of mapping segments included in a mapping table corresponding to the solid state disk in a current period, the first access times of a first mapping segment, and a first mapping temperature corresponding to the first mapping segment in a previous period; determining a second mapping temperature of the first mapping section in the current period according to the first mapping temperature, the first access times and the total access times; according to the second mapping temperature, the preset mapping temperature and the cache region where the first mapping section is located currently, whether cache region migration operation is conducted on the first mapping section or not is determined, and the cache region migration operation comprises migration from the hot cache region to the cold cache region or migration from the cold cache region to the hot cache region. According to the embodiment of the invention, the problems of long time consumption and high delay of random writing and poor writing performance of the solid state disk caused by large capacity of a mapping table from a logic address to a physical address are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, and in particular to a mapping segment management method and device, electronic equipment and a storage medium. BACKGROUND

[0002] A solid state disk based on flash memory (NAND) implements conversion from a logical address to a physical address through a logical-to-physical (L2P) mapping table. In the running process of the solid state disk, the L2P mapping table has a very large capacity, about one thousandth of the capacity of the disk, and is therefore usually stored in a dynamic random access memory (DRAM), which supports efficient read and write operations of the solid state disk. However, since the DRAM is a volatile memory, data in the DRAM will be lost when the solid state disk is powered off. Therefore, the solid state disk needs to regularly flush the L2P mapping table to the flash memory to prevent data loss.

[0003] In the related art, the L2P mapping table can only be stored on the DRAM, but since the DRAM has a slow response speed and the L2P mapping table has a large capacity, it leads to long time consumption, high delay of random writing, and poor write performance of the solid state disk. SUMMARY

[0004] The present application provides a mapping segment management method and device, electronic equipment and a storage medium to at least solve the problem of large capacity of the logical-to-physical address mapping table in the related art, which leads to long time consumption, high delay of random writing, and poor write performance of the solid state disk.

[0005] The present application provides a mapping segment management method, which comprises: obtaining a total access frequency of a plurality of mapping segments included in a mapping table corresponding to a solid state disk in a current period, a first access frequency of a first mapping segment, and a first mapping temperature corresponding to the first mapping segment in a previous period, wherein the mapping temperature is used to indicate the frequency of access in the mapping segment corresponding to the mapping temperature, and the first mapping segment is any one of the plurality of mapping segments; determining a second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency and the total access frequency; and determining whether to perform a cache area migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature, and a cache area currently occupied by the first mapping segment, wherein the cache area migration operation comprises migration from a hot cache area to a cold cache area, or migration from a cold cache area to a hot cache area.

[0006] The application further provides a management device of a mapping segment, the device comprising: an acquisition module, configured to acquire a total access frequency of a plurality of mapping segments included in a mapping table corresponding to a solid state disk in a current period, a first access frequency of a first mapping segment, and a first mapping temperature corresponding to the first mapping segment in a previous period, wherein the mapping temperature is used to indicate a frequency of access in the mapping segment corresponding to the mapping temperature, and the first mapping segment is any one of the plurality of mapping segments; a processing module, configured to determine a second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency, and the total access frequency; and determine whether to perform a cache area migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature, and a cache area in which the first mapping segment currently locates, wherein the cache area migration operation comprises migration from a hot cache area to a cold cache area, or migration from the cold cache area to the hot cache area.

[0007] The application further provides an electronic device, comprising: a memory, configured to store a computer program; and a processor, configured to execute the computer program to implement the steps of any one of the management methods of the mapping segment.

[0008] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any one of the management methods of the mapping segment.

[0009] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any one of the management methods of the mapping segment.

[0010] According to the application, the mapping segment can be stored in the cold cache area (DRAM) or the hot cache area (SRAM), the response speed of the hot cache area is faster than that of the cold cache area, and therefore, by distinguishing the cold cache area and the hot cache area, when the hot mapping segment corresponding to the hot data is migrated from the cold cache area to the hot cache area, the response speed of the hot data can be effectively improved, the delay is shortened, and the write performance of the solid state disk is improved.

[0011] In addition, when the solid state disk is powered off, the new mapping entries and the corresponding mapping segments in the cold cache area which are not written are written to the flash memory, and all the mapping segments in the hot cache area are written to the flash memory. In this way, the hot mapping segment in the hot cache area is only stored when the solid state disk is powered off, and the new mapping entries generated in the running process of the solid state disk are no longer written to the flash memory, so that the data amount of the L2P mapping table written to the flash memory is greatly reduced, the occupation of the write bandwidth is reduced, the repeated writing of data is reduced, and the storage efficiency of the L2P mapping table is improved. In addition, the writing frequency of the mapping segment in the cold cache area is reduced, the write amplification effect is effectively reduced, and the service life of the flash memory is prolonged. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0013] Figure 1 A topology diagram of a mapping segment management system provided by the embodiments of the present application;

[0014] Figure 2 A flowchart of a mapping segment management method provided by the embodiments of the present application;

[0015] Figure 3 A flowchart of another mapping segment management method provided by the embodiments of the present application;

[0016] Figure 4 A device structure block diagram of a mapping segment management device provided by the embodiments of the present application;

[0017] Figure 5 A hardware structure diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the protection scope of the present application.

[0019] It should be noted that, in the description of the present application, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0020] In order to make the technical personnel in the technical field better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0021] The embodiments of the present application are applied to the scene of storing and managing each mapping segment in the L2P mapping table of a solid state disk and each mapping entry included in each mapping segment.

[0022] When a host issues a read / write request to a solid state drive (SSD) and triggers an L2P mapping table update, to-be-updated data (i.e., incremental data) is generated, and the L2P mapping table of the DRAM is updated. In order to ensure the accuracy and integrity of the L2P mapping table, when the to-be-updated data needs to meet certain conditions, the SSD will flush a part of the L2P mapping table in the DRAM to the flash memory together with the incremental data.

[0023] In the related art, the capacity of the L2P mapping table is very large, and the update and saving of the mapping table cannot be in the form of whole saving, so the mapping table is divided into several mapping segments, and is saved to the flash memory in the form of increment + mapping segment. The L2P mapping table can only be stored on the DRAM, which causes long time consumption of random writing. When hot data is updated with high frequency, the hot data causes the number of L2P mapping table writing to increase sharply due to frequent updating of L2P entries, occupies more bandwidth, and affects the writing performance. All mapping segments are flushed without distinction, and hot data with high frequency access and cold data with low frequency access cannot be distinguished. This leads to frequent flushing of cold data, occupies bandwidth and storage resources, and increases invalid operations during reconstruction. Cold data is repeatedly flushed to NAND, which aggravates the write amplification effect and reduces the service life of the SSD. Redundant updating of incremental data causes all incremental segments to be processed in chronological order when powered on, which affects the power-on performance, even if the mapping segment corresponding to some incremental segment has not been updated for a long time (cold data).

[0024] In order to solve the above technical problems, the embodiment of the present application provides a mapping segment management method, which improves the updating efficiency of the mapping table and reduces the influence on the writing performance by dynamically partitioning the L2P mapping table according to cold and hot data and storing it on the cold cache area and the hot cache area. In addition, the cold and hot partition is flushed to the NAND at different frequencies to reduce the flushing of invalid data, shorten the power-on reconstruction time, improve the SSD boot speed and reliability, and improve the SSD performance and service life.

[0025] The present application provides a mapping segment management system, as shown in Figure 1 Figure 1 The present application provides a mapping segment management system, as shown in

[0026] The mapping segment management device 101 can be a storage controller of a solid state drive.

[0027] The dynamic random access memory (DRAM) 102 is a cold cache area.

[0028] ​A static random-access memory (SRAM) 103, which is a hot cache area.

[0029] The response speed of the hot cache area is faster than that of the cold cache area. For example, the update time of a mapping entry on the cold cache area is 200 ms, and the update time on the hot cache area is 15 ms. When the hot data is updated with high frequency access, the update efficiency on the hot cache area is 13 times that on the cold cache area.

[0030] A flash memory 104, which can be the core long-term storage medium of a solid state disk, stores user actual data and persistent storage metadata backup (to prevent loss due to power failure of DRAM).

[0031] Figure 1 The mapping segment management system 100 shown is only used for example and is not intended to limit the technical solutions of the present application. Those skilled in the art should understand that, in the specific implementation process, the mapping segment management system 100 can also include other devices, which are not limited.

[0032] The embodiment of the present application provides a mapping segment management method, which is applied to Figure 1 The mapping segment management device shown is, for example, Figure 2 As shown, Figure 2 A flowchart of a mapping segment management method provided by the embodiment of the present application is shown, and the mapping segment management method includes the following steps:

[0033] S201, obtaining the total access times of a plurality of mapping segments included in a mapping table corresponding to a solid state disk in a current period, the first access times of a first mapping segment, and the first mapping temperature corresponding to the first mapping segment in a previous period.

[0034] The first mapping segment is any one of the plurality of mapping segments. Each mapping segment includes a plurality of mapping entries.

[0035] The period length of each period in the current period and the previous period can be set according to actual needs, which is not limited. For example, the period length of each period can be 5 seconds.

[0036] The mapping temperature is used to indicate the frequency of access in the mapping segment corresponding to the mapping temperature. The mapping temperature is positively correlated with the frequency of access of the mapping segment. The mapping temperature is used to mark the cold and hot of each mapping segment in the L2P mapping table. The mapping temperature is denoted as TEMP_TB.

[0037] S202, determining the second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access times and the total access times.

[0038] In an example, the second mapping temperature can be represented by the following expression:

[0039]

[0040] wherein T is the second mapping temperature; T0 is the first mapping temperature; C is the first access frequency; M is the total access frequency; a is a first preset weight corresponding to the mapping temperature; and b is a second preset weight corresponding to the access frequency.

[0041] It can be understood that the greater the first preset weight, the stronger the influence of the first mapping temperature (historical temperature) on the second mapping temperature; the greater the second preset weight, the stronger the influence of the access frequency on the second mapping temperature. By calculating the "access frequency of a single mapping segment" and the "total access frequency of all mapping segments", the "access frequency proportion" of the mapping segment is obtained, avoiding calculation deviation caused by total access amount difference (such as different total access frequencies in different periods). In addition, the weight of the first mapping temperature and the access frequency can be balanced through the ratio of the first preset weight and the second preset weight. For example, if more attention is paid to recent access behavior, the second preset weight can be set to be greater than the first preset weight; if the historical temperature is more stable (to avoid short-term fluctuations), the first preset weight can be set to be greater than the second preset weight.

[0042] S203, determining whether to perform a cache zone migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature, and a cache zone in which the first mapping segment is currently located.

[0043] The cache zone migration operation includes migration from the hot cache zone to the cold cache zone, or migration from the cold cache zone to the hot cache zone.

[0044] The hot cache zone stores hot mapping segments. The hot mapping segments stored in the hot cache zone have a higher access frequency than the mapping segments stored in the cold cache zone.

[0045] The preset mapping temperature can be set according to actual needs, and is not limited.

[0046] In some optional embodiments, when the second mapping temperature is greater than the preset mapping temperature, the mapping segment management device marks the type of the first mapping segment as a hot mapping segment, and determines whether the cache zone in which the first mapping segment is currently located is a hot cache zone; when it is determined that the cache zone in which the first mapping segment is currently located is a hot cache zone, the cache zone migration operation is not performed.

[0047] In another example, when it is determined that the cache zone in which the first mapping segment is currently located is a cold cache zone, the mapping segment management device obtains the remaining storage resources of the hot cache zone at the current time; when the remaining storage resources are greater than or equal to the storage resources corresponding to the first mapping segment, it is determined to migrate the first mapping segment from the cold cache zone to the hot cache zone.

[0048] It can be understood that when the cache area where the first mapping segment is located is the cold cache area, it is necessary to detect whether the hot cache area has sufficient remaining storage resources to store the first mapping segment at the current time. When the remaining storage resources are greater than or equal to the storage resources required by the first mapping segment, the first mapping segment can be migrated from the cold cache area to the hot cache area.

[0049] In another example, when the remaining storage resources are less than the storage resources corresponding to the first mapping segment, the mapping segment management device detects all hot mapping segments existing in the cold cache area at the current time, and obtains the mapping temperatures corresponding to all hot mapping segments stored in the cold cache area at the current time and all hot mapping segments stored in the hot cache area, respectively, and the maximum storage number of mapping segments corresponding to the hot cache area; at least one hot mapping segment stored in the cold cache area at the current time, the mapping temperatures corresponding to all hot mapping segments stored in the hot cache area, and the second mapping temperature are sorted in descending order of temperature to obtain a target-ordered mapping temperature mapping segment sequence.

[0050] Among them, the maximum storage number corresponding to the hot cache area is R.

[0051] The mapping segment management device manages the first mapping segment based on the target-ordered mapping temperature mapping segment sequence, and specifically includes the following cases:

[0052] Case 1: If the first mapping segment is one of the first R mapping segments in the mapping temperature mapping segment sequence, the mapping segment management device migrates the first mapping segment to the hot cache area.

[0053] Case 2: If the first mapping segment is one of the mapping segments other than the first R mapping segments in the mapping temperature mapping segment sequence, the first mapping segment remains in the cold cache area.

[0054] It can be understood that for the other mapping segments in the target-ordered mapping temperature mapping segment sequence except the first mapping segment, if a mapping segment is ranked outside the Rth position, and the mapping segment is in the cold cache area, it remains unchanged; if a mapping segment is ranked outside the Rth position, and the mapping segment is in the hot cache area, the mapping segment is migrated to the cold cache area; if a mapping segment is ranked in the first R positions, and the mapping segment is in the hot cache area, it remains unchanged; if a mapping segment is ranked in the first R positions, and the mapping segment is in the cold cache area, the mapping segment is migrated to the hot cache area.

[0055] Optionally, when the management device of the mapping segment determines that the type of the first mapping segment is a hot mapping segment, and determines that the cache area where the first mapping segment is currently located is a cold cache area, and the remaining storage resources of the hot cache area at the current time are greater than or equal to the storage resources required by the first mapping segment, it detects whether there are multiple hot mapping segments in the cold cache area besides the first mapping segment; if it detects that there are multiple hot mapping segments in the cold cache area besides the first mapping segment, it obtains the mapping temperature corresponding to each of the multiple hot mapping segments; it selects the mapping segment corresponding to the maximum mapping temperature from the second mapping temperature and the mapping temperature corresponding to each of the multiple hot mapping segments as the target mapping segment, and migrates the target mapping segment to the hot cache area.

[0056] Understandably, by selecting the target segment with the highest mapping temperature from "the first mapping segment and other hot mapping segments in the cold buffer" for migration, it is ensured that the hot buffer prioritizes storing the mapping segment with the highest current popularity and the highest probability of being accessed.

[0057] based on Figure 2 The method shown allows the mapping segment management device to obtain the total number of accesses to multiple mapping segments included in the mapping table of the solid-state drive in the current period, the first number of accesses to the first mapping segment, and the first mapping temperature corresponding to the first mapping segment in the previous period; based on the first mapping temperature, the first number of accesses, and the total number of accesses, determine the second mapping temperature of the first mapping segment in the current period; and based on the second mapping temperature, the preset mapping temperature, and the cache area where the first mapping segment is currently located, determine whether to perform a cache area migration operation on the first mapping segment.

[0058] Since the mapped segment can be stored in the cold cache (DRAM) or the hot cache (SRAM), and the hot cache has a faster response speed than the cold cache, by distinguishing between cold and hot caches, when the hot mapped segment corresponding to hot data is migrated from the cold cache to the hot cache, the response speed of hot data can be effectively improved, the latency can be shortened, and the write performance of the solid-state drive can be improved.

[0059] Furthermore, during the operation of a solid-state drive, such as Figure 3 As shown, Figure 3 A flowchart illustrating another method for managing mapping segments provided in this application embodiment; Figure 3 In the process, the management device for the mapping segment can also perform the following steps:

[0060] S301, during the operation of the solid-state drive, when it receives a write request sent to the solid-state drive by the host, obtains a new mapping entry and updates the mapping table with the new mapping entry.

[0061] It can be understood that if the write request corresponds to a logical address with an old mapping (original mapping entry), the entry is updated to a new mapping entry pointing to a new physical address; if the write request corresponds to a new address (no old mapping), a new mapping entry is directly created in the mapping table.

[0062] S302, if the second mapping segment to which the new mapping entry belongs is stored in the cold cache area, the new mapping entry is stored in the incremental cache area in the cold cache area.

[0063] Among them, the incremental cache area is used to store a plurality of updated mapping entries in the current period.

[0064] Optionally, if the second mapping segment to which the new mapping entry belongs is stored in the hot cache area, the new mapping entry can be updated to the L2P mapping table.

[0065] S303, when the number of mapping entries stored in the incremental cache area is equal to the preset number, the mapping entries stored in the incremental cache area are written into the flash memory, and the incremental cache area is emptied.

[0066] Among them, the preset number can be set according to actual needs, and is not limited. For example, the preset number can be 1000.

[0067] Optionally, when the mapping entries stored in the incremental cache area are written into the flash memory, one of the mapping segments stored in the cold cache area can also be selected in sequence and written into the flash memory.

[0068] It can be understood that the incremental cache area is emptied to facilitate subsequent storage of updated mapping entries in the next period. When the number of mapping entries stored in the incremental cache area reaches a certain number, the incremental cache area and a mapping segment are written to the flash memory, wherein the mapping segment is stored in the flash memory in sequence in turn.

[0069] In some optional embodiments, when the solid state disk is powered off, the mapping entries stored in the incremental cache area are written into the flash memory, one of the mapping segments stored in the cold cache area is selected in sequence and written into the flash memory, and all the mapping segments stored in the hot cache area are written into the flash memory.

[0070] It can be understood that when the solid state disk is powered off, the new mapping entries and the corresponding mapping segments in the cold cache area which are not written are flushed to the flash memory, and all the mapping segments in the hot cache area are flushed to the flash memory. In this way, the hot mapping segments in the hot cache area are only stored when the solid state disk is powered off, and the new mapping entries generated in the running process of the solid state disk are no longer flushed to the flash memory, which greatly reduces the data amount of the L2P mapping table flushed to the flash memory, reduces the occupation of the write bandwidth, reduces the repeated flushing of data, and improves the storage efficiency of the L2P mapping table. In addition, the write frequency of the mapping segments in the cold cache area is reduced, the write amplification effect is effectively reduced, and the service life of the flash memory is prolonged. Moreover, the present application is applicable to solid state disks of different capacities without the need for hardware modification.

[0071] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.

[0072] The embodiment of the present application also provides a mapping segment management device, as shown in Figure 4 , a device structure block diagram of a mapping segment management device provided by the embodiment of the present application; the mapping segment management device comprises: Figure 4 The mapping segment management device comprises:

[0073] The acquisition module 401 is configured to acquire a total access frequency of a plurality of mapping segments included in a mapping table corresponding to the solid state disk in a current period, a first access frequency of a first mapping segment, and a first mapping temperature corresponding to the first mapping segment in a previous period, wherein the mapping temperature is used to indicate the frequency of access in the mapping segment corresponding to the mapping temperature, and the first mapping segment is any one of the plurality of mapping segments.

[0074] The processing module 402 is configured to determine a second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency and the total access frequency; and determine whether to perform a cache area migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature and a cache area currently occupied by the first mapping segment, wherein the cache area migration operation comprises migration from the hot cache area to the cold cache area or migration from the cold cache area to the hot cache area.

[0075] In some optional embodiments, the second mapping temperature of the first mapping segment in the current period is determined according to the first mapping temperature, the first access frequency and the total access frequency, and is represented by the following expression:

[0076]

[0077] Wherein, T is the second mapping temperature; T0 is the first mapping temperature; C is the first access times; M is the total access times; a is the first preset weight corresponding to the mapping temperature; b is the second preset weight corresponding to the access times.

[0078] In some optional embodiments, the processing module 402 is specifically configured to, when the second mapping temperature is greater than the preset mapping temperature, mark the type of the first mapping segment as a hot mapping segment; determine whether the cache area where the first mapping segment currently locates is a hot cache area; when it is determined that the cache area where the first mapping segment currently locates is the hot cache area, not perform the cache area migration operation.

[0079] In some optional embodiments, when it is determined that the cache area where the first mapping segment currently locates is a cold cache area, the processing module 402 is specifically configured to acquire the remaining storage resource of the hot cache area at the current time; when the remaining storage resource is greater than or equal to the storage resource corresponding to the first mapping segment, determine to migrate the first mapping segment from the cold cache area to the hot cache area.

[0080] In some optional embodiments, when the remaining storage resource is less than the storage resource corresponding to the first mapping segment, the processing module 402 is specifically configured to detect all hot mapping segments existing in the cold cache area at the current time, and acquire the mapping temperature corresponding to all hot mapping segments stored in the cold cache area at the current time and all hot mapping segments stored in the hot cache area, and the maximum storage quantity of the mapping segments corresponding to the hot cache area, the maximum storage quantity being R; sort the mapping temperature corresponding to at least one hot mapping segment stored in the cold cache area at the current time, all hot mapping segments stored in the hot cache area, and the second mapping temperature in descending order of temperature, to obtain a target-ordered mapping temperature mapping segment sequence; if the first mapping segment is one of the first R mapping segments in the mapping temperature mapping segment sequence, migrate the first mapping segment into the hot cache area; or, if the first mapping segment is one of the mapping segments other than the first R mapping segments in the mapping temperature mapping segment sequence, keep the first mapping segment in the cold cache area.

[0081] In some optional embodiments, the processing module 402 is further configured to, during the running of the solid state disk, receive a write request sent by a host to the solid state disk, obtain a new mapping entry, and update the new mapping entry to the mapping table; if a second mapping segment to which the new mapping entry belongs is stored in the cold cache area, store the new mapping entry in an incremental cache area in the cold cache area; when the number of mapping entries stored in the incremental cache area is equal to a preset number, write the mapping entries stored in the incremental cache area into the flash memory, and clear the incremental cache area.

[0082] In some optional embodiments, the processing module 402 is further configured to write the mapping entries stored in the incremental cache area into the flash memory when the solid state disk is powered off, select one mapping segment from the plurality of mapping segments stored in the cold cache area in sequence and write the selected mapping segment into the flash memory, and write all the mapping segments stored in the hot cache area into the flash memory.

[0083] The features of the embodiments of the mapping segment management apparatus can be understood by referring to the related descriptions of the embodiments of the mapping segment management method, which will not be repeated here.

[0084] Embodiments of the present application also provide an electronic device, which comprises the mapping segment management apparatus. Figure 5 As shown in the figure, Figure 5 The electronic device provided by the embodiments of the present application has the hardware structure shown in the figure. The electronic device comprises a processor 10 and a memory 20, and the memory 20 stores a computer program. The processor 10 is configured to run the computer program to perform the steps in any of the embodiments of the mapping segment management method.

[0085] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is configured to perform the steps in any of the embodiments of the mapping segment management method when running.

[0086] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0087] Embodiments of the present application also provide a computer program product, which comprises a computer program. The computer program is executed by a processor to implement the steps in any of the embodiments of the mapping segment management method.

[0088] Embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium. The non-volatile computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps in any of the embodiments of the mapping segment management method.

[0089] Those skilled in the art will further realize that the mere concepts, teachings, and embodiments described herein are merely meant to provide an enabling description of the claimed application. Accordingly, modifications and / or additions, other than those explicitly described herein, can be obvious to those skilled in the art in the light of this disclosure. The claimed application is intended to embrace all such modifications and / or additions.

[0090] The above provides a kind of mapping segment management method, device, electronic equipment and storage medium provided by the present application in detail.The principle and implementation of the present application are described in this paper by applying specific examples.The above example is only applicable to help understand the method and its core idea of the present application.It should be pointed out that, for those skilled in the art, without departing from the principle of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A management method of a mapping section, characterized by, The method comprises: obtaining a total access frequency of a plurality of mapping segments included in a mapping table corresponding to a solid state disk in a current period, a first access frequency of a first mapping segment, and a first mapping temperature corresponding to the first mapping segment in a previous period, wherein the mapping temperature is used to indicate the frequency of access in the mapping segment corresponding to the mapping temperature, and the first mapping segment is any one of the plurality of mapping segments; determining a second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency and the total access frequency; determining whether to perform a cache area migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature, and a current cache area of the first mapping segment, wherein the cache area migration operation comprises migration from a hot cache area to a cold cache area, or migration from a cold cache area to a hot cache area.

2. The method of claim 1, wherein, The determination of the second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency and the total access frequency is represented by the following expression: wherein T is the second mapping temperature, T0 is the first mapping temperature, C is the first access frequency, M is the total access frequency, a is a first preset weight corresponding to the mapping temperature, and b is a second preset weight corresponding to the access frequency.

3. The method of claim 2, wherein, The determination of whether to perform the cache area migration operation on the first mapping segment according to the second mapping temperature, the preset mapping temperature, and the current cache area of the first mapping segment comprises: when the second mapping temperature is greater than the preset mapping temperature, the type of the first mapping segment is marked as a hot mapping segment; determining whether the current cache area of the first mapping segment is a hot cache area; when it is determined that the current cache area of the first mapping segment is the hot cache area, the cache area migration operation is not performed.

4. The method of claim 3, wherein, when it is determined that the current cache area of the first mapping segment is the cold cache area, the method further comprises: obtaining a remaining storage resource of the hot cache area at a current time; when the remaining storage resource is greater than or equal to a storage resource corresponding to the first mapping segment, it is determined to migrate the first mapping segment from the cold cache area to the hot cache area.

5. The method of claim 4, wherein, when the remaining storage resource is less than the storage resource corresponding to the first mapping segment, the method further comprises: detecting all hot mapping segments existing in the cold cache area at the current time, and obtaining mapping temperatures corresponding to all hot mapping segments stored in the cold cache area at the current time and all hot mapping segments stored in the hot cache area, and a maximum storage quantity of mapping segments corresponding to the hot cache area, wherein the maximum storage quantity is R; sorting the mapping temperatures corresponding to at least one hot mapping segment stored in the cold cache area at the current time, all hot mapping segments stored in the hot cache area, and the second mapping temperature in descending order of temperature to obtain a target ordered mapping temperature mapping segment sequence. If the first mapping segment is one of the first R mapping segments in the mapping temperature mapping segment sequence, the first mapping segment is migrated to the hot cache area; Or, if the first mapping segment is one of the first R mapping segments in the mapping temperature mapping segment sequence, the first mapping segment is kept in the cold cache area.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: During the running of the solid state disk, when a write request sent by a host to the solid state disk is received, a new mapping entry is obtained, and the new mapping entry is updated to the mapping table; If a second mapping segment to which the new mapping entry belongs is stored in the cold cache area, the new mapping entry is stored in an incremental cache area in the cold cache area; When the number of mapping entries stored in the incremental cache area is equal to a preset number, the mapping entries stored in the incremental cache area are written into the flash memory, and the incremental cache area is emptied.

7. The method of claim 6, wherein, The method further comprises: When the solid state disk is powered off, the mapping entries stored in the incremental cache area are written into the flash memory, one mapping segment is selected in sequence from the plurality of mapping segments stored in the cold cache area and written into the flash memory, and all the mapping segments stored in the hot cache area are written into the flash memory.

8. A management apparatus of a mapping section characterized by comprising: The mapping segment management apparatus comprises: an acquisition module, configured to acquire a total access frequency of a plurality of mapping segments included in a mapping table corresponding to a solid state disk in a current period, a first access frequency of a first mapping segment, and a first mapping temperature of the first mapping segment in a previous period, wherein the mapping temperature is used to indicate a frequency of access in a mapping segment corresponding to the mapping temperature, and the first mapping segment is any one of the plurality of mapping segments; a processing module, configured to determine a second mapping temperature of the first mapping segment in the current period according to the first mapping temperature, the first access frequency, and the total access frequency, and determine whether to perform a cache area migration operation on the first mapping segment according to the second mapping temperature, a preset mapping temperature, and a cache area currently occupied by the first mapping segment, wherein the cache area migration operation comprises migration from a hot cache area to a cold cache area, or migration from the cold cache area to the hot cache area.

9. An electronic device, comprising: comprise: a memory, configured to store a computer program; a processor, configured to execute the computer program to implement the steps of the mapping segment management method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the mapping segment management method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Hierarchical caching system, method and device and storage equipment

    CN121542191A