IO data storage method and device
The IO engine determines the IO request type and writes it into the appropriate storage mode, which solves the problem of wasted storage capacity in the existing technology and achieves the effects of high storage utilization and low storage cost.
Patent Information
- Application Number
- CN202311204020.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2024-10-18
AI Technical Summary
Existing IO data storage systems adopt multi-copy technology in mirror mode, which results in a waste of storage capacity and increases storage costs, especially in large-scale data storage systems.
Intercept the IO operation request of the target application system through the IO engine, determine the request type as frequent data writing or large-capacity data writing, and write it to the capacity of the performance storage system based on the multi-copy mirror mode or the erasure code slicing mode respectively. The storage system moves data from the performance storage system to the capacity storage system as the data reaches a preset capacity threshold.
While maintaining high read performance and reliability, it improves storage utilization, reduces the waste of storage capacity, reduces storage costs, and achieves the best balance between high storage utilization efficiency and high read performance.
Smart Images

Figure CN118796090A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to an IO data storage method and device. Background Art
[0002] As the amount of data increases, the requirements for data storage performance are also getting higher and higher. Currently, most IO data storage systems use multi-copy technology in mirror mode to implement data storage management, and achieve data redundancy protection through multiple copies while taking performance into consideration. Although storage technology based on mirror copies has advantages such as high read performance and reliability, it will lead to waste of storage capacity. Especially for large-scale data storage systems, the waste of storage capacity may be very significant. This waste may affect storage costs and may require more hard disks or storage devices to meet storage needs. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide an IO data storage method and device to solve the problem of high storage cost in existing IO data storage systems.
[0004] In order to solve the above technical problems, this specification is implemented as follows:
[0005] In a first aspect, an IO data storage method is provided, comprising:
[0006] Intercepting the IO operation request corresponding to the target application system through the IO engine and determining the type of the IO operation request, the type including frequent data writing request and large-capacity data writing request;
[0007] If the type is a frequent data write request, the data corresponding to the IO operation request is written into a performance storage system built based on a multi-copy mirror mode, or if the type is a large-capacity data write request, the data corresponding to the IO operation request is written into a capacity storage system built based on an erasure code slicing mode;
[0008] When the data stored on the performance storage device reaches a first preset capacity threshold, the target data stored on the performance storage device is moved to the capacity storage system.
[0009] Optionally, determine the type of the IO operation request, including:
[0010] Obtain the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request;
[0011] Determining the frequency of the IO operation requests based on the number of IO operation requests within the preset time period;
[0012] Determine the data size of the IO operation request based on the data size corresponding to each IO operation request;
[0013] When the frequency of the IO operation request is greater than a preset frequency threshold, determining that the type of the IO operation request is a frequent data write request;
[0014] When the data size of the IO operation request is greater than a preset threshold, it is determined that the type of the IO operation request is a large-capacity data write request.
[0015] Optionally, after obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, the method further includes:
[0016] Based on the capacity specifications of the underlying storage blocks, set IO classification labels for the data size corresponding to each IO operation request;
[0017] The capacity specification identified based on the IO classification tag is used as the data size corresponding to each IO operation request.
[0018] Optionally, after obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, the method further includes:
[0019] Acquire a merging parameter corresponding to the target application system, where the merging parameter is related to the type of the target application system;
[0020] Enlarging the data size corresponding to each IO operation request by a multiple corresponding to the merging parameter;
[0021] Based on the amplified data size corresponding to each I / O operation request, the size of the IO operation request data corresponding to the target application system is determined.
[0022] Optionally, writing the data corresponding to the IO operation request to a performance storage system built based on a multi-copy mirroring mode includes:
[0023] Based on the preset number of multi-copy mirrors, the data corresponding to the IO operation request is copied and stored on a corresponding number of performance storage nodes of the performance storage system.
[0024] Optionally, the performance storage node includes flash memory.
[0025] Optionally, the data corresponding to the IO operation request includes data and corresponding metadata, and the method further includes:
[0026] Writing metadata and corresponding pointer data into a preset area on the performance storage system to establish an index of data corresponding to the IO operation request;
[0027] When the metadata stored in the preset area reaches a second preset capacity threshold, the target metadata stored in the preset area is moved to the capacity storage system.
[0028] Optionally, writing large-capacity data to a capacity storage system built based on an erasure code slicing mode includes:
[0029] When the target bulk data satisfies full stripe writing, the target bulk data is written into the target erasure code slice of the capacity storage system.
[0030] Optionally, the erasure coded slice includes a physical hard disk.
[0031] In a second aspect, an IO data storage device is provided, comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0032] In a third aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0033] In an embodiment of the present application, an IO operation request corresponding to a target application system is intercepted by an IO engine and the type of the IO operation request is determined, the type including a frequent data write request and a large-capacity data write request; if the type is a frequent data write request, the data corresponding to the IO operation request is written into a performance storage system constructed based on a multi-copy mirror mode, or, if the type is a large-capacity data write request, the data corresponding to the IO operation request is written into a capacity storage system constructed based on an erasure code slicing mode; when the data stored on the performance storage device reaches a first preset capacity threshold, the target data stored on the performance storage device is moved to the capacity storage system, thereby not only improving storage utilization while taking into account high read performance and reliability, reducing waste of storage capacity, and thus reducing storage costs, but also achieving an optimal balance between high storage utilization and high read performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 It is a flowchart of the IO data storage method of an embodiment of the present application.
[0036] Figure 2This is one of the application scenario diagrams of the IO data storage method in an embodiment of the present application.
[0037] Figure 3 This is the second application scenario diagram of the IO data storage method of the embodiment of the present application.
[0038] Figure 4 It is a structural block diagram of an IO data storage device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. The numbering of the drawings in this application is only used to distinguish the various steps in the scheme, and is not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.
[0040] In order to solve the problems existing in the prior art, an embodiment of the present application provides an IO data storage method and device.
[0041] Figure 1 Schematic diagram of the IO data storage method of the embodiment of the present application. Figure 1 As shown, the following steps 102 to 106 are included.
[0042] Step 102: intercepting the IO operation request corresponding to the target application system through the IO engine and determining the type of the IO operation request, which includes frequent data writing request and large-capacity data writing request.
[0043] An IO operation request may be a request for writing large amounts of data, such as a video playback request, or a request for writing small files, such as a frequent data write request in a database or real-time data processing system. The types of IO operation requests include frequent data write requests and large-volume data write requests, and the types of IO operation requests are related to the request requirements of the target application system.
[0044] Combination Figure 2 In an embodiment of the present application, before writing the data 12 corresponding to the IO operation request, the IO operation request sent by the target application system is first intercepted by the IO engine 20 to identify whether the type of the IO operation request is a frequent data write request or a large-capacity data write request.
[0045] The IO engine 20 may be embedded in the memory for storage management, IO interception operation request and identification of IO characteristics.
[0046] Specifically, determining the type of the IO operation request includes: obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request; determining the frequency of the IO operation request based on the number of IO operation requests within the preset time period; determining the data size of the IO operation request based on the data size corresponding to each IO operation request; when the frequency of the IO operation request is greater than a preset frequency threshold, determining the type of the IO operation request to be a frequent data write request; when the data size of the IO operation request is greater than a preset threshold, determining the type of the IO operation request to be a large-capacity data write request.
[0047] The type of IO operation request needs to be determined based on the IO operation requests in a certain period of time. Usually, the target application system will send multiple continuous IO operation requests based on the user's target needs. For example, when requesting video playback, multiple IO operation requests are used to download multiple continuous data blocks of the corresponding video for playback. These IO operation request types are all requests for large-capacity data writing.
[0048] When determining the type of IO operation request, the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request can be obtained. According to the number of IO operation requests within the preset time period, the number of IO operation requests per unit time is calculated to determine the frequency of the IO operation request. For the type of frequent data write request, a frequency threshold can be set in advance. If the frequency threshold is exceeded, the type of each IO operation request is a frequent data write request.
[0049] For each IO operation request within a preset time period, the size of the data requested to be written corresponding to each IO operation request is determined respectively, and the average size of the data requested to be written corresponding to each IO operation request within the preset time period is calculated. For a type of large-capacity data write request, a capacity threshold can be set in advance. If the average size of the data requested to be written exceeds the capacity threshold, the type of each IO operation request is a large-capacity data write request.
[0050] Optionally, after obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, it also includes: setting an IO classification label for the data size corresponding to each IO operation request based on the capacity specification of the underlying storage block; and using the capacity specification identified based on the IO classification label as the data size corresponding to each IO operation request.
[0051] For example, if the capacity specifications of the underlying storage block are divided into 8K and 16K, the data size corresponding to the IO operation request is divided into three categories according to (1) less than 8K, (2) greater than 8K and less than 16K, and (3) greater than 16K. The data sizes corresponding to different IO operation requests are divided into three categories, and corresponding IO classification labels are set.
[0052] The maximum value of the capacity specification range is marked. For example, if the data size corresponding to the IO operation request is less than 8K, the value is 8K; if it is greater than 8K and less than 16K, the value is 16K; if it is greater than 16K, the value is directly taken according to the actual size. The capacity specification identified by the IO classification label can determine the data size corresponding to the corresponding IO operation request.
[0053] In one embodiment, after obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, it also includes: obtaining a merging parameter corresponding to the target application system, wherein the merging parameter is related to the type of the target application system; amplifying the data size corresponding to each IO operation request by a multiple corresponding to the merging parameter; and determining the size of the IO operation request data corresponding to the target application system based on the data size corresponding to each I / O operation request after amplification.
[0054] The merge parameter is related to the type of application system. Different types of application systems store different data. Some application systems are accessed by many people, and IO operation requests are usually frequent data write requests. In this case, the merge parameter can be set to a smaller value. Some application systems mainly store video files, and IO operation requests are usually large-capacity data write requests. In this case, the merge parameter can be set to a larger value.
[0055] The merge parameter is used to amplify the data size corresponding to the I / O operation request, and use the amplified data size as the data size corresponding to the IO operation request, and compare it with the preset threshold. This can highlight the gap between the data and the preset threshold, making it easier to determine whether the type of the I / O operation request corresponds to a frequent data write request or a large-capacity data write request.
[0056] After determining the data size corresponding to the IO operation request and the corresponding IO operation request type, the IO engine 20 can merge and pack the data blocks of the continuous data to obtain the corresponding IO merged package 14. Then, the corresponding write operation is performed based on the IO merged package 14.
[0057] Step 104: if the type is a frequent data write request, the data corresponding to the IO operation request is written into a performance storage system built based on a multi-copy mirror mode; or, if the type is a large-capacity data write request, the data corresponding to the IO operation request is written into a capacity storage system built based on an erasure code slicing mode.
[0058] In the embodiment of the present application, for different types of IO operation requests, different write storage methods are executed for the data requested to be written.
[0059] If the data writing request is frequent, the real-time requirement for data writing of IO operation request is high. Figure 2 and Figure 3 In an embodiment of the present application, data corresponding to frequent data write requests are written into a performance storage system 30 constructed based on a multi-copy mirror mode. The performance storage system can achieve fast data writing, reduce storage access latency, and achieve high read performance. At the same time, the performance storage system constructed in a multi-copy mirror mode can also achieve the advantages of redundant protection of written data, fast data recovery, fault tolerance, reliability, simplicity and ease of use, and data consistency. Therefore, the performance storage system constructed based on the multi-copy mirror mode is suitable for data writing of frequent data write requests.
[0060] Specifically, the data corresponding to the IO operation request is written to a performance storage system built based on a multi-copy mirror mode, including: based on a preset number of multi-copy mirrors, the data corresponding to the IO operation request is copied and stored on a corresponding number of performance storage nodes in the performance storage system.
[0061] refer to Figure 3 For the IO merged package 14 corresponding to the IO operation request, three copies M1, M2, and M3 are obtained through multi-copy mirroring and distributed and stored on different nodes of the performance storage system 30 to provide fast and high-performance IO data writing. Each node stores a complete copy of the IO merged package 14 data, and these copies are physically distributed in different locations, which may be located in different racks, servers, or data centers.
[0062] The performance storage system 30 includes a persistent log 35 composed of a data storage part and a metadata storage part. Figure 2 , the IO operation request is intercepted by the IO engine 20, and the continuous write data 12 is packaged and merged to obtain the IO merge package 14. Then, the IO merge package 14 is written to the persistent log 35. The IO operation written by the IO merge package 14 includes metadata Meta writing and data Data writing. After completing the IO operation on the persistent log 35, a fast write confirmation is immediately returned to the target application system to maintain low write latency.
[0063] Specifically, the performance storage node includes a flash memory, through which frequent access of IO operation requests of the target application system can be achieved.
[0064] Optionally, the data corresponding to the IO operation request includes data and corresponding metadata, and the method further includes: writing the metadata and the corresponding pointer data to a preset area on the performance storage system to establish an index of the data corresponding to the IO operation request; when the metadata stored in the preset area reaches a second preset capacity threshold, moving the target metadata stored in the preset area to the capacity storage system.
[0065] refer to Figure 2 and Figure 3 In this embodiment, the performance storage system 30 also includes a metadata log 32. After writing the data corresponding to the IO operation request, such as the IO merge package 14, into the metadata Meta and data Data of the permanent log, each metadata Meta written into the permanent log 35 can also be moved to the metadata log 32. And write the pointer data of each metadata Meta to track and record all mappings of the data Data and the metadata Meta (the lookup table of the logical block address to the physical block address). For example, a fast index of each metadata Meta and the corresponding data is established through a B-Tree, and the B-Tree is placed on the performance storage system 30.
[0066] The metadata Meta moved to the metadata log 32 is retained for a period of time, so that the immediate availability of a large amount of metadata can be maintained. When the metadata capacity on the metadata log 32 reaches a preset capacity threshold, for example, when the metadata log 32 is filled, the relatively early part of the metadata and the corresponding B-Tree structure can be written to the capacity storage system 40 constructed based on the erasure code slice mode, for example, in a stripe mode, according to the activity of the metadata or the time of moving to the metadata log 32, according to the first-in-first-out logic.
[0067] Next, a capacity storage system built based on the erasure code slicing mode is described.
[0068] After determining the type of the IO operation request in step 102, if it is a large-capacity data writing request, the storage cost requirement for the IO operation request for data writing is relatively high. Figure 2 and Figure 3 In an embodiment of the present application, data corresponding to a large-capacity data write request is written into a capacity storage system 40 constructed based on an erasure code slicing mode.
[0069] The complexity of erasure coding technology may increase the latency of write operations, and when performing write operations, redundant data needs to be calculated and updated, which will also increase the processing time of write operations. However, erasure coding technology can significantly improve the storage utilization of actual data storage capacity and reduce storage costs. At the same time, it has the advantages of high storage reliability, high efficiency, flexibility, strong scalability, bandwidth saving and good data availability. Therefore, the capacity storage system built based on the erasure code slicing mode is suitable for data writing of large-capacity data write requests.
[0070] Specifically, writing bulk data to a capacity storage system constructed based on an erasure code slice mode includes: when the target bulk data satisfies full stripe writing, writing the target bulk data to a target erasure code slice of the capacity storage system.
[0071] refer to Figure 3 For the IO merged package 14 corresponding to the IO operation request, the original data of the IO merged package 14 is divided into multiple data blocks, such as data block A, data block B, data block C, data block D, data block P and data block Q, through the erasure code slicing technology, and an additional check block is generated to achieve data redundancy and error repair. These data blocks and check blocks are distributed on different storage devices or servers to provide redundant backup of data and obtain sliced data.
[0072] When writing a data block of large-capacity data into an erasure coded slice, if the target data block satisfies full stripe write, the target data block is written into a separate erasure coded slice in full stripe mode, thereby avoiding additional write amplification for read-modify-write and reducing all known overheads of partial read-modify-write, thereby reducing the amount of data transmitted in the network.
[0073] Specifically, the erasure code slice includes a physical hard disk, through which large-capacity data access requested by an IO operation of a target application system can be implemented.
[0074] Step 106: When the data stored on the performance storage device reaches a first preset capacity threshold, move the target data stored on the performance storage device to the capacity storage system.
[0075] As described above, the performance storage device is used to store data with frequent data write requests to achieve fast IO data writing. However, the capacity of the performance storage device is limited. When the new IO data accumulates in the persistent log 35 and reaches a preset capacity threshold, the relatively early partial data Data and the corresponding metadata Meta can be written to the capacity storage system 40 built based on the erasure code slicing mode according to the order of writing to the persistent log 35 and the first-in-first-out logic, for example, aligned and complete stripe writing in the form of erasure code can be performed to achieve efficient data writing.
[0076] In an embodiment of the present application, an IO operation request corresponding to a target application system is intercepted by an IO engine and the type of the IO operation request is determined, the type including a frequent data write request and a large-capacity data write request; if the type is a frequent data write request, the data corresponding to the IO operation request is written into a performance storage system constructed based on a multi-copy mirror mode, or, if the type is a large-capacity data write request, the data corresponding to the IO operation request is written into a capacity storage system constructed based on an erasure code slicing mode; when the data stored on the performance storage device reaches a first preset capacity threshold, the target data stored on the performance storage device is moved to the capacity storage system, thereby not only improving storage utilization while taking into account high read performance and reliability, reducing waste of storage capacity, and thus reducing storage costs, but also achieving an optimal balance between high storage utilization and high read performance.
[0077] Alternatively, if Figure 4 As shown, an embodiment of the present application also provides an IO data storage device 2000, including a processor 2400 and a memory 2200, and the memory 2200 stores a program or instruction that can be run on the processor 2400. When the program or instruction is executed by the processor 2400, the various steps of the above-mentioned IO data storage method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0078] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of any of the above-mentioned IO data storage method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the readable storage medium includes a computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0079] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0081] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for storing IO data, It is characterized in that include: Intercepting the IO operation request corresponding to the target application system through the IO engine and determining the type of the IO operation request, the type including frequent data writing request and large-capacity data writing request; If the type is a frequent data write request, the data corresponding to the IO operation request is written into a performance storage system built based on a multi-copy mirror mode, or if the type is a large-capacity data write request, the data corresponding to the IO operation request is written into a capacity storage system built based on an erasure code slicing mode; When the data stored on the performance storage device reaches a first preset capacity threshold, the target data stored on the performance storage device is moved to the capacity storage system.
2. The method according to claim 1, It is characterized in that Determine the type of IO operation request, including: Obtain the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request; Determining the frequency of the IO operation requests based on the number of IO operation requests within the preset time period; Determine the data size of the IO operation request based on the data size corresponding to each IO operation request; When the frequency of the IO operation request is greater than a preset frequency threshold, determining that the type of the IO operation request is a frequent data write request; When the data size of the IO operation request is greater than a preset threshold, it is determined that the type of the IO operation request is a large-capacity data write request.
3. The method according to claim 2, It is characterized in that After obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, the method further includes: Based on the capacity specifications of the underlying storage blocks, set IO classification labels for the data size corresponding to each IO operation request; The capacity specification identified based on the IO classification tag is used as the data size corresponding to each IO operation request.
4. The method according to claim 2 or 3, It is characterized in that After obtaining the number of IO operation requests within a preset time period and the data size corresponding to each IO operation request, the method further includes: Acquire a merging parameter corresponding to the target application system, where the merging parameter is related to the type of the target application system; Enlarging the data size corresponding to each IO operation request by a multiple corresponding to the merging parameter; Based on the amplified data size corresponding to each I / O operation request, the size of the IO operation request data corresponding to the target application system is determined.
5. The method according to claim 1, It is characterized in that Writing the data corresponding to the IO operation request to a performance storage system built based on a multi-copy mirroring mode includes: Based on a preset number of multi-copy images, the data corresponding to the IO operation request is copied and stored on a corresponding number of performance storage nodes of the performance storage system.
6. The method according to claim 5, It is characterized in that The performance storage node includes flash memory.
7. The method according to claim 5, It is characterized in that The data corresponding to the IO operation request includes data and corresponding metadata, and the method further includes: Writing metadata and corresponding pointer data into a preset area on the performance storage system to establish an index of data corresponding to the IO operation request; When the metadata stored in the preset area reaches a second preset capacity threshold, the target metadata stored in the preset area is moved to the capacity storage system.
8. The method according to claim 1, It is characterized in that Writing large amounts of data to a capacity storage system built on an erasure code slicing model includes: When the target bulk data satisfies full stripe writing, the target bulk data is written into the target erasure code slice of the capacity storage system.
9. The method according to claim 8, It is characterized in that The erasure coded slice includes a physical hard disk.
10. An IO data storage device, It is characterized in that include: A memory and a processor electrically connected to the memory, wherein the memory stores a program or instruction that can be executed by the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.
