A data access method, device and medium based on multi-thread concurrency

By dividing storage area groups according to the number and proportion of concurrent threads, and writing to the target area group concurrently, the difficulty of multi-thread writing in zones is solved, system performance and QoS are improved, and logically simple data storage conversion is realized.

CN112463333BActive Publication Date: 2024-10-22BEIJING INSPUR DATA TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202011395097.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2024-10-22
Estimated Expiration
2040-12-03

AI Technical Summary

Technical Problem

The existing zone multi-thread writing solution based on the append command requires modifying the logical block address of the application, which makes it difficult and poses great challenges to existing application interfaces and usage methods.

Method used

By dividing multiple storage areas into at least one area group based on the number of concurrent threads on the host side and the preset proportional relationship, starting all storage areas in the target area group, and calling multiple write threads to concurrently I/O data When writing to the target area group, the read address is determined by using the corresponding relationship between the logical block address and the starting address of the target area group and the number of target storage areas included.

Benefits of technology

It reduces the difficulty of zone multi-thread writing, improves the business performance and QoS of the system, and realizes simple conversion of data storage location relationships without additional performance overhead or storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112463333B_ABST
    Figure CN112463333B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data access method, device and medium based on multi-threaded concurrency, which divides multiple storage areas into at least one area group according to the number of concurrent threads on the host side and a preset proportional relationship. When an I / O write task is received, all target storage areas in the target area group are started, and multiple write threads are called to concurrently write the I / O data to the target area group; wherein each I / O data has its corresponding logical block address. The read address of each I / O data can be determined by using the correspondence between the logical block address and the starting address of the target area group and the number of target storage areas contained in the target area group. By simultaneously opening all storage areas in the area group, the problem of concurrent zone writing is solved. The data storage location relationship can be obtained through a simple conversion without additional performance overhead or additional storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data storage technology, and in particular to a data access method, device and computer-readable storage medium based on multi-thread concurrency. Background Art

[0002] Solid State Drives (SSD) are hard disks made of solid-state electronic storage chip arrays. Their I / O performance is greatly improved compared to traditional hard disks, so they are widely used. The purpose of the open channel SSD standard is to allow the host to obtain better usage configuration while managing SSDs, but the standard exposes too many details to the host, bringing too much burden to the host, and even the software needs to deal with the differences between different manufacturers and different media.

[0003] NVMe Zoned Namespaces (NVMe ZNS) divides the flash memory into multiple storage areas (zones), and can store data with the same attributes in each zone. As a product that integrates the advantages of "open channel ssd2.0", NVMe ZNS technology has a good balance between the efficient use of SSDs and the ease of use of hosts.

[0004] However, the existing solution to implement "zone multi-threaded writing" based on the append command requires modifying the original logical block address (Logical Block Address, LBA) of the application, which is a major challenge to the update of existing application interfaces and usage methods.

[0005] It can be seen that how to reduce the difficulty of zone multi-threaded writing is a problem that technical personnel in this field need to solve. Summary of the invention

[0006] The purpose of the embodiments of the present invention is to provide a data access method, device and computer-readable storage medium based on multi-threaded concurrency, which can reduce the difficulty of zone multi-threaded writing.

[0007] In order to solve the above technical problems, an embodiment of the present invention provides a data access method based on multi-thread concurrency, comprising:

[0008] Dividing the plurality of storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio relationship;

[0009] When an I / O write task is received, all target storage areas in the target area group are started, and multiple write threads are called to concurrently write I / O data into the target area group; wherein each I / O data has its corresponding logical block address; and the target area group is any free area group among all the area groups;

[0010] The read address of each I / O data is determined by using the corresponding relationship between the logical block address, the start address of the target area group, and the number of target storage areas included in the target area group.

[0011] Optionally, the determining the read address of each I / O data by using the correspondence between the logical block address and the start address of the target area group and the number of target storage areas included in the target area group comprises:

[0012] According to the following corresponding relationship formula, determine the reading address of I / O data;

[0013] LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2;

[0014] Among them, LBA represents the logical block address of the I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of the I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

[0015] Optionally, for the adjustment process of the proportional relationship, the method includes:

[0016] According to the preset number of groups, calculate the actual ratio of the number of storage areas in each group to the number of concurrent threads;

[0017] Determine whether the actual ratio is greater than the ratio of the storage area to the thread;

[0018] If the actual ratio is greater than the ratio of the storage area to the thread, increasing the value of the ratio;

[0019] If the actual ratio is smaller than the ratio of the storage area to the thread, the ratio is adjusted to be smaller.

[0020] Optionally, before reducing the value of the ratio, the method further includes:

[0021] Determining whether the preset number of groups is less than a preset limit;

[0022] If the preset number of groups is less than the preset limit, the step of reducing the value of the ratio is performed;

[0023] If the preset number of groups is not less than the preset limit, the value of the number of groups is reduced, and the number of groups after the reduced value is used as the preset number of groups, and the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups is executed.

[0024] Optionally, after calling multiple writing threads to concurrently write the I / O data into the target area group, the method further includes:

[0025] Determining whether there is remaining storage space in the target area group;

[0026] If the target area group does not have any remaining storage space, a non-free flag is set for the target area group, and it is determined whether there is any I / O data for which the write operation has not been completed;

[0027] If there is I / O data for which the write operation has not been completed, a new free area group is called, all storage areas in the new free area group are started, and multiple write threads are called to concurrently write the I / O data into the new free area group until the write operation of all I / O data is completed.

[0028] The embodiment of the present invention also provides a data access device based on multi-thread concurrency, including a partitioning unit, a starting unit, a calling unit and a determining unit;

[0029] The division unit is used to divide the multiple storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio relationship;

[0030] The starting unit is used to start all target storage areas in the target area group when receiving an I / O write task;

[0031] The calling unit is used to call multiple writing threads to concurrently write I / O data into the target area group; wherein each I / O data has its corresponding logical block address; and the target area group is any free area group among all the area groups;

[0032] The determining unit is used to determine the read address of each I / O data by using the corresponding relationship between the logical block address, the start address of the target area group, and the number of target storage areas included in the target area group.

[0033] Optionally, the determining unit is specifically used to determine the read address of the I / O data according to the following corresponding relationship formula;

[0034] LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2;

[0035] Among them, LBA represents the logical block address of the I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of the I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

[0036] Optionally, for the adjustment process of the proportional relationship, the device includes a calculation unit, a judgment unit, a first adjustment unit and a second adjustment unit;

[0037] The calculation unit is used to calculate the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups;

[0038] The judging unit is used to judge whether the actual ratio is greater than the ratio of the storage area to the thread;

[0039] The first adjustment unit is used to increase the value of the ratio if the actual ratio is greater than the ratio of the storage area to the thread.

[0040] The second adjustment unit is used to reduce the value of the ratio if the actual ratio is smaller than the ratio of the storage area to the thread.

[0041] Optionally, it also includes a number judgment unit and a third adjustment unit;

[0042] The number determination unit is used to determine whether the preset number of groups is less than a preset limit; if the preset number of groups is less than the preset limit, the second adjustment unit is triggered to execute the step of reducing the value of the ratio value;

[0043] The third adjustment unit is used to reduce the value of the number of groups if the preset number of groups is not less than the preset limit, and use the number of groups after the reduction as the preset number of groups, and trigger the calculation unit to execute the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups.

[0044] Optionally, after calling multiple writing threads to concurrently write the I / O data into the target area group, a space judgment unit, a marking unit and an operation judgment unit are further included;

[0045] The space determination unit is used to determine whether there is remaining storage space in the target area group;

[0046] The marking unit is configured to set a non-free flag for the target area group if there is no remaining storage space in the target area group;

[0047] The operation determination unit is used to determine whether there is I / O data for which the write operation has not been completed;

[0048] The startup unit is also used to call a new idle area group and start all storage areas in the new idle area group if there is I / O data that has not completed the write operation;

[0049] The calling unit is also used to call multiple writing threads to concurrently write the I / O data into the new free area group until the writing operation of all I / O data is completed.

[0050] The embodiment of the present invention further provides a data access device based on multi-thread concurrency, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to execute the computer program to implement the steps of any one of the above-mentioned multi-threaded concurrent data access methods.

[0053] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-threaded concurrent data access method as described in any one of the above are implemented.

[0054] It can be seen from the above technical solution that multiple storage areas are divided into at least one area group according to the number of concurrent threads on the host side and the preset proportional relationship; by dividing the area groups, multiple storage areas in one area group can be opened in parallel, so that when an I / O write task is received, any free area group in all area groups can be used as the target area group, all target storage areas in the target area group can be started, and multiple write threads can be called to concurrently write I / O data to the target area group; wherein each I / O data has its corresponding logical block address. The starting address of each area group and the number of storage areas contained in the area group are known information, so the corresponding relationship between the logical block address and the starting address of the target area group and the number of target storage areas contained in the target area group can be used to determine the read address of each I / O data, thereby realizing the reading of I / O data. This technical solution solves the problem of concurrent zone writing by dividing the area group and opening all storage areas in the area group at the same time, so that the service performance and QoS of the system are greatly improved. In addition, the data storage location relationship can be obtained through simple conversion, and the software implementation logic is simple, without additional performance overhead or additional storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A flowchart of a data access method based on multi-thread concurrency provided by an embodiment of the present invention;

[0057] Figure 2 A schematic diagram of the structure of a data access device based on multi-thread concurrency provided by an embodiment of the present invention;

[0058] Figure 3 A schematic diagram of the hardware structure of a data access device based on multi-thread concurrency provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0061] Next, a data access method based on multi-thread concurrency provided by an embodiment of the present invention is described in detail. Figure 1 A flowchart of a data access method based on multi-thread concurrency provided by an embodiment of the present invention, the method comprising:

[0062] S101: Divide a plurality of storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio.

[0063] The preset ratio relationship refers to the ratio relationship between storage areas and threads. For example, the ratio relationship between storage areas and threads can be set to 1:1, that is, one thread corresponds to one storage area; or the ratio relationship between storage areas and threads can be set to 3:1, that is, one thread corresponds to three storage areas.

[0064] The number of storage areas corresponding to one thread can be known according to the proportional relationship, and the product of the number and the number of concurrent threads on the host side is the number of storage areas included in one area group.

[0065] S102: When an I / O write task is received, all target storage areas in the target area group are started, and multiple write threads are called to concurrently write I / O data into the target area group.

[0066] Each I / O data has its corresponding logical block address when it is stored in the target area group. The target area group is any free area group among all area groups. For the sake of distinction, in the embodiment of the present invention, the storage area included in the target area group is referred to as the target storage area.

[0067] Each thread has its corresponding storage area. By starting all target storage areas in the target area group, multiple storage areas can be started at the same time, thereby ensuring that multiple parallel write threads write data to the corresponding target storage areas at the same time, realizing multi-threaded parallel processing.

[0068] S103: Determine the read address of each I / O data by using the correspondence between the logical block address, the start address of the target area group, and the number of target storage areas included in the target area group.

[0069] Each I / O data has its corresponding logical block address (Logical Block Address, LBA). When the I / O data needs to be read from the target area group, the corresponding read address of the I / O data in the target area group needs to be obtained.

[0070] In practical applications, the read address of I / O data can be determined according to the following corresponding relationship formula;

[0071] LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2;

[0072] Among them, LBA represents the logical block address of I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

[0073] In a specific implementation, under the premise that the logical block address of the I / O data, the starting address of the target area group where the I / O data is located, and the number of target storage areas contained in the target area group are known, the difference between the logical block address and the starting address of the target area group is divided by the number of target storage areas to obtain a quotient and a remainder, where the quotient is the serial number of the storage area where the I / O data is located in the target area group, and the remainder is the offset of the I / O data in the storage area where the I / O data is located.

[0074] In the embodiment of the present invention, in order to make the divided area groups more in line with actual business needs, the preset ratio relationship can be dynamically adjusted. In a specific implementation, the actual ratio of the number of storage areas to the number of concurrent threads in each group can be calculated according to the preset number of groups; and it is determined whether the actual ratio is greater than the ratio of storage areas to threads.

[0075] The preset number of groups refers to the number of area groups to be divided. The value of the preset number of groups can be set according to actual needs and is not limited here.

[0076] If the actual ratio is greater than the ratio of the storage area to the thread, it means that the number of area groups divided according to the current ratio is large, which may cause frequent switching of area groups when executing data reading and writing. Therefore, if the actual ratio is greater than the ratio of the storage area to the thread, the ratio value can be increased.

[0077] There are many ways to increase the ratio value. For example, the actual ratio can be directly used as the increased ratio value; or 1 can be added to the original ratio value. For example, if the original storage area to thread ratio is 3:1, the storage area to thread ratio can be increased to 4:1.

[0078] If the actual ratio is smaller than the ratio of storage area to thread, it means that the number of area groups divided according to the current ratio will be small. When executing data reading and writing, it may cause the data set to be stored in a certain area group, resulting in low utilization of other area groups. Therefore, if the actual ratio is smaller than the ratio of storage area to thread, the ratio value can be adjusted down.

[0079] The method of reducing the ratio value is similar to the method of increasing the ratio value. For example, the actual ratio can be directly used as the reduced ratio value; or 1 can be reduced based on the original ratio value. For example, if the original storage area to thread ratio is 3:1, the storage area to thread ratio can be reduced to 2:1.

[0080] It should be noted that in the embodiment of the present invention, the preset number of groups is only used as a basis for adjusting the ratio of storage areas to threads. In actual applications, there is no need to group the storage areas according to the preset number of groups, but the storage areas are divided into area groups according to the ratio of storage areas to threads.

[0081] In the embodiment of the present invention, the preset number of groups is only used as a basis for adjusting the ratio of the storage area to the thread. In practical applications, the value of the preset number of groups can be adjusted. Therefore, before reducing the value of the ratio, it can be determined whether the preset number of groups is less than the preset limit. The preset limit can be the minimum value of the area group.

[0082] If the preset number of groups is less than the preset limit, the step of reducing the ratio value is executed; if the preset number of groups is not less than the preset limit, the value of the number of groups can be reduced, and the number of groups after the reduction is used as the preset number of groups, and the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads is executed according to the preset number of groups.

[0083] By relying on the actual ratio of the number of preset groups, the number of storage areas in each group and the number of concurrent threads, and dynamically adjusting the ratio of storage areas to threads, the division of regional groups can be more in line with actual business needs and the performance of each storage area can be fully utilized.

[0084] It can be seen from the above technical solution that multiple storage areas are divided into at least one area group according to the number of concurrent threads on the host side and the preset proportional relationship; by dividing the area groups, multiple storage areas in one area group can be opened in parallel, so that when an I / O write task is received, any free area group in all area groups can be used as the target area group, all target storage areas in the target area group can be started, and multiple write threads can be called to concurrently write I / O data to the target area group; wherein each I / O data has its corresponding logical block address. The starting address of each area group and the number of storage areas contained in the area group are known information, so the corresponding relationship between the logical block address and the starting address of the target area group and the number of target storage areas contained in the target area group can be used to determine the read address of each I / O data, thereby realizing the reading of I / O data. This technical solution solves the problem of concurrent zone writing by dividing the area group and opening all storage areas in the area group at the same time, so that the service performance and QoS of the system are greatly improved. In addition, the data storage location relationship can be obtained through simple conversion, and the software implementation logic is simple, without additional performance overhead or additional storage space.

[0085] In the embodiment of the present invention, in order to ensure the orderly storage of data and the effective management of the area group, after calling multiple writing threads to concurrently write I / O data into the target area group, it is possible to determine whether there is any remaining storage space in the target area group. If there is no remaining storage space in the target area group, a non-free flag is set for the target area group, and it is determined whether there is any I / O data for which the writing operation has not been completed.

[0086] If there is I / O data for which the write operation has not been completed, it means that there is still I / O data that needs to be stored. At this time, a new free area group can be called, all storage areas in the new free area group can be started, and multiple write threads can be called to concurrently write the I / O data to the new free area group until the write operation of all I / O data is completed.

[0087] The idle area group refers to an area group for which no non-idle flag is set.

[0088] By detecting the remaining storage space of the area group, it is possible to promptly detect that the area group is full, so that the unwritten data can be written to the new free area group in time, ensuring the orderly execution of data writing. By setting a non-free mark for the full area group, the storage system can quickly filter out the currently available free area groups, thereby improving the data processing efficiency of the storage system.

[0089] Figure 2A schematic diagram of the structure of a data access device based on multi-thread concurrency provided by an embodiment of the present invention, comprising a division unit 21, a startup unit 22, a calling unit 23 and a determination unit 24;

[0090] A division unit 21, configured to divide the plurality of storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio relationship;

[0091] A starting unit 22, configured to start all target storage areas in the target area group when receiving an I / O write task;

[0092] The calling unit 23 is used to call multiple writing threads to concurrently write the I / O data into the target area group; wherein each I / O data has its corresponding logical block address; the target area group is any free area group among all area groups;

[0093] The determination unit 24 is used to determine the read address of each I / O data by using the correspondence between the logical block address, the start address of the target area group, and the number of target storage areas included in the target area group.

[0094] Optionally, the determining unit is specifically used to determine the read address of the I / O data according to the following corresponding relationship formula;

[0095] LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2;

[0096] Among them, LBA represents the logical block address of I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

[0097] Optionally, for the adjustment process of the proportional relationship, the device includes a calculation unit, a judgment unit, a first adjustment unit and a second adjustment unit;

[0098] A calculation unit, used for calculating an actual ratio of the number of storage areas in each group to the number of concurrent threads according to a preset number of groups;

[0099] A judging unit, used for judging whether the actual ratio is greater than the ratio of the storage area to the thread;

[0100] The first adjustment unit is used to increase the value of the ratio if the actual ratio is greater than the ratio of the storage area to the thread.

[0101] The second adjustment unit is used to reduce the value of the ratio if the actual ratio is smaller than the ratio of the storage area to the thread.

[0102] Optionally, it also includes a number judgment unit and a third adjustment unit;

[0103] A number determination unit, used to determine whether the number of preset groups is less than a preset limit; if the number of preset groups is less than the preset limit, triggering the second adjustment unit to execute the step of adjusting the value of the ratio down;

[0104] The third adjustment unit is used to reduce the value of the number of groups if the preset number of groups is not less than the preset limit, and use the number of groups after the reduction as the preset number of groups, and trigger the calculation unit to execute the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups.

[0105] Optionally, after calling multiple writing threads to concurrently write I / O data into the target area group, a space judgment unit, a marking unit and an operation judgment unit are also included;

[0106] A space determination unit, used to determine whether there is remaining storage space in the target area group;

[0107] A marking unit, used for setting a non-free mark for the target area group if there is no remaining storage space in the target area group;

[0108] An operation determination unit, used to determine whether there is I / O data for which a write operation has not been completed;

[0109] The startup unit is also used to call a new free area group and start all storage areas in the new free area group if there is I / O data for which the write operation has not been completed;

[0110] The calling unit is also used to call multiple writing threads to concurrently write the I / O data into the new free area group until the writing operation of all the I / O data is completed.

[0111] Figure 2 The description of the features in the corresponding embodiments can be found in Figure 1 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.

[0112] It can be seen from the above technical solution that multiple storage areas are divided into at least one area group according to the number of concurrent threads on the host side and the preset proportional relationship; by dividing the area groups, multiple storage areas in one area group can be opened in parallel, so that when an I / O write task is received, any free area group in all area groups can be used as the target area group, all target storage areas in the target area group can be started, and multiple write threads can be called to concurrently write I / O data to the target area group; wherein each I / O data has its corresponding logical block address. The starting address of each area group and the number of storage areas contained in the area group are known information, so the corresponding relationship between the logical block address and the starting address of the target area group and the number of target storage areas contained in the target area group can be used to determine the read address of each I / O data, thereby realizing the reading of I / O data. This technical solution solves the problem of concurrent zone writing by dividing the area group and opening all storage areas in the area group at the same time, so that the service performance and QoS of the system are greatly improved. In addition, the data storage location relationship can be obtained through simple conversion, and the software implementation logic is simple, without additional performance overhead or additional storage space.

[0113] Figure 3 A hardware structure diagram of a multi-threaded concurrent data access device 30 provided in an embodiment of the present invention includes:

[0114] A memory 31, used for storing computer programs;

[0115] The processor 32 is used to execute a computer program to implement the steps of the multi-threaded concurrent data access method as described in any of the above embodiments.

[0116] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-threaded concurrent data access method as described in any of the above embodiments are implemented.

[0117] The above is a detailed introduction to a data access method, device and computer-readable storage medium based on multi-threaded concurrency provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0119] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims

1. A data access method based on multi-thread concurrency, characterized in that: include: Dividing the plurality of storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio relationship; When an I / O write task is received, all target storage areas in the target area group are started, and multiple write threads are called to concurrently write I / O data into the target area group; wherein each I / O data has its corresponding logical block address; and the target area group is any free area group among all the area groups; Determine the read address of each I / O data by using the correspondence between the logical block address, the start address of the target area group, and the number of target storage areas included in the target area group; Regarding the adjustment process of the proportional relationship, the method includes: According to the preset number of groups, calculate the actual ratio of the number of storage areas in each group to the number of concurrent threads; Determine whether the actual ratio is greater than the ratio of the storage area to the thread; If the actual ratio is greater than the ratio of the storage area to the thread, it indicates that the area group will be frequently switched when executing data reading and writing, and the value of the ratio is increased; If the actual ratio is smaller than the ratio of the storage area to the thread, it means that the data will be stored in a certain area group when the data is read and written, resulting in a low utilization rate of other area groups, and the ratio is adjusted to a smaller value; Before reducing the value of the ratio, the method further includes: Determining whether the preset number of groups is less than a preset limit; If the preset number of groups is less than the preset limit, the step of reducing the value of the ratio is performed; If the preset number of groups is not less than the preset limit, the value of the number of groups is reduced, and the number of groups after the reduced value is used as the preset number of groups, and the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups is executed.

2. The data access method based on multi-thread concurrency according to claim 1, characterized in that: Determining the read address of each I / O data by using the correspondence between the logical block address and the start address of the target area group and the number of target storage areas included in the target area group includes: According to the following corresponding relationship formula, determine the reading address of I / O data; LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2; Among them, LBA represents the logical block address of the I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of the I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

3. The data access method based on multi-thread concurrency according to claim 1 or 2, characterized in that: After calling multiple writing threads to concurrently write the I / O data into the target area group, the method further includes: Determining whether there is remaining storage space in the target area group; If the target area group does not have any remaining storage space, a non-free flag is set for the target area group, and it is determined whether there is any I / O data for which the write operation has not been completed; If there is I / O data for which the write operation has not been completed, a new free area group is called, all storage areas in the new free area group are started, and multiple write threads are called to concurrently write the I / O data into the new free area group until the write operation of all I / O data is completed.

4. A data access device based on multi-thread concurrency, characterized in that: It includes a division unit, a start unit, a call unit and a determination unit; The division unit is used to divide the multiple storage areas into at least one area group according to the number of concurrent threads on the host side and a preset ratio relationship; The starting unit is used to start all target storage areas in the target area group when receiving an I / O write task; The calling unit is used to call multiple writing threads to concurrently write I / O data into the target area group; wherein each I / O data has its corresponding logical block address; and the target area group is any free area group among all the area groups; The determining unit is used to determine the read address of each I / O data by using the corresponding relationship between the logical block address and the start address of the target area group and the number of target storage areas included in the target area group; With respect to the adjustment process of the proportional relationship, the device includes a calculation unit, a judgment unit, a first adjustment unit and a second adjustment unit; The calculation unit is used to calculate the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups; The judging unit is used to judge whether the actual ratio is greater than the ratio of the storage area to the thread; The first adjustment unit is configured to increase the value of the ratio if the actual ratio is greater than the ratio of the storage area to the thread, indicating that frequent switching of the area group will occur when executing data reading and writing; The second adjustment unit is configured to reduce the value of the ratio if the actual ratio is smaller than the ratio of the storage area to the thread, indicating that the data will be stored in a certain area group when the data is read and written, resulting in a lower utilization rate of other area groups; It also includes a number judgment unit and a third adjustment unit; The number determination unit is used to determine whether the preset number of groups is less than a preset limit; if the preset number of groups is less than the preset limit, the second adjustment unit is triggered to execute the step of reducing the value of the ratio value; The third adjustment unit is used to reduce the value of the number of groups if the preset number of groups is not less than the preset limit, and use the number of groups after the reduction as the preset number of groups, and trigger the calculation unit to execute the step of calculating the actual ratio of the number of storage areas in each group to the number of concurrent threads according to the preset number of groups.

5. The data access device based on multi-thread concurrency according to claim 4, characterized in that: The determining unit is specifically used to determine the read address of the I / O data according to the following corresponding relationship formula; LBA=ZGSLBA+ZGCAP*ZOFFSET+ZINDEX2; Among them, LBA represents the logical block address of the I / O data, ZGSLBA represents the starting address of the target area group, ZGCAP represents the number of target storage areas contained in the target area group, the read address of the I / O data includes ZOFFSET and ZINDEX2, ZINDEX2 represents the serial number of the storage area where the I / O data is located in the target area group, and ZOFFSET represents the offset of the I / O data in the storage area where it is located.

6. The multi-threaded concurrent data access device according to claim 4 or 5, characterized in that: It also includes a space judgment unit, a marking unit and an operation judgment unit; The space determination unit is used to determine whether there is remaining storage space in the target area group; The marking unit is configured to set a non-free flag for the target area group if there is no remaining storage space in the target area group; The operation determination unit is used to determine whether there is I / O data for which the write operation has not been completed; The startup unit is also used to call a new idle area group and start all storage areas in the new idle area group if there is I / O data that has not completed the write operation; The calling unit is also used to call multiple writing threads to concurrently write the I / O data into the new free area group until the writing operation of all the I / O data is completed.

7. A data access device based on multi-thread concurrency, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the multi-threaded concurrent data access method as described in any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the multi-threaded concurrent data access method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Initialization performance improvement method of redundant arrays of inexpensive disks

    CN103645862A

  • Method and device for processing data and storage system

    CN106201355A

  • Method, device and apparatus for realizing data additional writing

    CN109032512A

  • Lock-free shared memory processing method and device, electronic equipment and readable storage medium

    CN110287044A

  • Data processing method, device and equipment based on address relation table

    CN111443875A