A distributed storage method and system based on a Netty framework

By utilizing the asynchronous I/O technology and data sharding method of the Netty framework, the network overhead caused by frequent data synchronization in distributed storage systems is solved, thereby improving system performance and data processing efficiency.

CN116760849BActive Publication Date: 2026-01-13CHENGDU SHULIANYUNSUAN TECH CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310990966.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2026-01-13
Estimated Expiration
2043-08-08

AI Technical Summary

Technical Problem

In distributed storage systems, frequent data synchronization between nodes can lead to significant network overhead, resulting in decreased system performance or even system failure.

Method used

It adopts asynchronous I/O technology based on the Netty framework, establishes a resource pool to cache I/O requests and sorts them by priority, processes I/O requests through preset threads, and adopts different processing methods according to the data usage frequency, including traditional copy and zero copy methods, and combines data sharding technology for data storage.

Benefits of technology

It reduces network overhead, improves IO request processing capabilities, ensures that high-priority requests are processed first, reduces system overhead, and improves the efficiency of data reading and rewriting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116760849B_ABST
    Figure CN116760849B_ABST
Patent Text Reader

Abstract

The application discloses a kind of distributed storage method and system based on Netty framework, it is related to distributed storage technical field, the method includes: the resource pool for caching IO request is established;The priority of the IO request in resource pool is calculated and is sorted;IO request is sent to different preset thread in turn based on priority from high to low and is handled;The data type of IO request is obtained, whether data type is successfully matched with first preset type is judged, if yes, preset thread then uses first preset processing mode to IO request and is handled;If not, preset thread then uses second preset processing mode to IO request and is handled.The application not only reduces the network overhead in IO request data synchronization process, simultaneously ensures that the IO request of high priority can be handled preferentially;And after data synchronization for the data of higher frequency of use, the effect that user reads and rewrites data is realized, after data synchronization for the data of not high frequency of use, system overhead is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of distributed storage, in particular to a distributed storage method and system based on a Netty framework. BACKGROUND

[0002] In the field of big data, a large amount of data is often stored, and a single physical machine cannot meet the requirements. Therefore, many companies currently use a distributed data storage system to store data in multiple nodes to reduce the amount of data in a single node. The data between nodes is automatically synchronized, and if an exception occurs in a node, the data can still be accessed normally and will not be lost. When data is synchronized between nodes, a normal IO mode is used, and after the thread issues an IO request, the kernel checks whether the data is ready. If it is not ready, the data will be waited for, and the thread will be in a blocked state. When the data is ready, the kernel copies the data to the thread and returns the result to the thread, and the thread ends the blocked state. If the data exchange between nodes is very frequent, the normal IO mode is used for data synchronization transmission, which will cause a serious network overhead, resulting in data synchronization delay and even system paralysis. SUMMARY

[0003] To solve the problem of serious network overhead when the data between distributed storage nodes is synchronized frequently, the present application provides a distributed storage method based on a Netty framework, which includes the following steps:

[0004] Establish a resource pool for caching IO requests;

[0005] Calculate the priority of the IO requests in the resource pool and sort them;

[0006] Monitor the IO requests in the resource pool. If the IO requests are found in the resource pool, the IO requests are sent to different preset threads in turn for processing based on the priority from high to low;

[0007] The preset thread processes the IO request, which includes obtaining the data type of the IO request, obtaining a first preset type based on the usage frequency of the historical data of the IO request, judging whether the data type is successfully matched with the first preset type, if yes, the preset thread processes the IO request using a first preset processing method and stores the processed data to a preset node; if not, the preset thread processes the IO request using a second preset processing method and stores the processed data to the preset node.

[0008] The method first establishes a resource pool to cache IO requests of a sending party and to perform priority sorting, and in the case of limited network resources, ensures that IO requests with higher priority are processed first. Then, based on an asynchronous IO mode, IO requests in the resource pool are polled and monitored, and IO requests corresponding to different preset threads are sent to the different preset threads for processing according to the priority from high to low. During the processing of the IO request data by the preset thread, due to the different frequencies of use of the IO requests, the focus of the problems to be considered also differs. For data with a higher frequency of use, the first consideration is to facilitate user reading and rewriting of the data, but for data with a lower frequency of use, the problem to be considered is to reduce system overhead during data copying. Therefore, two preset processing modes are adopted to process data with different frequencies of use. The asynchronous IO technology is adopted to improve the ability of the distributed storage system to process IO requests, reduce network overhead, and sort IO requests according to priority to ensure that IO requests with higher priority are processed first. The two preset processing modes are used to process data with different frequencies of use, and the effects of facilitating reading and rewriting and reducing system overhead are achieved.

[0009] Further, the priority of the IO request is calculated by the following formula:

[0010] ;

[0011] IO — poiority is the priority of the IO request, cpu — nice is the scheduling priority of the CPU, and the scheduling priority of the CPU can be viewed by using a top command.

[0012] The above formula can be used to accurately calculate the priority of the IO request.

[0013] Further, the method further includes real-time monitoring of the preset thread processing the IO request, judging whether the preset thread successfully processes the IO request, if yes, no action is taken, and if no, the IO request corresponding to the processing failure is returned to the resource pool.

[0014] In the asynchronous IO mode, a thread is responsible for polling and monitoring IO requests in the resource pool, and when an IO request is monitored, the IO request is sent to a different preset thread for processing. However, this mode does not know the processing result of the thread, and therefore the processing result of the thread needs to be monitored. If the processing is successful, no action is taken, but if the processing fails, it indicates that data synchronization between nodes fails, and therefore the IO request corresponding to the processing failure needs to be returned to the resource pool.

[0015] Further, based on the usage frequency of the IO request history data, the first preset type is obtained by: obtaining the history data of the user IO request; based on the history data, obtaining the usage frequency of the data corresponding to the user IO request; judging whether the usage frequency of the data is greater than the first preset frequency, if yes, setting the data type corresponding to the user IO request greater than the first preset frequency as the first preset type.

[0016] Among them, the data corresponding to the IO request is processed by using the preset thread and synchronized to other nodes. The user will read and rewrite the data stored in these nodes according to the demand, but the frequency of reading and rewriting different data is also different. Therefore, based on the history data of the user IO request, the IO request data with high usage frequency is obtained, and the data type of this kind of data is taken as the first preset type. In order to facilitate the user to read and rewrite the data, this kind of data needs to be stored in the node by using the traditional copy method. The traditional copy method means that the data needs to be copied from the disk to the kernel buffer, then from the kernel buffer to the application memory, then from the application memory to the socket buffer, and finally from the socket buffer to the network card.

[0017] Further, the first preset processing method is used to process the IO request, which includes: obtaining the first data transmission path from the disk to the kernel buffer, from the kernel buffer to the application memory, from the application memory to the socket buffer and from the socket buffer to the network card, based on the first data transmission path, transmitting the data corresponding to the IO request from the disk to the network card, and completing the processing of the IO request.

[0018] Among them, the first preset processing method is used to process the IO request, which means that the usage frequency of the corresponding IO request data is high. Therefore, the first consideration is to facilitate the user to read and rewrite. Therefore, the traditional data copy method is used to transmit the IO request data from the disk through the kernel buffer, the application memory and the socket buffer in turn, and finally sent to the network card to complete the processing of the IO request.

[0019] Further, the second preset processing method is used to process the IO request, which includes: establishing a data address mapping relationship between the kernel buffer and the application memory and the socket buffer, based on the mapping relationship, obtaining the second data transmission path from the disk to the kernel buffer, from the kernel buffer to the socket buffer and from the socket buffer to the network card, based on the second data transmission path, transmitting the data corresponding to the IO request from the disk to the network card, and completing the processing of the IO request.

[0020] The second preset processing method for handling I / O requests indicates that the frequency of I / O request data usage is low, and the priority of user-friendly data reading and modification is not high. More consideration is given to system overhead and memory bandwidth. If traditional data copying methods are used, the system overhead would be significant. Therefore, a data address mapping relationship is established between the kernel buffer, application memory, and socket buffer. Its purpose is to reduce the number of data copies and system calls during the transfer of I / O request data from the kernel buffer to application memory, achieving zero CPU involvement and reducing CPU load. Data can be directly sent from disk sequentially through the kernel buffer and socket buffer, ultimately reaching the network drive, completing the processing of the I / O request.

[0021] Furthermore, the method also includes real-time monitoring of all sender IO requests. If an IO request from the sender is detected, the IO request from the sender is added to the resource pool and then prioritized.

[0022] Specifically, the system monitors the sender's IO requests in real time. Once a sender's IO request is detected, the corresponding IO request is added to the resource pool. Then, the IO requests added to the resource pool are prioritized. This system can continuously capture and prioritize the sender's IO requests.

[0023] Further, storing the processed data to the preset node includes: obtaining the data capacity of the processed IO request, determining whether the data capacity is greater than the preset data capacity, and if so, fragmenting the processed data of the IO request and then transmitting it to the preset node; if not, transmitting the processed data of the IO request to the preset node.

[0024] In distributed storage systems, data synchronization between nodes requires copying data from one node to other nodes. However, for large amounts of data, copying and storing it to other nodes in the usual way would result in significant loss of storage resources. Therefore, data larger than the preset data capacity is processed by sharding before being stored to other nodes, while data smaller than or equal to the preset data capacity is stored directly to other nodes.

[0025] Further, the process of fragmenting the processed data of the IO request before transmitting it to the preset node includes: fragmenting the processed data of the IO request to obtain a first fragment data and a second fragment data; obtaining the number of preset nodes as M, determining whether M is an even number, if so, dividing the preset nodes into a first node and a second node, the number of the first node and the second node are both M / 2, storing the first fragment data in the first node, and storing the second fragment data in the second node; if not, dividing the preset nodes into a third node and a fourth node, the number of the third node is (M-1) / 2, and the number of the fourth node is (M+1) / 2; storing the first fragment data in the third node, and storing the second fragment data in the fourth node.

[0026] The process of processing data using sharding before storing it on other nodes also requires partitioning these storage nodes. This ensures that the sharded data is stored in the designated nodes. When partitioning nodes, the number of nodes is considered. If the number of nodes is even, they are divided into first and second nodes. If the number of nodes is odd, they are divided into third and fourth nodes, with the third and fourth nodes having (M-1) / 2 and (M+1) / 2 nodes respectively. Distinguishing the number of storage nodes based on parity ensures that the sharded data can be directly stored in the corresponding nodes.

[0027] To address the significant network overhead associated with frequent data synchronization between distributed storage nodes, this invention also provides a distributed storage system based on the Netty framework, the system comprising:

[0028] A caching unit is used to establish a resource pool for caching I / O requests;

[0029] A sorting unit is used to calculate the priority of the IO requests in the resource pool and sort them.

[0030] The monitoring unit is used to monitor the IO requests in the resource pool. If the IO requests are detected in the resource pool, the IO requests are sent to different preset threads for processing in order of priority from high to low.

[0031] The processing unit, wherein the preset thread processes the IO request, includes: obtaining the data type of the IO request; obtaining a first preset type based on the usage frequency of historical IO request data; determining whether the data type successfully matches the first preset type; if so, the preset thread processes the IO request using a first preset processing method and stores the processed data to a preset node; if not, the preset thread processes the IO request using a second preset processing method and stores the processed data to the preset node.

[0032] One or more technical solutions provided by this invention have at least the following technical effects or advantages:

[0033] This invention employs asynchronous I / O technology to improve the ability of distributed storage systems to handle I / O requests and reduce network overhead. At the same time, it prioritizes I / O requests to ensure that high-priority I / O requests are processed first. For frequently used data, a traditional data copy method is used to facilitate users to read and modify the data, while for infrequently used data, a zero-copy method is used to reduce system overhead. Attached Figure Description

[0034] The accompanying drawings, which are provided to further illustrate embodiments of the invention and constitute a part of this invention, are not intended to limit the scope of the invention.

[0035] Figure 1 This is a schematic diagram of a distributed storage method based on the Netty framework in this invention;

[0036] Figure 2 This is a schematic diagram of a distributed storage system based on the Netty framework in this invention. Detailed Implementation

[0037] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, where there is no conflict, the embodiments of the present invention and the features thereof can be combined with each other.

[0038] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0039] Example 1

[0040] Please refer to Figure 1 , Figure 1This is a schematic diagram of a distributed storage method based on the Netty framework according to the present invention. The method includes the following steps:

[0041] Establish a resource pool for caching I / O requests;

[0042] Calculate and sort the priorities of the IO requests in the resource pool;

[0043] Monitor the IO requests in the resource pool. If the IO request is detected in the resource pool, send the IO request to different preset threads for processing in order of priority from high to low.

[0044] The preset thread processes the IO request by: obtaining the data type of the IO request; obtaining a first preset type based on the usage frequency of historical IO request data; determining whether the data type successfully matches the first preset type; if so, the preset thread processes the IO request using a first preset processing method and stores the processed data to a preset node; if not, the preset thread processes the IO request using a second preset processing method and stores the processed data to the preset node.

[0045] In this embodiment of the invention, a resource pool is first established. Then, threads are used to monitor the IO requests sent by the sender in real time. Once an event is detected, the IO request is stored in the resource pool and prioritized. For example, if there are three IO requests in the resource pool with priorities 2, 3, and 4, these three IO requests are sent to different preset threads for processing according to their priorities, i.e., sent from priority 4, 3, and 2. Next, the data type of the IO request is obtained, and a first preset type is derived based on the usage frequency of historical IO request data. Since the usage frequency of IO request data varies, data with high usage frequency needs to be easily readable and rewritten by users, while data with low usage frequency needs to reduce system overhead. Therefore, it is determined whether the data type matches the first preset type. If the match is successful, it indicates that the IO request data has a high usage frequency. In this case, the IO request data is processed using a traditional data copy method and then stored on other nodes. If the match fails, it indicates that the IO request has a low usage frequency, and the IO request data is processed using a zero-copy method and then stored on other nodes.

[0046] The priority of the IO request is calculated using the following formula:

[0047] ;

[0048] IO — priority refers to the priority of the I / O request, CPU. —nice is the CPU scheduling priority.

[0049] CPU — The priority range for nice is -20 to 19, for example, CPU. — If nice is 10, then the calculated IO — The priority of poiority is 6, and the CPU... — The priority of "nice" can be viewed using the `top` command. The data above is for illustrative purposes only and can be adjusted according to actual needs; this invention does not impose any specific limitations.

[0050] The method further includes: real-time monitoring of the preset thread's processing of the IO request, determining whether the preset thread successfully processed the IO request; if so, no action is taken; if not, the IO request corresponding to the failed processing is returned to the resource pool.

[0051] Because asynchronous I / O is used, a thread is responsible for polling and monitoring the I / O requests sent by the sender in the resource pool. Once an event is detected, it is sent to different preset threads to handle the specific I / O event, but no processing result is returned. For I / O request data that fail to be processed, it is as if it has not been synchronized to other nodes. Therefore, it is necessary to monitor the I / O request events processed by the preset threads in real time and determine whether the processing result is successful. If successful, no action is taken; if it fails, the failed I / O request event is returned to the resource pool and then prioritized.

[0052] The method of obtaining the first preset type based on the usage frequency of historical IO request data includes: obtaining historical data of user IO requests; obtaining the usage frequency of data corresponding to user IO requests based on the historical data; determining whether the usage frequency of the data is greater than the first preset frequency, and if so, setting the data type of user IO requests corresponding to the first preset frequency as the first preset type.

[0053] For IO request data stored in a distributed system, there are differences in usage frequency. Data with high usage frequency requires frequent read and write operations, while data with low usage frequency needs to be processed to reduce system overhead. Therefore, a first preset efficiency is set. When the data usage frequency is greater than the first preset efficiency, the data type of this type of data is regarded as the first preset type and processed using the first preset processing method. When the data usage frequency is less than or equal to the first preset efficiency, the second preset processing method is used.

[0054] The first preset processing method for processing the IO request includes: obtaining a first data transmission path from the disk to the kernel buffer, from the kernel buffer to the application memory, from the application memory to the socket buffer, and from the socket buffer to the network card; and based on the first data transmission path, transferring the data corresponding to the IO request from the disk to the network card to complete the processing of the IO request.

[0055] The IO request is processed using the first preset processing method, which means that the data corresponding to the IO request is frequently used by the user and the user needs to read the data frequently. Therefore, the traditional copy mode is adopted. The data is transferred from the disk through the kernel buffer, application memory and socket buffer in sequence, and finally to the network card. Although this will result in a large CPU overhead, it is more convenient for the user to read and modify the data.

[0056] The second preset processing method for processing the IO request includes: establishing a data address mapping relationship between the kernel buffer and the application memory and the socket buffer; obtaining a second data transmission path from the disk to the kernel buffer, from the kernel buffer to the socket buffer, and from the socket buffer to the network card based on the mapping relationship; and transferring the data corresponding to the IO request from the disk to the network card based on the second data transmission path, thereby completing the processing of the IO request.

[0057] The second preset processing method is used to handle I / O requests, indicating that the data corresponding to the I / O request is not frequently used by the user, and the user does not need to read the data frequently. Therefore, a data address mapping relationship is established between the kernel buffer, the application memory, and the socket buffer. Data can be directly transferred from the disk to the kernel buffer, then from the kernel buffer to the socket buffer, and finally from the socket buffer to the network card. The CPU does not need to copy data from one memory area to another, saving CPU cycles and memory bandwidth, and reducing system overhead.

[0058] The method further includes real-time monitoring of all sender IO requests. If a sender IO request is detected, it is added to the resource pool and then prioritized. This real-time monitoring of sender IO requests, with each request added to the resource pool and then prioritized, ensures continuous capture and prioritization of sender IO requests.

[0059] The process of processing the IO request and storing it to a preset node includes: obtaining the data capacity of the processed IO request, determining whether the data capacity is greater than a preset data capacity, and if so, fragmenting the processed data of the IO request and transmitting it to the preset node; if not, transmitting the processed data of the IO request to the preset node.

[0060] When a distributed storage system synchronizes data between nodes, it needs to copy the data from one node to other nodes. However, for large amounts of data, copying and storing it to other nodes in the usual way would cause a significant loss of storage resources. Therefore, data larger than the preset data capacity is processed by sharding before being stored to other nodes, while data smaller than or equal to the preset data capacity is stored directly to other nodes.

[0061] The process of fragmenting the processed IO request data before transmitting it to the preset node includes: fragmenting the processed IO request data to obtain a first fragment data and a second fragment data; obtaining the number of preset nodes as M, determining whether M is an even number, if so, dividing the preset nodes into a first node and a second node, with the number of the first node and the second node both being M / 2, storing the first fragment data in the first node, and storing the second fragment data in the second node; if not, dividing the preset nodes into a third node and a fourth node, with the number of the third node being (M-1) / 2 and the number of the fourth node being (M+1) / 2; storing the first fragment data in the third node, and storing the second fragment data in the fourth node.

[0062] The processed data is sharded to obtain a first shard and a second shard. If the preset number of nodes M is, for example, 16, then the preset nodes are divided into a first node and a second node, each with 8 nodes. The first shard data is stored in the first node, and the second shard data is stored in the second node. If the preset number of nodes M is not even, for example, M = 23, then the preset nodes are similarly divided into a third node and a fourth node, with 11 nodes in the third node and 12 nodes in the fourth node. The first shard data is stored in the third node, and the second shard data is stored in the fourth node. The above data is for illustrative purposes only and can be adjusted according to actual conditions; this invention does not impose specific limitations.

[0063] Example 2

[0064] Please refer to Figure 2 , Figure 2This is a schematic diagram of a distributed storage system based on the Netty framework according to the present invention. The system includes:

[0065] A caching unit is used to establish a resource pool for caching I / O requests;

[0066] A sorting unit is used to calculate the priority of the IO requests in the resource pool and sort them.

[0067] The monitoring unit is used to monitor the IO requests in the resource pool. If the IO requests are detected in the resource pool, the IO requests are sent to different preset threads for processing in order of priority from high to low.

[0068] The processing unit, wherein the preset thread processes the IO request, includes: obtaining the data type of the IO request; obtaining a first preset type based on the usage frequency of historical IO request data; determining whether the data type successfully matches the first preset type; if so, the preset thread processes the IO request using a first preset processing method and stores the processed data to a preset node; if not, the preset thread processes the IO request using a second preset processing method and stores the processed data to the preset node.

[0069] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0070] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A distributed storage method based on a Netty framework, characterized in that, The method comprises the following steps: establishing a resource pool for caching IO requests; calculating the priority of the IO requests in the resource pool and sorting them; monitoring the IO requests in the resource pool, and if the IO requests are monitored in the resource pool, the IO requests are sent to different preset threads for processing in turn based on the priority from high to low; the preset thread processing the IO request comprises: obtaining the data type of the IO request, obtaining a first preset type based on the usage frequency of the IO request historical data, judging whether the data type matches the first preset type, if yes, the preset thread uses a first preset processing mode to process the IO request and stores the processed data to a preset node; if not, the preset thread uses a second preset processing mode to process the IO request and stores the processed data to the preset node; obtaining a first preset type based on the usage frequency of the IO request historical data comprises: obtaining the historical data of the user IO request; obtaining the usage frequency of the user IO request corresponding data based on the historical data; judging whether the usage frequency of the data is greater than a first preset frequency, if yes, setting the data type of the user IO request corresponding to the first preset frequency as the first preset type; using the first preset processing mode to process the IO request comprises: obtaining a first data transmission path from a disk to a kernel buffer, from the kernel buffer to an application memory, from the application memory to a socket buffer and from the socket buffer to a network card, based on the first data transmission path, transmitting the data corresponding to the IO request from the disk to the network card to complete the processing of the IO request; using the second preset processing mode to process the IO request comprises: establishing a data address mapping relationship between the kernel buffer and the application memory and the socket buffer, based on the mapping relationship, obtaining a second data transmission path from the disk to the kernel buffer, from the kernel buffer to the socket buffer and from the socket buffer to the network card, based on the second data transmission path, transmitting the data corresponding to the IO request from the disk to the network card to complete the processing of the IO request. 2.The distributed storage method based on the Netty framework of claim 1, wherein, The priority of the IO request is calculated using the following formula: ; IO — priority is the priority of the IO request, cpu — nice is the scheduling priority of the cpu. 3.The distributed storage method based on the Netty framework of claim 1, wherein, The method further comprises: monitoring the IO request processed by the preset thread in real time, judging whether the preset thread successfully processes the IO request, if yes, no action is taken; if not, the IO request corresponding to the processing failure is returned to the resource pool.

4. The distributed storage method based on the Netty framework according to claim 1, characterized in that, The method further comprises monitoring the IO requests of all senders in real time, if the IO request of the sender is monitored, the IO request of the sender is added to the resource pool and then prioritized.

5. The distributed storage method based on the Netty framework according to claim 1, characterized in that, The step of storing the processed data to the preset node comprises: obtaining the data volume of the processed IO request, determining whether the data volume is greater than a preset data volume, if yes, fragmenting the processed data of the IO request and transmitting the fragmented data to the preset node, and if no, transmitting the processed data of the IO request to the preset node.

6. The distributed storage method based on the Netty framework according to claim 5, characterized in that, The step of fragmenting the processed data of the IO request and transmitting the fragmented data to the preset node comprises: fragmenting the processed data of the IO request to obtain first fragmented data and second fragmented data, obtaining the number of the preset nodes as M, determining whether M is even, if yes, dividing the preset nodes into a first node and a second node, the number of the first node and the second node being M / 2, storing the first fragmented data to the first node and storing the second fragmented data to the second node, and if no, dividing the preset nodes into a third node and a fourth node, the number of the third node being (M-1) / 2 and the number of the fourth node being (M+1) / 2, storing the first fragmented data to the third node and storing the second fragmented data to the fourth node.

7. A distributed storage system based on Netty communication, characterized in that, The system comprises: a cache unit configured to establish a resource pool for caching IO requests; a sorting unit configured to calculate the priority of the IO requests in the resource pool and sort the IO requests; a monitoring unit configured to monitor the IO requests in the resource pool, and if the monitoring unit monitors that the IO requests exist in the resource pool, sequentially send the IO requests to different preset threads for processing based on the priority from high to low; a processing unit, the preset thread processing the IO request comprises: obtaining the data type of the IO request, obtaining a first preset type based on the usage frequency of the historical data of the IO request, determining whether the data type matches the first preset type, if yes, the preset thread processes the IO request by using a first preset processing mode and stores the processed data to a preset node, and if no, the preset thread processes the IO request by using a second preset processing mode and stores the processed data to the preset node; obtaining a first preset type based on the usage frequency of the historical data of the IO request comprises: obtaining the historical data of the user IO request, obtaining the usage frequency of the data corresponding to the user IO request based on the historical data, and determining whether the usage frequency of the data is greater than a first preset frequency, if yes, setting the data type of the user IO request corresponding to the first preset frequency as the first preset type; processing the IO request by using the first preset processing mode comprises: obtaining a first data transmission path from a disk to a kernel buffer, from the kernel buffer to an application memory, from the application memory to a socket buffer, and from the socket buffer to a network card, transmitting the data corresponding to the IO request from the disk to the network card based on the first data transmission path, and completing the processing of the IO request; The second preset processing manner comprises: establishing a data address mapping relationship between a kernel buffer and an application memory and a socket buffer; obtaining a second data transmission path from a disk to the kernel buffer, from the kernel buffer to the socket buffer, and from the socket buffer to a network card based on the mapping relationship; transmitting data corresponding to the IO request from the disk to the network card based on the second data transmission path, and completing processing of the IO request.

Citation Information

Patent Citations

  • Io request processing method, system, and related components

    CN109254933A

  • Separation method and system for cold and hot data

    CN112114748A

  • User layer asynchronous IO method and system based on persistent memory

    CN113282407A

  • IO access method and device based on block storage, electronic equipment and medium

    CN116489177A

  • Data read-write separated access method, system and device based on block chain

    CN116521794A