IO response acceleration method and device, readable storage medium and electronic equipment

By establishing a small data mapping table in a solid-state hard disk, dynamically managing the data of small IO requests, the complex problem of P2L and L2P table entry management is solved, the IO response speed is improved, the access time to the hard disk is reduced, and the system performance is improved.

CN119002811AActive Publication Date: 2024-11-22CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411046600.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-22
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

When existing solid-state drives manage the mapping relationship between logical addresses and physical addresses, especially P2L and L2P table entries are complex, resulting in slow data access speed, which may lead to data loss or performance degradation.

Method used

Establish a small data mapping table, specifically used to store data whose data size is smaller than the preset value, dynamically manage table entries through the linked list structure, reduce direct access to physical storage devices, and improve IO response speed.

Benefits of technology

The information of small IO requests is directly obtained through the small data mapping table, reducing access time to the hard disk, improving IO response speed, reducing memory overhead, and enhancing system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119002811A_ABST
    Figure CN119002811A_ABST
Patent Text Reader

Abstract

The invention provides an IO response acceleration method and device, a computer readable storage medium and electronic equipment, and the method comprises the following steps: building a small data mapping table which corresponds to data with the data size smaller than a first preset value; iO access data is received, and if the IO access data is smaller than a first preset value, searching is conducted through the small data mapping table. By establishing the small data mapping table to specially store the small IO access data, the occupied memory space is small, related information can be directly obtained from the small data mapping table when the small IO requests are received, direct access to physical storage equipment is reduced, and therefore response to the requests can be accelerated through small memory overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of solid state hard disk data reading and writing, and in particular to a method, device, readable storage medium and electronic device for accelerating IO response. Background Art

[0002] With the rapid development of new generation information technologies such as cloud computing, mobile Internet, and big data, efficient data storage and access have become key issues that need to be urgently addressed in the storage field. Flash-based solid-state drives (SSDs) have gradually replaced traditional mechanical hard disks (HDDs) and become mainstream storage devices due to their fast read and write speeds, low power consumption, and shock resistance.

[0003] The firmware strategy of SSD mainly focuses on optimizing its performance, lifespan and stability. With the increase of SSD capacity and the continuous writing of data, how to efficiently manage the mapping relationship between logical addresses and physical addresses (such as P2L and L2P entries), optimize the file system to organize dirty data, and make full use of cache RAM to improve access speed have become key issues that SSD firmware strategy needs to solve. These strategies are designed to provide faster data read and write speeds, longer lifespan and more stable performance.

[0004] Among them, the management of P2L and L2P entries is a complex and critical task for SSD firmware. These entries need to accurately map logical addresses to physical addresses. As the SSD capacity increases and data is continuously written, the number and size of entries will increase accordingly, which puts higher requirements on the firmware's processing capabilities. If the entries are not managed properly or errors occur, data loss or performance degradation may occur, which in turn affects the user experience. Summary of the invention

[0005] The technical problem to be solved by the present invention is: how to improve the IO response speed.

[0006] In order to solve the above technical problems, a technical solution adopted by the present invention is:

[0007] A method for accelerating IO response is provided, comprising the steps of: establishing a small data mapping table, the small data mapping table corresponding to data whose size is smaller than a first preset value; receiving IO access data, and searching through the small data mapping table if the IO access data is smaller than the first preset value.

[0008] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0009] A device for accelerating IO response, comprising:

[0010] An input module, used to establish a small data mapping table, wherein the small data mapping table corresponds to data whose size is smaller than a first preset value;

[0011] The search module is used to receive IO access data, and if the IO access data is smaller than a first preset value, search through the small data mapping table.

[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0013] A computer-readable storage medium stores a computer program, which implements the various steps of the method for accelerating IO response when executed by a processor.

[0014] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0015] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for accelerating IO response when executing the computer program.

[0016] The beneficial effects of the present invention are as follows: since small IO requests are relatively frequent and random, if the existing normal access search is performed through the L2P mapping table, IO requests of different sizes are mixed together, and the small IO request is easily overwritten in the L2P mapping table in the memory, so that it is necessary to search the location in the hard disk, and the time overhead of accessing the hard disk is large, which slows down the response speed; by establishing a small data mapping table to specifically store small IO access data, the memory space occupied is small, and when a small IO request is received, the relevant information can be directly obtained from the small data mapping table, reducing the direct access to the physical storage device, so that the response to these requests can be accelerated with a smaller memory overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a method according to an embodiment of the present invention;

[0018] Figure 2 A schematic diagram of the structure of a mapping table entry according to an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a device according to an embodiment of the present invention;

[0020] Figure 4 The figure is a schematic diagram of the structure of a device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0022] A method for accelerating IO response includes the steps of: establishing a small data mapping table corresponding to data whose size is smaller than a first preset value; receiving IO access data, and searching through the small data mapping table if the IO access data is smaller than the first preset value.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are as follows: since small IO requests are relatively frequent and random, if the existing normal access search is performed through the L2P mapping table, IO requests of different sizes are mixed together, and small IO requests are easily overwritten in the L2P mapping table in the memory, so that it is necessary to search the location in the hard disk, and the time overhead of accessing the hard disk is large, which slows down the response speed; by establishing a small data mapping table to specifically store small IO access data, the memory space occupied is small, and when a small IO request is received, the relevant information can be directly obtained from the small data mapping table, reducing direct access to the physical storage device, so that the response to these requests can be accelerated with a smaller memory overhead.

[0024] Furthermore, the small data mapping table is a linked list structure; the searching through the small data mapping table includes: if the storage address corresponding to the IO access data cannot be found in the small data mapping table, the storage address is obtained from the disk and stored in the small data mapping table in association with the IO access data.

[0025] As can be seen from the above description, the small data mapping table is set as a linked list structure, and there is no need to pre-allocate a fixed-size memory space to store elements. If the corresponding storage address of the IO access data cannot be found, the storage address is obtained and stored in association with the IO access data, so as to update the small IO access data stored in the small data mapping table. When the same IO access data appears again, there is no need to obtain the storage address from the disk again, but the storage address is obtained from the small data mapping table, which improves efficiency and reduces response time.

[0026] Further, the storing in the small data mapping table in association with the IO data includes: if the small data mapping table is full, removing the first element from the linked list, and storing the storage address in association with the IO access data at the end of the small data mapping table.

[0027] From the above description, it can be seen that since the IO access that is less than the first preset value is relatively frequent and random, and the nodes in the linked list can be dynamically created and deleted as needed, when there is no extra space in the linked list, deleting the first element in the table is to delete the data first stored in the table. The earlier the node is stored in the linked list, the earlier the position is. Overwriting the earlier saved data helps to update, ensuring that the data in the table can effectively help reduce the burden on the system and delete mappings that may be used less frequently.

[0028] Furthermore, the establishing of the small data mapping table includes: storing the small data mapping table in a memory.

[0029] As can be seen from the above description, the small data mapping table is stored in the memory, and when an IO access is received, the small data mapping table can be quickly located to achieve rapid query of the IO access data, thereby improving the IO response speed.

[0030] Furthermore, the establishing of the small data mapping table includes: setting the maximum value of the space occupied by the nodes in the linked list structure to a second preset value.

[0031] From the above description, it can be seen that the amount of spatial data in the small data mapping table is not a fixed value. The space in the dynamic planning mapping table is realized. Since the amount of data written randomly each time is different and the content of each data to be recorded is different, the amount of spatial data required is not fixed. Only the maximum value of the space is limited, which effectively avoids the problem of resource waste caused by fixed space and makes reading and writing more flexible.

[0032] Further, searching through the small data mapping table includes: if the IO access data is not found in the small data mapping table, searching the IO access data in the P2L table.

[0033] From the above description, it can be seen that searching the data in the small data mapping table first is significantly different from searching in the P2L table first in the prior art, and if no data is found, searching in the L2P table on the SSD. If the data is searched in the L2P table, the firmware needs to read the table data first, then find the physical location, and finally read the data required by the host, resulting in a waste of time. The small data mapping table is in the memory, and the search speed is faster than the P2L table. Performing the search process in the small data mapping table first can avoid the waste of time resources.

[0034] Furthermore, the storage content of each node in the linked list structure includes a physical starting address, a logical starting address and a data length; the search through the small data mapping table includes: obtaining the pending logical address in the IO access data, and determining whether the pending logical address falls within the logical address range of the target node in the linked list structure, and if so, returning the physical actual address and data length in the target node; the logical address range is obtained through the logical starting address and data length in the target node.

[0035] From the above description, it can be seen that the physical starting address, logical starting address and data length are recorded in the small data mapping table, so that when the data existing in the small data mapping table is queried, the data can be directly accessed through the physical starting address, thereby realizing the operation of not needing to query the physical address in the hard disk.

[0036] Please refer to Figure 3 Another embodiment of the present invention provides a device for accelerating IO response, comprising:

[0037] An input module, used to establish a small data mapping table, wherein the small data mapping table corresponds to data whose size is smaller than a first preset value;

[0038] The search module is used to receive IO access data, and if the IO access data is smaller than a first preset value, search through the small data mapping table.

[0039] Another embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the various steps in the above-mentioned method for accelerating IO response.

[0040] Please refer to Figure 4 Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for accelerating IO response when executing the computer program.

[0041] The system deployment method, device, computer-readable storage medium and electronic device of the present invention can be applied to the field of solid-state hard disk data reading and writing, and are described below through specific implementation methods.

[0042] Please refer to Figure 1-2 , Embodiment 1 of the present invention is:

[0043] A method for accelerating IO response, comprising the steps of:

[0044] S1, establishing a small data mapping table, the small data mapping table corresponds to data whose size is smaller than a first preset value, storing the table in a memory, and setting the maximum value of the space occupied by the nodes in the linked list structure to a second preset value;

[0045] In an optional implementation, the number of groups of the linked list and the number of nodes in the linked list are determined according to the memory size and a first preset value; specifically, the available percentage of the memory size can be set as the upper limit of the occupied space of the entire small data mapping table; the total number of nodes in the linked list is calculated according to the first preset value and the upper limit of the occupied space, and the number of groups of the linked list is calculated according to the total number of nodes; for example, if the upper limit of the occupied space is 8MB and the first preset value is 4KB, the total number of nodes is 2048, that is, when establishing the small data mapping table, if IO information already exists, 2048 IO information are directly obtained to establish the small data mapping table, if IO information does not exist, an empty linked list to be used is first established; according to the calculation of 2048 summary points, a total of 32 groups are obtained, each group includes 64 nodes; if the upper limit of the occupied space is 512MB and the first preset value is 256KB, the number of summary points is 2048.

[0046] Among them, file nodes in the file system are usually managed with 4KB as the source data. When adding, deleting, reading or writing files, these file nodes are frequently updated and recorded in the small data mapping table. The next time they are accessed, they can be quickly hit in the cache and directly access the corresponding physical address, thereby improving the efficiency of modifying file nodes.

[0047] In an optional embodiment, if Figure 2 As shown, the small data mapping table is a linked list structure, the maximum value of the space occupied by each node in the linked list structure is a second preset value, and the storage content of each node in the linked list structure includes a physical start address, a logical start address, a data length, and a current node index; for example, the amount of data in the linked list structure space is no more than 16384 LBAs (Logical Block Address), the physical start address in each node occupies 4 bytes, the logical start address occupies 4 bytes, the data length occupies 2 bytes, the current node index occupies 2 bytes, corresponding to the number of records in the linked list to which the current node belongs, and also includes two pointers, one pointer points to the position of the previous record in the linked list, and the other pointer points to the position of the next record.

[0048] S2, receiving IO access data, if the IO access data is less than a first preset value, traversing the small data mapping table, judging whether the pending logical address in the IO access data falls within the logical address range of the target node in the linked list structure, if so, executing S3; if the traversal is completed and no target node matching the IO access data is found in the small data mapping table, executing S4;

[0049] In an optional implementation, first determine which group of the linked list structure the address to be found falls within, and then search for the address in the group after determination; for example, there are 2048 pieces of information in the linked list that need to be traversed, and the linked list is divided into 32 groups, each group stores 64 pieces of information in a certain range, then first determine which group of the 32 groups the address falls within based on the address range of each group, and then search for the address in the 64 pieces of information in the group.

[0050] S3. Obtain the logical address range through the logical starting address and data length in the target node, return the physical starting address and data length in the target node, and obtain the physical address according to the difference between the pending logical address and the logical starting address and the sum of the physical starting address.

[0051] In an optional implementation, it also includes:

[0052] When adding, deleting, reading or writing files, after obtaining the target node, directly access the physical location to modify the file node.

[0053] S4. If no target node matching the IO access data is found in the small data mapping table, it is determined whether there is excess space in the small data mapping table. If there is excess space, S41 is executed; otherwise, S42 is executed:

[0054] S41 . Query the physical address corresponding to the IO access data in the P2L on the RAM (cache), and associate the physical address with the IO access data and store them at the end of the mapping table.

[0055] In an optional implementation, it also includes:

[0056] If the storage address corresponding to the access data is not retrieved on the RAM, the physical address corresponding to the IO access data is queried in the L2P on the nand (disk), and the physical address is associated with the IO access data and stored at the end of the mapping table.

[0057] S42. Remove the first element from the small data mapping table and execute S41.

[0058] In an optional implementation, it also includes:

[0059] Remove the element with the least number of accesses from the small data mapping table, and execute S41;

[0060] In one usage scenario of the solution in this embodiment, after the amount of writing in the storage system exceeds the full disk capacity, the data in the disk needs to be erased to write new data, which may cause the erasure of multiple blocks to piece together a required storage size, and the data in the disk will begin to become chaotic. At this time, the host file system will usually start the file sorting function. At this time, if a performance testing tool is used to test random reads and sequential reads, in this process, the time when the host sorts out the dirty data of the file system before some system IO needs to perform a read operation will be very different from the range of the current random test. Using the solution in this embodiment can avoid searching for data from the disk as much as possible, thereby minimizing the impact of system IO on the test results.

[0061] Embodiment 2 of the present invention is:

[0062] A device for accelerating IO response, comprising:

[0063] An input module, used to establish a small data mapping table, wherein the small data mapping table corresponds to data whose size is smaller than a first preset value;

[0064] A search module, configured to receive IO access data, and if the IO access data is less than a first preset value, search through the small data mapping table;

[0065] The device is also configured to execute the various steps of the first embodiment, which will not be described in detail here.

[0066] Embodiment 3

[0067] A computer-readable storage medium stores a computer program, which implements the steps in the first embodiment when executed by a processor.

[0068] Embodiment 4

[0069] Please refer to Figure 3 , an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the first embodiment when executing the computer program.

[0070] In summary, the present invention provides a method, device, computer-readable storage medium and electronic device for accelerating IO response, including the following steps: establishing a small data mapping table, the small data mapping table corresponding to data whose data size is less than a first preset value; receiving IO access data, and if the IO access data is less than the first preset value, searching through the small data mapping table. By establishing a small data mapping table to store small IO access data and dynamically planning the space in the mapping table, the problem of resource waste caused by fixed space is effectively avoided, and it is realized that when an IO request is received, the small data mapping table can be searched, reducing direct access to physical storage devices, and accelerating the response to these requests through a smaller memory overhead, making reading and writing more flexible.

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

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

[0073] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0074] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0075] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0076] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0077] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for accelerating IO response, characterized in that: Includes steps: Establishing a small data mapping table, wherein the small data mapping table corresponds to data whose data size is smaller than a first preset value; IO access data is received, and if the IO access data is smaller than a first preset value, a search is performed through the small data mapping table.

2. A method for accelerating IO response according to claim 1, characterized in that: The small data mapping table is a linked list structure; The searching through the small data mapping table includes: if the storage address corresponding to the IO access data cannot be found in the small data mapping table, obtaining the storage address from the disk and storing it in the small data mapping table in association with the IO access data.

3. The method for accelerating IO response according to claim 2, wherein the storing in the small data mapping table in association with the IO access data comprises: If the small data mapping table is full, the first element is removed from the linked list, and the storage address and the IO access data are associated and stored at the end of the small data mapping table.

4. The method for accelerating IO response according to claim 1, characterized in that: The establishment of the small data mapping table comprises: The small data mapping table is stored in a memory.

5. The method for accelerating IO response according to claim 2, characterized in that: The establishment of the small data mapping table comprises: The maximum value of the space occupied by the nodes in the linked list structure is set to a second preset value.

6. The method for accelerating IO response according to claim 1, characterized in that: The searching through the small data mapping table includes: If the IO access data is not found in the small data mapping table, the IO access data is searched in the P2L table.

7. A method for accelerating IO response according to claim 2, wherein the storage content of each node in the linked list structure includes a physical start address, a logical start address and a data length; The searching through the small data mapping table includes: Obtaining a pending logical address in the IO access data, determining whether the pending logical address falls within the logical address range of the target node in the linked list structure, and if so, returning the physical address and data length in the target node; The logical address range is obtained by the logical start address and data length in the target node.

8. A device for accelerating IO response, characterized in that: include: An input module, used to establish a small data mapping table, wherein the small data mapping table corresponds to data whose size is smaller than a first preset value; The search module is used to receive IO access data, and if the IO access data is smaller than a first preset value, search through the small data mapping table.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for accelerating IO response as claimed in any one of claims 1 to 7 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step of the method for accelerating IO response as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Flash memory and data receiving method thereof

    CN102541755A

  • Method, device, equipment and medium for processing mapping table item

    CN108491335A

  • Database recovery method and device

    CN112988456A

  • Solid state disk processing method suitable for user requests of different sizes

    CN113377690A

  • Mapping table recovery method and device of solid state disk, computer equipment and storage medium

    CN114003438A