Write request processing method, system, computer device and storage medium
By splitting non-aligned write requests into head, tail, and middle requests, storing them in single-sided memory using RDMA technology, and then reorganizing and sending them to the server, the problem of low efficiency in processing non-aligned write requests is solved and the overall performance of the server cluster is improved.
Patent Information
- Application Number
- CN202411453748.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-10-17
AI Technical Summary
In the prior art, the processing efficiency of unaligned write requests is low and the resource consumption is high. Especially in a distributed storage system, it is urgent to improve the processing efficiency of unaligned write requests and reduce resource consumption.
Unaligned write requests are split into header requests, tail requests, and middle requests. The middle requests are aligned and stored in single-sided memory using RDMA technology. After reorganization, they are sent to the server. The middle data is transmitted through the data flow pipeline, and the header and tail parts flow through the control flow.
This improves the processing efficiency of non-aligned write requests, reduces network bandwidth utilization, and thus improves the overall performance of the server cluster.
Smart Images

Figure CN119513020B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a write request processing method, system, computer device, and storage medium. Background Art
[0002] RDMA (Remote Direct Memory Access) technology allows direct access to remote computer memory, aiming to reduce data transmission latency between servers and increase bandwidth. Based on this technology, RDMA transfers data directly to the computer's storage area over the network, quickly moving data from one system to the remote system's memory without the involvement of the CPU (Central Processing Unit) and without any impact on the operating system.
[0003] Some related technologies apply RDMA technology to distributed storage systems, but in practice, it is only used to process aligned write requests using numerical control separation technology. Currently, in most file scenarios, the majority of requests are unaligned, and write processing in these scenarios is still inefficient. Therefore, a method is urgently needed to improve the processing efficiency of unaligned requests and reduce the resource consumption of unaligned requests. Summary of the Invention
[0004] In order to solve at least one of the problems mentioned in the above background technology, the present application provides a write request processing method, system, computer device and storage medium, which can split unaligned write requests so that the aligned data in the middle part is transmitted through the data flow pipeline, and the unaligned data in the head and tail parts flows through the control flow, thereby improving the processing efficiency of unaligned write requests and reducing the utilization rate of the network bandwidth, thereby improving the overall performance of the server cluster.
[0005] The specific technical solutions provided in the embodiments of this application are as follows:
[0006] In a first aspect, a write request processing method is provided, which is applied to a terminal, and the method includes:
[0007] receiving a write request, and confirming that the write request is an unaligned write request;
[0008] After confirming that the write request is a non-aligned request, splitting the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0009] Stripping out the data in the intermediate request, and setting the data in the intermediate request to be stored in a single-side memory;
[0010] The head request, the tail request, and the middle request are reassembled to form a new write request, and the new write request is sent to the server.
[0011] In a specific embodiment, the method further comprises:
[0012] The write request is injected into the numerical control separation engine, and the numerical control separation engine confirms that the write request is a non-aligned write request; the intermediate request is registered in the single-sided memory through RDMA to store the data in the intermediate request in the single-sided memory.
[0013] In a second aspect, a write request processing method is provided, which is applied to a server, and the method includes:
[0014] receiving a new write request from a terminal, and confirming that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0015] In response to the splitting process of the new write request, obtaining an intermediate request in the new write request;
[0016] Parsing metadata in the intermediate part request to obtain the intermediate part data to be written, and pulling the intermediate part data;
[0017] In response to completion of pulling the intermediate data, the intermediate data is configured to be assembled with the data parsed from the header request and the tail request to form reorganized write request data, and a write operation is performed on the reorganized write request data.
[0018] In a specific embodiment, receiving a new write request from a terminal and confirming that the new write request has been split includes:
[0019] Receive a new write request from a terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain a main process in a server, and the number of child processes associated with the main process; distribute the pending transaction to a number of child processes according to the number of child processes, and send a replica data request associated with the new write request to the child process through the main process; so that when the child process receives the replica data request, it can determine whether the replica data request includes a split transaction; if the replica data request includes a split transaction, confirm that the new write request has been split; obtain a header request and a tail request in the new write request, and confirm that the header request and the tail request are ordinary write requests, obtain the middle request, and confirm that the middle request is a numerical control separation request; or, if the replica data request does not include a split transaction, the new write request has not been split.
[0020] In a specific embodiment, the header request is parsed to obtain header data, and the tail request is parsed to obtain tail data; and the header data, the middle data, and the tail data are assembled in sequence to form the reorganized write request data.
[0021] In a specific embodiment, the main process reads the status of all the sub-processes associated with it and determines whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
[0022] In a third aspect, a write request processing system is provided for implementing the write request processing method applied to a terminal as described above, the system comprising:
[0023] A first receiving unit, configured to receive a write request and confirm that the write request is an unaligned write request;
[0024] a splitting unit, configured to, after confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0025] a stripping unit, configured to strip the data in the intermediate request and store the data in the intermediate request in a single-side memory;
[0026] The sending unit is used to reorganize the head request, the tail request and the middle request to form a new write request, and send the new write request to the server.
[0027] In a fourth aspect, a write request processing system is provided, for implementing the write request processing method applied to a server as described above, the system comprising:
[0028] a second receiving unit, configured to receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0029] A first execution unit is configured to perform splitting processing in response to the new write request and obtain an intermediate request in the new write request;
[0030] a data pulling unit, configured to parse metadata in the intermediate part request to obtain intermediate part data to be written, and to pull the intermediate part data;
[0031] The second execution unit is used to configure the intermediate data to be assembled with the data parsed from the header request and the tail request in response to completion of pulling the intermediate data to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0032] In a fifth aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented on a terminal:
[0033] Step A: receiving a write request and confirming that the write request is a non-aligned write request;
[0034] Step B: after confirming that the write request is a non-aligned request, splitting the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0035] Step C, stripping out the data in the intermediate request, and setting the data in the intermediate request to be stored in a single-side memory;
[0036] Step D: reorganize the head request, the tail request, and the middle request to form a new write request, and send the new write request to the server.
[0037] In a specific embodiment, when the processor executes the computer program, the following steps are implemented on the server:
[0038] receiving a new write request from a terminal, and confirming that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0039] In response to the splitting process of the new write request, obtaining an intermediate request in the new write request;
[0040] Parsing metadata in the intermediate part request to obtain the intermediate part data to be written, and pulling the intermediate part data;
[0041] In response to completion of pulling the intermediate data, the intermediate data is configured to be assembled with the data parsed from the header request and the tail request to form reorganized write request data, and a write operation is performed on the reorganized write request data.
[0042] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the terminal implements the following steps:
[0043] Step A: receiving a write request and confirming that the write request is a non-aligned write request;
[0044] Step B: after confirming that the write request is a non-aligned request, splitting the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0045] Step C, stripping out the data in the intermediate request, and setting the data in the intermediate request to be stored in a single-side memory;
[0046] Step D: recombining the head request, the tail request, and the middle request to form a new write request, and sending the new write request to the server;
[0047] In a specific embodiment, when the computer program is executed by a processor, the following steps are implemented on the server:
[0048] receiving a new write request from a terminal, and confirming that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0049] In response to the splitting process of the new write request, obtaining an intermediate request in the new write request;
[0050] Parsing metadata in the intermediate part request to obtain the intermediate part data to be written, and pulling the intermediate part data;
[0051] In response to completion of pulling the intermediate data, the intermediate data is configured to be assembled with the data parsed from the header request and the tail request to form reorganized write request data, and a write operation is performed on the reorganized write request data.
[0052] The embodiments of the present application have the following beneficial effects:
[0053] 1. An embodiment of the present application provides a write request processing method. First, after the terminal receives a write request from the service end, it determines that the write request is an unaligned write request, and splits the unaligned write request into a head request, a middle request, and a tail request, wherein the middle request is a stripe-aligned request. The middle request is registered in the RDMA single-sided memory, and the data in the middle request is stripped out, and the data in the middle request is stored in the single-sided memory, so as to realize the processing of the data in the stripe-aligned part request through numerical control separation; after stripping, the split requests are reorganized to form a new write request, and the new write request is sent to the service end to perform the data disk operation according to this write request.
[0054] 2. After the server receives a new write request, it first determines whether the new write request has been split. If it has been split, it obtains the middle request in the new write request, parses the middle request to obtain the middle data to be written in the middle request, pulls the middle data to be written to the local memory, and after the pull is successful, reassembles the three parts, and performs a write disk operation on the reassembled write request data. It can split the non-aligned write request. Through the above scheme, the aligned data in the middle part is transmitted through the data flow pipeline, and the non-aligned data in the head and tail parts flows through the control flow, thereby improving the processing efficiency of the non-aligned write request and reducing the utilization rate of the network bandwidth, thereby improving the overall performance of the server cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0056] Figure 1 Shows a schematic diagram of the application environment according to this application;
[0057] Figure 2 A schematic diagram showing a write request processing method applied to a terminal according to the present application is shown;
[0058] Figure 3 A schematic diagram showing the splitting of non-aligned write requests according to the present application is shown;
[0059] Figure 4 A schematic diagram of a write request processing method applied to a server according to the present application is shown;
[0060] Figure 5 A schematic diagram showing a write request processing method according to the present application;
[0061] Figure 6 A schematic diagram showing the interaction between the server and the terminal according to the present application is shown;
[0062] Figure 7 A schematic diagram of a write request processing system for a terminal according to the present application is shown;
[0063] Figure 8 A schematic diagram of a write request processing system on the server side according to the present application is shown;
[0064] Figure 9 A schematic diagram showing a computer device according to the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0066] The write request processing method provided in this application can be applied to Figure 1 In the application environment shown. The terminal 102 communicates with the server 104 through the network. After receiving a write request from the service end, if the received write request is a non-aligned write request, the terminal splits the non-aligned write request to obtain an intermediate request; strips out the data in the intermediate request, and stores the data in the intermediate request into a single-sided memory. The terminal reassembles the split request to form a new write request, and sends the new write request to the server. The server obtains the intermediate request in the new write request, and pulls the intermediate data associated with the intermediate request from the single-sided memory; configures the intermediate data and the header request and the tail request to parse the data and assemble them to form reorganized write request data, and performs a disk write operation on the reorganized write request data. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0067] In one embodiment, Figure 2 As shown, a write request processing method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:
[0068] Step 101: Receive a write request, and confirm that the write request is a non-aligned write request.
[0069] The terminal and the server are started, and at the same time, the relevant configuration files of the CNC separation engine are loaded to initialize the CNC separation engine.
[0070] After the terminal receives a write request from the business end, it converts the write request into an OP request, confirms that the CNC separation function is turned on, and injects the OP request into the CNC separation engine to determine whether the write request is an unaligned write request through the initialized CNC separation engine. If the write request is not an unaligned write request, it confirms that the write request is an ordinary write request and performs the corresponding disk write operation according to the ordinary write request; if the write request is determined to be an unaligned write request, the unaligned write request is split and processed.
[0071] Step 102: After confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned.
[0072] Step 103: strip out the data in the intermediate request, and set the data in the intermediate request to be stored in a single-side memory.
[0073] Step 104: Reorganize the head request, the tail request, and the middle request to form a new write request, and send the new write request to the server.
[0074] like Figure 3 As shown, the front-end non-stripe-aligned part of the non-aligned write request is split into a head request part, and the head request is a normal write request; the middle stripe-aligned part is split into a middle request, and the middle request will be processed according to the data separation rule, that is, the middle request will be registered in the single-sided memory through RDMA to store the data in the middle request in the single-sided memory, that is, the homogeneous data stream sends the data in the middle request to the server; the tail non-aligned stripe part of the non-aligned write request is split into a tail request part, and the tail request is a normal write request.
[0075] Furthermore, the preset erasure stripe length is obtained, and the stripe length associated with the middle request is set to be an integer multiple of the preset erasure stripe length; when splitting the non-aligned request, first confirm that the length of the non-aligned request is greater than or equal to the preset minimum split length to ensure that the non-aligned request can be split; then, based on the length of the stripe associated with the middle request, the stripe position associated with the middle request is confirmed, and then the stripe positions associated with the head request at both ends and the stripe positions associated with the tail request are confirmed in turn, thereby realizing the splitting of the non-aligned request. For example, Figure 3 As shown, the length of the erasure stripe is 4K, the offset of the write request is 2K, the total length is 12K, the stripe length of the middle request obtained by splitting is 8K, the stripe length associated with the head request is 2K, and the stripe length associated with the tail request is 2K.
[0076] After stripping out the middle data and storing it in the single-sided memory, the header request, the tail request and the middle request are reorganized into a new OP, and the new OP request is serialized to send the reorganized new OP request to the server through the message module to perform the data disk operation according to this write request.
[0077] In one embodiment, Figure 4 As shown, a write request processing method is provided, which is applied to Figure 1 The server in the example is used as an example to illustrate the following steps:
[0078] Step 201: Receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0079] Step 202: In response to the splitting process of the new write request, obtain the intermediate request in the new write request;
[0080] After the server receives the new write request and confirms that the new write request has been split, it specifically includes:
[0081] Receive a new write request from a terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain the main process in the server and the number of child processes associated with the main process; distribute the pending transaction to several child processes according to the number of child processes, and send the replica data request associated with the new write request to the child process through the main process; so that when the child process receives the replica data request, it can be determined whether the replica data request includes a split transaction; if the replica data request includes a split transaction, it is confirmed that the new write request has been split.
[0082] Furthermore, the main process reads the status of all the sub-processes associated with it, and determines whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
[0083] For example, after receiving a new write request, the server deserializes it to generate a new OP write request, processes it in the PG queue, assembles it into a PG transaction, and distributes the PG transaction to each child OSD. A Subop request is generated according to the new OP write request, so that the child OSD starts processing after receiving the Subop request; the child OSD determines that the Subop request has been split, and the splitting processing process is triggered at this time: the head request and the tail request are ordinary requests and are not processed.
[0084] In a specific embodiment, the sub-OSD confirms that the new write request has been processed through the following process: obtaining the head request and the tail request in the new write request, and confirming that the head request and the tail request are ordinary write requests, obtaining the middle request, and confirming that the middle request is a numerical control separation request; or, if the replica data request does not include a split transaction, the new write request has not been split processed.
[0085] Step 203: Parse the metadata in the intermediate part request to obtain the intermediate part data to be written, and pull the intermediate part data.
[0086] Step 204: In response to completion of pulling the intermediate data, assemble the intermediate data with the data parsed from the header request and the tail request to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0087] In this embodiment, the relevant configuration file is obtained through the child OSD to initialize the server and the CNC separation subsystem; then, based on the split intermediate request, where the intermediate request is a CNC separation request, the RDMA metadata information contained in the intermediate request is parsed, and the data to be written is pulled to the local memory through the unilateral interface. After the data is pulled successfully, the head request, the tail request and the intermediate request are reassembled into a unified write request; the reassembled request is written to the disk according to the ordinary write request process, and the status is sent to the main OSD after the write operation is completed. After the main OSD determines that all sub-OSDs have been processed, a write completion message is returned to the terminal.
[0088] In a specific embodiment, in order to ensure the continuity of the data writing process and avoid disk writing errors, the header request is parsed to obtain header data, and the tail request is parsed to obtain tail data; and the header data, the middle data and the tail data are assembled in sequence to form the reorganized write request data.
[0089] Through the above solution, the aligned data in the middle is transmitted through the data flow pipeline, and the unaligned data at the head and tail flows through the control flow, thereby improving the processing efficiency of unaligned write requests and reducing the utilization of its network bandwidth, thereby improving the overall performance of the server cluster.
[0090] For specific limitations on the write request processing method applied to the server, please refer to the limitations on the write request processing method applied to the server above, which will not be repeated here.
[0091] In one embodiment, Figure 5 and Figure 6 As shown, a write request processing method is provided, comprising the following steps:
[0092] Step 301: When the terminal confirms that the received write request is an unaligned write request, the terminal splits the unaligned write request to obtain an intermediate request.
[0093] Step 302: stripping the data in the intermediate request and storing the data in the intermediate request into a single-side memory;
[0094] Step 303: The terminal reassembles the split request to form a new write request, and sends the new write request to the server;
[0095] Step 304: The server receives the new write request, obtains the intermediate request in the new write request, and pulls the intermediate data associated with the intermediate request from the single-sided memory;
[0096] Step 305: In response to completion of pulling the intermediate data, assemble the intermediate data with the data parsed from the header request and the tail request to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0097] In a specific embodiment, the write request is injected into the CNC separation engine through the terminal, and the CNC separation engine confirms that the write request is a non-aligned write request; the intermediate request is registered in the single-sided memory through RDMA to store the data in the intermediate request in the single-sided memory.
[0098] In a specific embodiment, receiving a new write request from a terminal and confirming that the new write request has been split includes:
[0099] Receive a new write request from a terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain a main process in a server, and the number of child processes associated with the main process; distribute the pending transaction to a number of child processes according to the number of child processes, and send a replica data request associated with the new write request to the child process through the main process; so that when the child process receives the replica data request, it can determine whether the replica data request includes a split transaction; if the replica data request includes a split transaction, confirm that the new write request has been split; obtain a header request and a tail request in the new write request, and confirm that the header request and the tail request are ordinary write requests, obtain the middle request, and confirm that the middle request is a numerical control separation request; or, if the replica data request does not include a split transaction, the new write request has not been split.
[0100] In a specific embodiment, the server parses the header request to obtain header data, and parses the tail request to obtain tail data; and assembles the header data, the middle data and the tail data in order to form the reorganized write request data.
[0101] In a specific embodiment, the main process reads the status of all the sub-processes associated with it and determines whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
[0102] It should be understood that although Figure 2 、 Figure 4 as well as Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2 、 Figure 4 as well as Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0103] In one embodiment, Figure 7 As shown, a write request processing system is provided for implementing the write request processing method applied to a terminal as described above, the system comprising:
[0104] A first receiving unit, configured to receive a write request and confirm that the write request is an unaligned write request;
[0105] a splitting unit, configured to, after confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0106] a stripping unit, configured to strip the data in the intermediate request and store the data in the intermediate request in a single-side memory;
[0107] The sending unit is used to reorganize the head request, the tail request and the middle request to form a new write request, and send the new write request to the server.
[0108] In a specific embodiment, the first receiving unit is also used to inject the write request into the CNC separation engine, and confirm through the CNC separation engine that the write request is an unaligned write request; register the intermediate request into the single-sided memory through RDMA to store the data in the intermediate request into the single-sided memory.
[0109] In one embodiment, Figure 8 As shown, a write request processing system is provided for implementing the write request processing method applied to the server as described above, the system comprising:
[0110] a second receiving unit, configured to receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0111] A first execution unit is configured to perform splitting processing in response to the new write request and obtain an intermediate request in the new write request;
[0112] a data pulling unit, configured to parse metadata in the intermediate part request to obtain intermediate part data to be written, and to pull the intermediate part data;
[0113] The second execution unit is used to configure the intermediate data to be assembled with the data parsed from the header request and the tail request in response to completion of pulling the intermediate data to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0114] In a specific embodiment, the second receiving unit is also used to receive a new write request from the terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain the main process in the server and the number of child processes associated with the main process; according to the number of child processes, distribute the pending transaction to several child processes, and send the copy data request associated with the new write request to the child process through the main process; so that when the child process receives the copy data request, it determines whether the copy data request includes a split transaction; if the copy data request includes a split transaction, it is confirmed that the new write request has been split; obtain the header request and the tail request in the new write request, and confirm that the header request and the tail request are ordinary write requests, obtain the middle request, and confirm that the middle request is a CNC separation request; or, if the copy data request does not include a split transaction, the new write request has not been split.
[0115] In a specific embodiment, the data pulling unit is also used to parse the header request to obtain header data, and parse the tail request to obtain tail data; and assemble in sequence according to the order of the header data, the middle data and the tail data to form the reorganized write request data.
[0116] In a specific embodiment, the second execution unit is further used to read the status of all the sub-processes associated with the main process through the main process, and determine whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, send operation completion information to the terminal.
[0117] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store intermediate data to be written. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a write request processing method is implemented.
[0118] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0119] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps of a terminal are implemented:
[0120] Step 401: Receive a write request and confirm that the write request is an unaligned write request;
[0121] Step 402: After confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0122] Step 403: stripping the data in the intermediate request and setting the data in the intermediate request to be stored in a single-side memory;
[0123] Step 404: Reorganize the head request, the tail request, and the middle request to form a new write request, and send the new write request to the server.
[0124] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0125] The write request is also injected into the numerical control separation engine through the terminal, and the numerical control separation engine confirms that the write request is a non-aligned write request; the intermediate request is registered in the single-sided memory through RDMA to store the data in the intermediate request in the single-sided memory.
[0126] In one embodiment, when the processor executes the computer program, it further implements the following steps on the server:
[0127] Step 501: Receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0128] Step 502: In response to the splitting process of the new write request, obtain the intermediate request in the new write request;
[0129] Step 503: Parse the metadata in the intermediate part request to obtain the intermediate part data to be written, and pull the intermediate part data;
[0130] Step 504: In response to completion of pulling the intermediate data, assemble the intermediate data with the data parsed from the header request and the tail request to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0131] In one embodiment, when executing the computer program, the processor further implements the following steps: receiving a new write request from the terminal, and confirming that the new write request has been split, specifically including:
[0132] Receive a new write request from a terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain a main process in a server, and the number of child processes associated with the main process; distribute the pending transaction to a number of child processes according to the number of child processes, and send a replica data request associated with the new write request to the child process through the main process; so that when the child process receives the replica data request, it can determine whether the replica data request includes a split transaction; if the replica data request includes a split transaction, confirm that the new write request has been split; obtain a header request and a tail request in the new write request, and confirm that the header request and the tail request are ordinary write requests, obtain the middle request, and confirm that the middle request is a numerical control separation request; or, if the replica data request does not include a split transaction, the new write request has not been split.
[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0134] The header request is parsed to obtain header data, and the tail request is parsed to obtain tail data; and the header data, the middle data, and the tail data are assembled in sequence to form the reorganized write request data.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] The main process reads the status of all the sub-processes associated with it, and determines whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
[0137] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the terminal implements the following steps:
[0138] Step 601: Receive a write request and confirm that the write request is an unaligned write request;
[0139] Step 602: After confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned;
[0140] Step 603: stripping the data in the intermediate request and setting the data in the intermediate request to be stored in a single-side memory;
[0141] Step 604: Reorganize the head request, the tail request, and the middle request to form a new write request, and send the new write request to the server.
[0142] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0143] The write request is also injected into the numerical control separation engine through the terminal, and the numerical control separation engine confirms that the write request is a non-aligned write request; the intermediate request is registered in the single-sided memory through RDMA to store the data in the intermediate request in the single-sided memory.
[0144] In one embodiment, when the computer program is executed by the processor, the server further implements the following steps:
[0145] Step 701: Receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request;
[0146] Step 702: In response to the splitting process of the new write request, obtain the intermediate request in the new write request;
[0147] Step 703: Parse the metadata in the intermediate part request to obtain the intermediate part data to be written, and pull the intermediate part data;
[0148] Step 704: In response to completion of pulling the intermediate data, assemble the intermediate data with the data parsed from the header request and the tail request to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a new write request from the terminal, and confirming that the new write request has been split, specifically including:
[0150] Receive a new write request from a terminal, deserialize the new write request to form a deserialized write request; queue the deserialized write request to generate a pending transaction; obtain a main process in a server, and the number of child processes associated with the main process; distribute the pending transaction to a number of child processes according to the number of child processes, and send a replica data request associated with the new write request to the child process through the main process; so that when the child process receives the replica data request, it can determine whether the replica data request includes a split transaction; if the replica data request includes a split transaction, confirm that the new write request has been split; obtain a header request and a tail request in the new write request, and confirm that the header request and the tail request are ordinary write requests, obtain the middle request, and confirm that the middle request is a numerical control separation request; or, if the replica data request does not include a split transaction, the new write request has not been split.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0152] The header request is parsed to obtain header data, and the tail request is parsed to obtain tail data; and the header data, the middle data, and the tail data are assembled in sequence to form the reorganized write request data.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0154] The main process reads the status of all the sub-processes associated with it, and determines whether all the sub-processes have completed the pending transactions; in response to all the sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
[0155] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0156] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A write request processing method, characterized in that: Applied to a terminal, the method includes: receiving a write request, and confirming that the write request is an unaligned write request; After confirming that the write request is a non-aligned request, splitting the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned; Stripping out the data in the intermediate request, and setting the data in the intermediate request to be stored in a single-side memory; Recombining the head request, the tail request, and the middle request to form a new write request, and sending the new write request to the server, so that the server can confirm that the new write request has been split after receiving the new write request; After receiving the new write request, the server confirms that the new write request has been split, specifically including: receiving a new write request from a terminal, and performing deserialization processing on the new write request to form a deserialized write request; Queuing the deserialized write request to generate pending transactions; Get the main process in the server and the number of child processes associated with the main process; Allocate the pending transaction to a number of sub-processes according to the number of the sub-processes, and send a copy data request associated with the new write request to the sub-processes through the main process; When the child process receives the copy data request, it determines whether the copy data request includes a split transaction; If the copy data request includes a split transaction, confirming that the new write request has been split; Obtaining a head request and a tail request in the new write request, and confirming that the head request and the tail request are common write requests, obtaining the middle request, and confirming that the middle request is a numerical control separation request; Alternatively, if the copy data request does not include a split transaction, the new write request is not split.
2. The write request processing method according to claim 1, wherein: The method further comprises: Injecting the write request into a numerical control separation engine, and confirming through the numerical control separation engine that the write request is a non-aligned write request; The intermediate request is registered in the single-sided memory through RDMA, so that the data in the intermediate request is stored in the single-sided memory.
3. A write request processing method, characterized in that: Applied to the server, the method includes: receiving a new write request from a terminal, and confirming that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request; In response to the splitting process of the new write request, obtaining an intermediate request in the new write request; Parsing metadata in the intermediate part request to obtain the intermediate part data to be written, and pulling the intermediate part data; In response to completion of pulling the intermediate data, assembling the intermediate data with the data parsed from the header request and the tail request to form reorganized write request data, and performing a disk write operation on the reorganized write request data; Receiving a new write request from a terminal and confirming that the new write request has been split includes: receiving a new write request from a terminal, and performing deserialization processing on the new write request to form a deserialized write request; Queuing the deserialized write request to generate pending transactions; Get the main process in the server and the number of child processes associated with the main process; Allocate the pending transaction to a number of sub-processes according to the number of the sub-processes, and send a copy data request associated with the new write request to the sub-processes through the main process; When the child process receives the copy data request, it determines whether the copy data request includes a split transaction; If the copy data request includes a split transaction, confirming that the new write request has been split; Obtaining a head request and a tail request in the new write request, and confirming that the head request and the tail request are common write requests, obtaining the middle request, and confirming that the middle request is a numerical control separation request; Alternatively, if the copy data request does not include a split transaction, the new write request is not split.
4. The write request processing method according to claim 3, wherein: The method further comprises: Parsing the header request to obtain header data, and parsing the tail request to obtain tail data; The header data, the middle data, and the tail data are assembled in sequence to form the reorganized write request data.
5. The write request processing method according to claim 4, wherein: The method further comprises: Reading the status of all the sub-processes associated with the main process through the main process, and determining whether all the sub-processes have completed the pending transactions; In response to all sub-processes completing the pending transactions, an operation completion message is sent to the terminal.
6. A write request processing system, used to implement the write request processing method described in claim 1 or 2, characterized in that: The system comprises: A first receiving unit, configured to receive a write request and confirm that the write request is an unaligned write request; a splitting unit, configured to, after confirming that the write request is a non-aligned request, split the non-aligned write request into a head request, a tail request, and a middle request, wherein the stripes of the middle request are aligned; a stripping unit, configured to strip the data in the intermediate request and store the data in the intermediate request in a single-side memory; The sending unit is used to reorganize the head request, the tail request and the middle request to form a new write request, and send the new write request to the server.
7. A write request processing system, configured to implement the write request processing method according to any one of claims 3 to 5, characterized in that: The system comprises: a second receiving unit, configured to receive a new write request from a terminal, and confirm that the new write request has been split, and that the new write request includes a head request, a tail request, and a middle request; A first execution unit is configured to perform splitting processing in response to the new write request and obtain an intermediate request in the new write request; a data pulling unit, configured to parse metadata in the intermediate part request to obtain intermediate part data to be written, and to pull the intermediate part data; The second execution unit is used to configure the intermediate data to be assembled with the data parsed from the header request and the tail request in response to completion of pulling the intermediate data to form reorganized write request data, and perform a disk write operation on the reorganized write request data.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data writing method and device capable of reducing pre-reading and storage medium
CN114217736A
Method for realizing Ceph log structure volume
CN118708122A