Data storage method and device, electronic equipment and storage medium
By acquiring bitmap information and performing paging storage based on access frequency, hot data is stored in pages with lower read latency, solving the problem of high read latency in SSDs caused by QLC storage technology and improving the overall performance of SSDs.
Patent Information
- Application Number
- CN202511348756.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-22
AI Technical Summary
QLC storage technology results in higher read latency for solid-state drives (SSDs), mainly due to the increased amount of data stored in each storage unit and the higher error rate, which leads to an increase in the number of read voltage axes and error correction code iterations.
By acquiring the bitmap information of the data block, page data is stored in pages with different read latencies based on the access frequency of the page data. Frequently accessed hot data is stored in pages with lower read latencies, while cold data is stored in pages with higher read latencies, thus achieving page-type-based paging storage.
It significantly reduces the overall read latency of the SSD and improves the performance of the SSD.
Smart Images

Figure CN120848810B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data storage technology, and in particular to a data storage method, apparatus, electronic device, and storage medium. Background Technology
[0002] Quad-Level Cell (QLC) storage technology significantly improves data storage density and capacity by increasing the data storage capacity of each storage cell to four bits. However, this QLC technology also leads to higher read latency in Solid State Drives (SSDs). Summary of the Invention
[0003] This disclosure provides a data storage method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0004] In a first aspect, embodiments of this disclosure provide a data storage method, the method comprising:
[0005] Obtain bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, the data type of the page data of the first page being used to characterize the access frequency of the page data of the first page;
[0006] For each of the plurality of first pages, based on the data type of the page data of the first page, the page data of the first page is stored to the target page in the second data block; wherein, the second data block includes a plurality of second pages of different types, the plurality of second pages of different types including the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page.
[0007] Secondly, embodiments of this disclosure provide a data storage device, the device comprising:
[0008] The acquisition module is used to acquire bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, and the data type of the page data of the first page being used to characterize the access frequency of the page data of the first page.
[0009] The storage module is used to store the page data of each of the plurality of first pages to a target page in a second data block, based on the data type of the page data of the first page; wherein the second data block includes a plurality of second pages of different types, the plurality of second pages of different types including the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page.
[0010] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the data storage methods.
[0011] Fourthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform any data storage method.
[0012] Based on the data storage method provided in this embodiment, bitmap information of a first data block can be obtained. This bitmap information can indicate the data type of each first page in the first data block. The data type of the first page reflects the access frequency of the first page's data. Therefore, based on the data type of the first page's data, the page data of the first page can be stored in a target page of the second data block. Since different types of second pages in the second data block have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of its page data, frequently accessed, high-frequency page data can be stored in pages with lower read latencies. This page-type-based paging storage method significantly reduces the overall read latency of the SSD and improves its overall performance.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] Figure 1 This is one of the flowcharts illustrating a data storage method provided in this embodiment of the disclosure;
[0015] Figure 2 This is a second schematic flowchart of a data storage method provided in this embodiment of the present disclosure;
[0016] Figure 3This is a third schematic flowchart of a data storage method provided in this embodiment of the present disclosure;
[0017] Figure 4 This is a schematic diagram of the structure of a data storage device provided in an embodiment of this disclosure;
[0018] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0019] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0020] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0021] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0023] Before providing a further detailed description of the embodiments of this disclosure, the nouns and terms involved in the embodiments of this disclosure will be explained, and the nouns and terms involved in the embodiments of this disclosure shall be interpreted as follows.
[0024] With the rapid development of emerging technologies such as big data, artificial intelligence, and cloud computing, the global data volume is growing exponentially, placing higher demands on storage media in terms of capacity and performance. Traditional NAND flash memory technology struggles to meet these requirements. Against this backdrop, QLC (Quick Low Voltage) storage technology has emerged. This technology can significantly improve data storage density and capacity, but it also introduces the problem of higher read latency in SSDs.
[0025] The main reason for the higher read latency in SSDs due to QLC storage technology is as follows: First, because the amount of data stored in each storage cell is increased in QLC storage, there are more voltage levels per cell. Therefore, the number of voltage axes that need to be read when reading each page also increases, resulting in higher read latency. For example, for the same storage cell, other types of pages, such as the upper page and extra page, require more voltage axes to be read than the lower page, thus their read latency is higher. Based on existing data, the time required for QLC NAND flash memory to receive a read message from the controller and begin transferring data from the NAND flash memory is typically about 20% longer for other types of pages than for lower pages.
[0026] Secondly, due to the high bit error rate of QLC-type NAND flash memory, a more powerful error correction code is needed to meet the reliability requirements. Currently, QLC-type NAND flash memory typically uses Low-Density Parity-Check (LDPC) error correction code, which has stronger error correction capabilities. However, LDPC error correction code requires an increasing number of iterations as the bit error rate increases. Since the bit error rate of other page types is generally higher than that of lower pages due to the characteristics of NAND flash memory, the time required for error correction using LDPC error correction codes may be longer, resulting in longer data read latency. Furthermore, these phenomena become more pronounced as wear and tear increases.
[0027] To address the aforementioned issues, this disclosure provides a data storage method. Based on this method, bitmap information of a first data block can be obtained. This bitmap information indicates the data type of each first page in the first data block. The data type of the first page reflects its access frequency. Therefore, based on the data type of the first page, the page data can be stored in a target page within a second data block. Since different types of second pages in the second data block have different read latencies, and the read latency of each second page is inversely correlated with its access frequency, frequently accessed, high-frequency page data can be stored in pages with lower read latency. This page-type-based paging storage significantly reduces the overall SSD read latency and improves the overall SSD performance.
[0028] It should be noted that the data storage method provided in this disclosure can be executed by a data storage device or a module within that data storage device used to execute the data storage method. This disclosure describes the data storage method provided in this disclosure in detail using an example of a data storage device executing the data storage method.
[0029] The data storage method provided in this disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] Figure 1 This is one of the flowcharts illustrating a data storage method provided in this embodiment.
[0031] like Figure 1 As shown, the entity executing this data storage method can be a data storage device. Based on this, the data storage method can specifically include the following steps:
[0032] S110, obtain the bitmap information of the first data block.
[0033] The first data block can be a container used for storing data in an SSD, and the number of such first data blocks is not specifically limited in this embodiment. Furthermore, the first data block can include multiple first pages, which can be basic containers used for storing data in an SSD; this will not be elaborated upon further here.
[0034] In some embodiments, the bitmap information described above can be used to indicate the data type of the page data of each first page in the first data block. The data type of the page data can be used to characterize the access frequency of the page data of the first page, that is, the data type of the page data can reflect the frequency of access of the corresponding first page, without being specifically limited here.
[0035] S120: For each of the multiple first pages, based on the data type of the page data of the first page, store the page data of the first page to the target page in the second data block.
[0036] The aforementioned second data block may be a free data block in an SSD, and the second data block may include multiple second pages of different types, and the multiple second pages may include the aforementioned target page.
[0037] In this embodiment, different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data on that second page. Specifically, if the read latency of the second page is higher, the access frequency of the page data of the first page to be stored on that second page is lower; conversely, if the read latency of the second page is lower, the access frequency of the page data of the first page to be stored on that second page is higher. No specific limitations are imposed here.
[0038] In this way, by obtaining the bitmap information of the first data block, which indicates the data type of each first page in the first data block and represents the access frequency of that page data, it is possible to migrate and store the page data of the first page in the second data block to a target page with lower read latency if the data type of the first page data reflects higher access frequency. Conversely, if the data type of the first page data reflects lower access frequency, the page data of the first page can be migrated and stored to a target page in the second data block with higher read latency.
[0039] In some embodiments, the aforementioned multiple different types of second pages may include first type pages and second type pages, and correspondingly, the aforementioned target page may include either a first type page or a second type page. The read latency corresponding to the first type page may be less than the read latency corresponding to the second type page; for example, the first type page may be a lower page, while the second type page may be another type of page. Furthermore, in embodiments of this disclosure, the data type of the page data may include cold data types and hot data types, where cold data types indicate that the page data is accessed less frequently, and hot data types indicate that the page data is accessed more frequently.
[0040] Thus, if the data type of the first page is a "hot" data type, indicating that this page data is frequently accessed and has a high access frequency, then this page data needs to be placed in the second data block to a target page with lower read latency. In this case, the target page can include a first-type page. If the data type of the first page is a "cold" data type, indicating that this page data is not frequently accessed and has a low access frequency, then this first page data needs to be placed in the second data block to a target page with higher read latency. In this case, the target page can be a second-type page.
[0041] Based on the data storage method provided in this embodiment, bitmap information of a first data block can be obtained. This bitmap information can indicate the data type of each first page in the first data block. The data type of the first page reflects the access frequency of the first page's data. Therefore, based on the data type of the first page's data, the page data of the first page can be stored in a target page of the second data block. Since different types of second pages in the second data block have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of its page data, frequently accessed, high-frequency page data can be stored in pages with lower read latencies. This page-type-based paging storage method significantly reduces the overall read latency of the SSD and improves its overall performance.
[0042] Since the bitmap information described above can indicate the data type of each first page in this embodiment, in order to accurately perform address replacement of different types of page data based on the data type of each first page indicated by the bitmap information, it is necessary to provide a detailed description of the bitmap information provided in this embodiment.
[0043] In this embodiment of the disclosure, the bitmap information of the first data block may include the bit value corresponding to each first page, which can be used to indicate the data type of the page data of the first page. Specifically, if the bit value corresponding to the first page is a first value, the data type of the page data of the first page can be a hot data type, indicating that the page data is accessed frequently. If the bit value corresponding to the first page is a second value, the data type of the page data of the first page is a cold data type, indicating that the page data is accessed less frequently.
[0044] It should be noted that the bitmap information provided in this embodiment can use the value of a single bit (i.e., the bit value mentioned above) to represent the data type of the corresponding first page. The value of this bit can be 0 or 1. Therefore, the first value can be set to 1, and the second value needs to be set to 0. Correspondingly, if the first value is set to 0, the second value can be set to 1, which will not be elaborated further here.
[0045] In this embodiment, the data type of each first page can be conveniently and accurately determined by utilizing the bit values corresponding to each first page in the acquired bitmap information. This facilitates subsequent address replacement of different types of page data based on the data type of each page indicated by the bitmap information, significantly reducing the overall read latency of the SSD.
[0046] Furthermore, considering that the data blocks in this embodiment may include different types of pages, in order to accurately and intuitively perform address replacement of different types of page data based on the data type of each first page indicated by the bitmap information, in one embodiment of this disclosure, the aforementioned plurality of first pages may include a first type of page and a second type of page, wherein the read latency corresponding to the first type of page is different from the read latency corresponding to the second type of page. Based on this, the above-mentioned S110 may include the following steps:
[0047] Obtain the first bitmap information and the second bitmap information.
[0048] The bitmap information mentioned above may include the first bitmap information and the second bitmap information.
[0049] The aforementioned first bit information may include the value of the first bit corresponding to the first type of page. This first bit value can be used to indicate the data type of the page data of the first type of page. Specifically, if the first bit value is a first value, the data type of the page data of the first type of page is a cold data type, indicating that the page data is accessed less frequently. If the first bit value is a second value, the data type of the page data of the first type of page can be a hot data type, indicating that the page data is accessed more frequently.
[0050] Similarly, the second bitmap information may include the second bit value corresponding to the second type of page, which can be used to indicate the data type of the page data of the second type of page. Specifically, if the second bit value is a first value, the data type of the page data of the second type of page can be a hot data type; if the second bit value is a second value, the data type of the page data of the second type of page is a cold data type, indicating that the page data is accessed less frequently.
[0051] In one example, if the first type of page is a lower page and the second type of page is another type of page, then this embodiment of the disclosure can initialize a bitmap format table for recording the data type of page data in the lower page (the information in this table is the aforementioned first bitmap information) and a bitmap format table for recording the data type of page data in other types of pages (the information in this table is the aforementioned second bitmap information), respectively. Thus, in the bitmap format table for recording the data type of page data in the lower page, if the first bit position corresponding to the first page is 1, it indicates that the data type of the page data in the first page is a cold data type; conversely, if the first bit position corresponding to the first page is 0, it indicates that the data type of the page data in the first page is a hot data type. Similarly, in the bitmap format table for recording the data type of page data in other types of pages, if the second bit position corresponding to the first page is 1, it indicates that the data type of the page data in the first page is a hot data type; conversely, if the first bit position corresponding to the first page is 0, it indicates that the data type of the page data in the first page is a cold data type.
[0052] In this embodiment, bitmap information can be recorded separately for different types of pages in the data block, thereby enabling intuitive and accurate determination of the data type of each first page. This facilitates accurate and intuitive address replacement of different types of page data based on the data type of each first page indicated by the bitmap information, thus reducing the overall read latency of the SSD.
[0053] In order to describe the data storage method provided by the embodiments of this disclosure in detail and completely, in one embodiment of this disclosure, such as Figure 2 As shown, prior to S110, the data storage method provided in this embodiment may further include the following steps:
[0054] S210, Obtain access information for the page data of each first page;
[0055] S220, Based on the access information of the page data of the first page, determine the data type of the page data of the first page.
[0056] The accessed information mentioned above can be used to determine whether the page data on each first page is frequently accessed, and there are no specific limitations here. It should be noted that the accessed information can be the access information of the first page within a fixed period of time, or the access information within a period of time before the conditions are met, and there are no specific limitations here.
[0057] Specifically, since the first data block may include multiple first pages, for each of the multiple first pages, the access information of the page data of that first page can be obtained, and then the data type of the page data of that first page can be determined based on the access information of the page data of that first page.
[0058] It should be noted that, in the embodiments of this disclosure, in the process of determining the data type of the page data of the first page based on the accessed information of the page data of the first page, the accessed information of the page data of the first page can be matched based on the correspondence between the accessed information and the data type, so as to accurately determine the data type of the page data of the first page.
[0059] In this embodiment, by acquiring the access information of each first page's page data, and using the frequency of access reflected by this access information, the data type of the first page's page data can be determined. This improves the accuracy of the page data's data type, facilitating accurate subsequent data address replacement based on the page data's data type. Pages with higher access frequency or higher access intensity are stored in pages with lower read latency, thus reducing overall read latency.
[0060] Based on this, in one embodiment of this disclosure, the accessed information may include the number of times it has been accessed. This number of accesses can reflect the frequency or popularity of accessing the page data of the corresponding first page. This number of accesses can be obtained statistically, and is not specifically limited here. Therefore, the above S220 may specifically include the following steps:
[0061] If the number of times the first page is accessed is less than a preset threshold, the data type of the page data is determined to be a cold data type.
[0062] If the number of times the first page is accessed is greater than or equal to a preset threshold, determine the hot data type of the page data.
[0063] The aforementioned preset number of times threshold can be a preset number of times threshold based on actual experience or circumstances, and no specific limitation is made here.
[0064] Since the access information mentioned above can include the number of times the page was accessed, a comparison can be made between the number of accesses and a preset threshold to determine whether the page data of the first page is being accessed too frequently, thereby determining the data type of the page data on the first page. Specifically, if the number of times the first page is accessed is less than the preset threshold, it indicates that the page data on the first page is not being accessed excessively, and the data type of the page data on the first page can be determined to be a cold data type. Conversely, if the number of times the first page is accessed is greater than or equal to the preset threshold, it indicates that the page data on the first page is being accessed excessively, and the data type of the page data on the first page can be determined to be a hot data type.
[0065] Continuing the example above, in the bitmap format table used to record the data type of page data in the lower page, if the number of times the first page is accessed is less than a preset threshold, it indicates that the access frequency of the page data on the first page is low. Therefore, the first bit corresponding to the first page can be set to 1 in the table above to indicate that the data type of the page data on the first page is a cold data type. Conversely, if the number of times the first page is accessed is greater than or equal to the preset threshold, it indicates that the access frequency of the page data on the first page is high. Therefore, the first bit corresponding to the first page can be set to 0 in the table above to indicate that the data type of the page data on the first page is a hot data type.
[0066] Similarly, in the bitmap format table used to record the data types of page data in other page types, if the number of times the first page is accessed is greater than or equal to a preset threshold, indicating that the page data of the first page has a high access frequency, the second bit corresponding to the first page can be set to 1 to indicate that the data type of the page data of the first page is a hot data type. Conversely, if the number of times the first page is accessed is less than or equal to the preset threshold, indicating that the page data of the first page has a low access frequency, the second bit corresponding to the first page can be set to 0 to indicate that the data type of the page data of the first page is a cold data type.
[0067] In this embodiment, since the accessed information may include the number of times it has been accessed, the frequency or popularity of the accessed page data corresponding to the first page can be accurately determined by the relative relationship between the number of accesses and the preset threshold, thereby accurately determining the data type of the page data.
[0068] Since the number of pages in an SSD is relatively large, recording the access count of each page would consume a significant amount of memory resources. Therefore, in order to accurately obtain the access count of the first page while minimizing memory resource consumption, in one embodiment of this disclosure, the above-mentioned S210 may specifically include the following steps:
[0069] Determine the number of pages on the third page recorded in the first list;
[0070] If the number of pages on the third page is greater than or equal to the preset list capacity, the number of times each page of the first page is accessed is obtained based on the number of times the third page is accessed.
[0071] In some embodiments, the first list described above can be used to record the number of times the page data of the third page has been accessed. The third page may include at least one of the multiple first pages whose access status is in a first state. This first state can indicate that the corresponding first page has been accessed, and is not specifically limited here.
[0072] Furthermore, the aforementioned preset list capacity can be based on the actual preset maximum number of pages that the first list can hold, and is not specifically limited here. It should be noted that this preset list capacity can be adjusted by comprehensively considering memory resource usage and actual performance.
[0073] In this way, the number of pages in the third page recorded in the first list can be determined. Then, it can be determined whether the number of pages in the third page is greater than or equal to the preset list capacity. If the number of pages in the third page is greater than or equal to the preset list capacity, the number of times each page in the first page is accessed can be obtained based on the number of times the page data in the third page is accessed. Specifically, if multiple first pages include a third page, the number of times the third page is accessed can be determined to be the number of times the corresponding first page is accessed. If multiple first pages do not include a third page, then the number of times each of the first pages other than the third page is accessed is zero.
[0074] In one example, this embodiment of the disclosure can initialize a first list recording the access count of the first page. Thus, during SSD operation, when a read operation on the first page is detected, if the first page is not present in the first list, it can be added to the first list. In this case, the first page becomes the aforementioned third page, and the access count of the first page is incremented by 1. Conversely, if the third page in the first list includes the first page, the access count of the first page can be directly incremented by 1. Furthermore, the upper limit of the number of pages recorded in the first list (the list capacity of the first list) can be set to prevent excessive memory overhead due to too much data recorded in the first list. Thus, when the number of pages counted in the first list reaches the list capacity, the access count of each third page recorded in the first list can be obtained for subsequent operations, and the first list can be cleared to start the next recording cycle.
[0075] In this embodiment, by setting a first list for recording the number of times the first page is accessed and setting an upper limit on the number of pages that the first list can hold, the current capacity of the first list can be judged to prevent the problem of large memory overhead caused by too much data recorded in the first list.
[0076] In another embodiment of this disclosure, the accessed information may include access popularity, which can reflect whether the page data of the corresponding first page is frequently accessed. It should be noted that, considering that recent accesses can more accurately reflect the access popularity of the corresponding first page, the access popularity can be calculated based on the number of accesses and the time of each access. This disclosure does not specifically limit the specific calculation method for the access popularity.
[0077] Based on this, the above-mentioned S220 may specifically include the following steps:
[0078] If the access frequency of the page data on the first page is less than a preset access frequency threshold, the data type of the page data is determined to be a cold data type.
[0079] If the access frequency of the page data on the first page is greater than or equal to a preset access frequency threshold, determine the hot data type of the page data.
[0080] The preset popularity threshold can be set in advance based on actual experience or circumstances, and no specific restrictions are made here.
[0081] Specifically, if the access frequency of the first page's data is less than a preset access frequency threshold, it indicates that the first page's data is not frequently accessed, and its access frequency is low. In this case, the data type of the first page's data can be determined to be a cold data type. If the access frequency of the first page's data is greater than or equal to the preset access frequency threshold, it indicates that the first page's data is frequently accessed, and its access frequency is low. In this case, the data type of the first page's data can be determined to be a hot data type.
[0082] In this embodiment, since the accessed information may include access frequency, the relative relationship between the access count and a preset threshold can accurately determine the frequency of access to the page data of the first page, thereby accurately determining the data type of the page data.
[0083] Furthermore, in order to minimize additional wear and tear on the NAND flash memory and avoid extra overhead on the central processing unit (CPU) core, thus ensuring the lifespan of the SSD, in one embodiment of this disclosure, such as... Figure 3 As shown, the above S120 may specifically include the following steps:
[0084] S1201, during the wear leveling process of a solid-state drive (SSD), stores page data to the target page in the second data block based on the data type of the page data in the first page.
[0085] In this embodiment of the disclosure, during wear leveling of a solid-state drive (SSD), page data can be stored in a target page of a second data block based on the data type of the first page, thus rearranging the page data. Specifically, during wear leveling of the SSD, if the data type of the first page reflects a higher access frequency, the page data stored in the first page can be re-stored in a target page of the second data block with lower read latency. Conversely, if the data type of the first page reflects a lower access frequency, the page data stored in the first page can be re-stored in a target page of the second data block with higher read latency.
[0086] In this embodiment, data can be rearranged while the SSD is being worn down, that is, the data of pages with high access frequency can be migrated to target pages with lower read latency. In this way, the number of erase and write operations of data blocks due to address replacement of hot and cold data types can be avoided during non-wear leveling processes. This effectively avoids additional wear on NAND Flash caused by data relocation and also avoids additional overhead on the SSD controller.
[0087] Based on this, in order to accurately and in detail describe the data storage method provided in the embodiments of this disclosure, in one embodiment of this disclosure, the page address of the target page used to store page data in the second data block is determined based on the data type of the page data of the first page;
[0088] Based on the data type of the page data in the first page, determine the page address of the target page used to store the page data in the second data block;
[0089] Read the data type of the first page's data into memory;
[0090] Based on the page address of the target page, the page data in memory is written to the target page.
[0091] Specifically, after obtaining bitmap information, based on the data type of the page data of each first page indicated by the bitmap information, the page address of the target page is determined for each first page based on the data type of the page data of the first page. The target page is the page to be migrated for the corresponding first page. Then, the data type of the page data of the first page can be read into memory so that the page data in memory can be written into the target page based on the page address of the target page.
[0092] In this embodiment, the address of the page to be migrated in the second data block can be determined based on the data type of the page data of each first page. Simultaneously, the page data of the first page is read into memory, so that the page data in memory can be written to the target page based on the address of the page to be migrated. This achieves the migration of frequently accessed data to pages with lower read latency, thereby reducing overall read latency.
[0093] Based on the same inventive concept, this disclosure provides a data storage device, which can be specifically described in conjunction with the appendix. Figure 4 A data storage device provided in the embodiments of this disclosure will be described in detail.
[0094] Figure 4 This is a schematic diagram of the structure of a data storage device provided in an embodiment of this disclosure.
[0095] like Figure 4 As shown, the data storage device 400 may include:
[0096] The acquisition module 410 is used to acquire bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, and the data type of the page data being used to characterize the access frequency of the page data of the first page.
[0097] Storage module 420 is used to store the page data of each of the plurality of first pages to a target page in a second data block based on the data type of the page data of the first page; wherein the second data block includes a plurality of second pages of different types, the plurality of second pages of different types including the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page.
[0098] In one embodiment of this disclosure, the data type of the page data includes cold data type and hot data type; the bitmap information of the first data block includes bit values corresponding to each first page, and the bit values corresponding to each first page are used to indicate the data type of the page data of the first page;
[0099] When the bit value corresponding to the first page is a first value, the data type of the page data of the first page is a hot data type;
[0100] When the bit value corresponding to the first page is the second value, the data type of the page data of the first page is a cold data type.
[0101] In one embodiment of this disclosure, the data type of the page data includes cold data type and hot data type; the plurality of first pages include first type pages and second type pages; the data storage device provided in this embodiment of the disclosure further includes:
[0102] The acquisition module is specifically used to acquire first bitmap information and second bitmap information, wherein the bitmap information includes the first bitmap information and the second bitmap information;
[0103] The first bitmap information includes a first bit value corresponding to the first type of page, which is used to indicate the data type of the page data of the first type of page. When the first bit value is a first value, the data type of the page data of the first type of page is a cold data type, and when the first bit value is a second value, the data type of the page data of the first type of page is a hot data type.
[0104] The second bitmap information includes the second bit value corresponding to the second type of page. The second bit value corresponding to the second type of page is used to indicate the data type of the page data of the second type of page. When the second bit value is a first value, the data type of the page data of the second type of page is a hot data type. When the second bit value is a second value, the data type of the page data of the second type of page is a cold data type.
[0105] In one embodiment of this disclosure, the data storage device provided in this embodiment further includes:
[0106] The acquisition module is also used to acquire access information for each page of the first page;
[0107] The determination module is used to determine the data type of the page data of the first page based on the access information of the page data of the first page.
[0108] In one embodiment of this disclosure, the accessed information includes the number of times it has been accessed; the data storage device provided in this embodiment of the disclosure further includes:
[0109] The determining module is specifically used to determine that the data type of the page data is a cold data type when the number of times the first page is accessed is less than a preset threshold.
[0110] The determining module is specifically used to determine the hot data type of the page data when the number of times the first page is accessed is greater than or equal to the preset number threshold.
[0111] In one embodiment of this disclosure, the accessed information includes access popularity; the data storage device provided in this embodiment of the disclosure further includes:
[0112] The determining module is specifically used to determine that the data type of the page data is a cold data type when the access popularity of the page data on the first page is less than a preset popularity threshold.
[0113] The determining module is specifically used to determine the hot data type of the page data when the access popularity of the page data on the first page is greater than or equal to the preset popularity threshold.
[0114] In one embodiment of this disclosure, the data storage device provided in this embodiment further includes:
[0115] The determining module is further configured to determine the number of pages of the third page recorded in the first list, wherein the first list is configured to record the number of times the page data of the third page is accessed, and the third page includes at least one first page among the plurality of first pages whose access status is in the first state;
[0116] The acquisition module is specifically used to acquire the access count of each page data of the first page based on the access count of the page data of the third page when the number of pages of the third page is greater than or equal to the preset list capacity.
[0117] In one embodiment of this disclosure, the data storage device provided in this embodiment further includes:
[0118] The storage module is specifically used to store the page data to the target page in the second data block based on the data type of the page data of the first page during the wear leveling process of the solid-state drive (SSD).
[0119] In one embodiment of this disclosure, the data storage device provided in this embodiment further includes:
[0120] The determining module is used to determine the page address of the target page in the second data block for storing the page data based on the data type of the page data of the first page;
[0121] The read module is used to read the data type of the page data of the first page into memory;
[0122] The write module is used to write page data in memory to the target page based on the page address of the target page.
[0123] It is understood that, when implementing the corresponding data storage method, the data storage device provided in the above embodiments can allocate the above processing to different program modules as needed to complete all or part of the processing described above. Furthermore, the device and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0124] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a data storage method.
[0125] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored and when executed by a processor, the processor will execute the data storage method provided in this application.
[0126] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0127] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0128] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0129] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0130] Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure; as shown below. Figure 5 As shown, the electronic device 50 includes: a processor 501, and a memory 502 communicatively connected to the processor 501; the memory 502 stores instructions executable by the processor 501. The instructions are executed by the processor 501 to enable the processor 501 to perform:
[0131] Obtain bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, the data type of the page data being used to characterize the access frequency of the page data of the first page;
[0132] For each of the plurality of first pages, based on the data type of the page data of the first page, the page data of the first page is stored to the target page in the second data block; wherein, the second data block includes a plurality of second pages of different types, the plurality of second pages of different types including the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page.
[0133] The electronic devices and corresponding data storage methods provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0134] In practical applications, the electronic device 50 may further include at least one network interface 503. The various components of the electronic device 50 are coupled together via a bus system 504. It is understood that the bus system 504 is used to implement communication between these components. In addition to a data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 All buses are labeled as bus system 504. The number of processors 501 and the number of memories 502 can be at least one. The network interface 503 is used for wired or wireless communication between the electronic device 50 and other devices.
[0135] The memory 502 in this embodiment is used to store various types of data to support the operation of the electronic device 50.
[0136] The methods disclosed in the above embodiments of this disclosure can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by integrated logic circuits in the hardware of processor 501 or by instructions in software form. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 501 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 502. Processor 501 reads information from memory 502 and, in conjunction with its hardware, completes the steps of the aforementioned data storage method.
[0137] In some embodiments, the electronic device 50 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.
[0138] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0139] In the above description, the term "some embodiments" refers to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0140] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0141] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.
[0142] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.
[0143] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A data storage method, characterized in that, The method includes: Obtain bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, the data type of the page data being used to characterize the access frequency of the page data of the first page; For each of the plurality of first pages, based on the data type of the page data of the first page, the page data of the first page is stored to the target page in the second data block; wherein, the second data block includes a plurality of second pages of different types, the plurality of second pages of different types include the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page; The data types of the page data include cold data types and hot data types; the plurality of first pages include first type pages and second type pages; obtaining the bitmap information of the first data block includes: Obtain first bitmap information and second bitmap information, wherein the bitmap information includes the first bitmap information and the second bitmap information; The first bitmap information includes a first bit value corresponding to the first type of page, which is used to indicate the data type of the page data of the first type of page. When the first bit value is a first value, the data type of the page data of the first type of page is a cold data type, and when the first bit value is a second value, the data type of the page data of the first type of page is a hot data type. The second bitmap information includes the second bit value corresponding to the second type of page. The second bit value corresponding to the second type of page is used to indicate the data type of the page data of the second type of page. When the second bit value is a first value, the data type of the page data of the second type of page is a hot data type. When the second bit value is a second value, the data type of the page data of the second type of page is a cold data type.
2. The method according to claim 1, characterized in that, The data types of the page data include cold data types and hot data types; the bitmap information of the first data block includes the bit values corresponding to each first page, and the bit values corresponding to each first page are used to indicate the data type of the page data of the first page; When the bit value corresponding to the first page is a first value, the data type of the page data of the first page is a hot data type; When the bit value corresponding to the first page is the second value, the data type of the page data of the first page is a cold data type.
3. The method according to claim 1 or 2, characterized in that, Before obtaining the bitmap information of the first data block, the method further includes: Obtain access information for each page of the first page; Based on the access information of the page data of the first page, the data type of the page data of the first page is determined.
4. The method according to claim 3, characterized in that, The accessed information includes the number of times it has been accessed; determining the data type of the page data of the first page based on the accessed information of the page data of the first page includes: If the number of times the first page is accessed is less than a preset threshold, the data type of the page data is determined to be a cold data type. If the number of times the first page is accessed is greater than or equal to the preset threshold, the data type of the page data is determined to be a hot data type.
5. The method according to claim 3, characterized in that, The accessed information includes access popularity; determining the data type of the page data of the first page based on the accessed information of the first page includes: If the access frequency of the page data on the first page is less than a preset frequency threshold, the data type of the page data is determined to be a cold data type. If the access frequency of the page data on the first page is greater than or equal to the preset frequency threshold, the data type of the page data is determined to be a hot data type.
6. The method according to claim 4, characterized in that, The step of obtaining access information for each page of the first page includes: Determine the number of pages of the third page recorded in the first list, wherein the first list is used to record the number of times the page data of the third page is accessed, and the third page includes at least one first page among the plurality of first pages whose access status is in the first state; If the number of pages in the third page is greater than or equal to the preset list capacity, the number of times each page of the first page is accessed is obtained based on the number of times the page data of the third page is accessed.
7. The method according to claim 1, characterized in that, The method of storing the page data in the target page of the second data block based on the data type of the page data of the first page includes: During wear leveling of a solid-state drive (SSD), the page data is stored in the target page of the second data block based on the data type of the page data of the first page.
8. The method according to claim 1 or 7, characterized in that, The method of storing the page data in the target page of the second data block based on the data type of the page data of the first page includes: Based on the data type of the page data of the first page, determine the page address of the target page used to store the page data in the second data block; Read the data type of the page data of the first page into memory; Based on the page address of the target page, the page data in memory is written to the target page.
9. A data storage device, characterized in that, The device includes: The acquisition module is used to acquire bitmap information of a first data block, the first data block including multiple first pages, the bitmap information being used to indicate the data type of the page data of each first page, and the data type of the page data being used to characterize the access frequency of the page data of the first page. A storage module is configured to store the page data of each of the plurality of first pages to a target page in a second data block, based on the data type of the page data of the first page; wherein the second data block includes a plurality of second pages of different types, the plurality of second pages of different types including the target page, the different types of second pages have different read latencies, and the read latency of each second page is inversely correlated with the access frequency of the page data of the second page; The data types of the page data include cold data types and hot data types; the plurality of first pages include first type pages and second type pages; the device includes: The acquisition module is specifically used to acquire first bitmap information and second bitmap information, wherein the bitmap information includes the first bitmap information and the second bitmap information; The first bitmap information includes a first bit value corresponding to the first type of page, which is used to indicate the data type of the page data of the first type of page. When the first bit value is a first value, the data type of the page data of the first type of page is a cold data type, and when the first bit value is a second value, the data type of the page data of the first type of page is a hot data type. The second bitmap information includes the second bit value corresponding to the second type of page. The second bit value corresponding to the second type of page is used to indicate the data type of the page data of the second type of page. When the second bit value is a first value, the data type of the page data of the second type of page is a hot data type. When the second bit value is a second value, the data type of the page data of the second type of page is a cold data type.
10. The apparatus according to claim 9, characterized in that, The data types of the page data include cold data types and hot data types; the bitmap information of the first data block includes the bit values corresponding to each first page, and the bit values corresponding to each first page are used to indicate the data type of the page data of the first page; When the bit value corresponding to the first page is a first value, the data type of the page data of the first page is a hot data type; When the bit value corresponding to the first page is the second value, the data type of the page data of the first page is a cold data type.
11. The apparatus according to claim 9 or 10, characterized in that, The device further includes: The acquisition module is also used to acquire access information for each page of the first page; The determination module is used to determine the data type of the page data of the first page based on the access information of the page data of the first page.
12. The apparatus according to claim 11, characterized in that, The accessed information includes the number of times it has been accessed; the device includes: The determining module is specifically used to determine that the data type of the page data is a cold data type when the number of times the first page is accessed is less than a preset threshold. The determining module is specifically used to determine the hot data type of the page data when the number of times the first page is accessed is greater than or equal to the preset number threshold.
13. The apparatus according to claim 11, characterized in that, The accessed information includes access popularity; the device includes: The determining module is specifically used to determine that the data type of the page data is a cold data type when the access popularity of the page data on the first page is less than a preset popularity threshold. The determining module is specifically used to determine the hot data type of the page data when the access popularity of the page data on the first page is greater than or equal to the preset popularity threshold.
14. The apparatus according to claim 12, characterized in that, The device includes: The determining module is further configured to determine the number of pages of the third page recorded in the first list, wherein the first list is configured to record the number of times the page data of the third page is accessed, and the third page includes at least one first page among the plurality of first pages whose access status is in the first state; The acquisition module is specifically used to acquire the access count of each page data of the first page based on the access count of the page data of the third page when the number of pages of the third page is greater than or equal to the preset list capacity.
15. The apparatus according to claim 9, characterized in that, The device includes: The storage module is specifically used to store the page data to the target page in the second data block based on the data type of the page data of the first page during the wear leveling process of the solid-state drive (SSD).
16. The apparatus according to claim 9 or 15, characterized in that, The device further includes: The determining module is used to determine the page address of the target page in the second data block for storing the page data based on the data type of the page data of the first page; The read module is used to read the data type of the page data of the first page into memory; The write module is used to write page data in memory to the target page based on the page address of the target page.
17. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the data storage method according to any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the data storage method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data placement method for asymmetric read delay perception
CN111190834A
Memory data migration method, related device and computer equipment
CN119166035A