IO request processing method and device, computer equipment and storage medium
By receiving IO requests and determining the target splitting scenario based on the main IO attribute information and stripe ratio information, the problem of low splitting efficiency in the prior art is solved, and the rapid splitting effect is achieved when the IO request is large or the configuration is high.
Patent Information
- Application Number
- CN202311810366.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-06-27
Smart Images

Figure CN120216108A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to an IO request processing method, apparatus, computer device, storage medium, and computer program product. Background Art
[0002] In order to improve the processing efficiency of IO requests, in a distributed system, an IO request is usually split into multiple sub-IO requests, and multiple sub-IO requests are processed based on multiple threads to improve the processing efficiency of the IO request.
[0003] In the prior art, the splitting and processing of IO requests is usually implemented based on a method of cyclic traversal.
[0004] However, in the case of a large IO or a high ratio, the time consumed by using this method is long, and thus the splitting efficiency of the IO request is low. Summary of the Invention
[0005] Based on this, it is necessary to provide an IO request method, apparatus, computer device, computer-readable storage medium, and computer program product with a relatively high splitting efficiency for the above technical problems.
[0006] In a first aspect, this application provides an IO request method, including:
[0007] Receiving an IO request to be split, where the IO request carries main IO attribute information, and the main IO attribute information includes the main IO start offset position and the main IO length information of the IO request; determining a target splitting scenario of the IO request according to the main IO attribute information and preset strip ratio information; and determining a splitting result of the IO request according to the main IO attribute information, the strip ratio information, and the target splitting scenario, where the splitting result includes sub-IO attribute information of each sub-IO request after the IO request is split, and the sub-IO attribute information includes the sub-IO start position and the sub-IO length information of the sub-IO request.
[0008] In one embodiment, the determining the target splitting scenario of the IO request according to the main IO attribute information and the strip ratio information includes: obtaining the start data block identifier of the start sub-IO request and the end data block identifier of the end sub-IO request in each sub-IO request according to the main IO attribute information and the strip ratio information; and determining the target splitting scenario according to the size relationship between the start data block identifier and the end data block identifier.
[0009] In one embodiment, determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier includes: determining each candidate splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier; determining the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request according to the main IO attribute information and the stripe ratio information; and determining the target splitting scenario from each of the candidate splitting scenarios according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request.
[0010] In one embodiment, determining each candidate splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier includes: performing a ceiling operation on the starting data block identifier to obtain the ceilinged starting data block identifier, and performing a ceiling operation on the ending data block identifier to obtain the ceilinged ending data block identifier; if the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, determining the candidate splitting scenario as a single-layer splitting loop scenario; if the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, determining the candidate splitting scenario as a multi-layer splitting loop scenario.
[0011] In one embodiment, when the candidate splitting scenario is the single-layer splitting loop scenario, determining the target splitting scenario from each of the candidate splitting scenarios according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request includes: if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determining the target splitting scenario as a first splitting scenario, where the first splitting scenario is used to represent that the IO request is split into at least two sub-IO requests and there is an in-block position offset at the end position of the ending sub-IO request; if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determining the target splitting scenario as a second splitting scenario, where the second splitting scenario is used to represent that the IO request is split into at least two sub-IO requests and there is no in-block position offset at the end position of the ending sub-IO request; if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determining the target splitting scenario as a third splitting scenario, where the third splitting scenario is used to represent that the IO request is split into one sub-IO request.
[0012] In one embodiment, when the candidate splitting scenario is the multi-layer splitting loop scenario, determining the target splitting scenario from each of the candidate splitting scenarios according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request includes: if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determining the target splitting scenario according to the size relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier; if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determining the target splitting scenario as the fourth splitting scenario, where the fourth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the starting sub-IO request and the ending sub-IO request are the same sub-IO request; if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determining the target splitting scenario as the fifth splitting scenario, where the fifth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps after the starting sub-IO request.
[0013] In one embodiment, determining the target splitting scenario according to the size relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier includes: if the floor of the ending data block identifier is greater than or less than the ceiling of the starting data block identifier, determining the target splitting scenario as the sixth splitting scenario, where the sixth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers each stripe; if the floor of the ending data block identifier is equal to the ceiling of the starting data block identifier, determining the target splitting scenario as the seventh splitting scenario, where the seventh splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers a part of each of the stripes.
[0014] In one embodiment, determining the splitting result of the IO request according to the main IO attribute information, the stripe ratio information, and the target splitting scenario includes: substituting the main IO attribute information and the stripe ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result.
[0015] In one embodiment, when the target splitting scenario is the first splitting scenario, the first splitting formula corresponding to the first splitting scenario includes: L cs =[T s ,T - P s ; L cs+1 →L ce-1 =[A s *T,T]; Lce = [A s * T, P e ; where, L cs refers to the starting sub - IO request, L cs+1 → L ce-1 refers to the intermediate sub - IO request, L ce refers to the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, T refers to the data block length, P s refers to the in - block position offset length of the starting sub - IO request, A s refers to the floor - down starting data block identifier, P e refers to the in - block offset length of the terminating sub - IO request.
[0016] In one embodiment, when the target splitting scenario is the second splitting scenario, the second splitting formula corresponding to the second splitting scenario includes: L cs = [T s , T - P s ; L cs+1 → L ce-1 = [A s * T, T]; L ce = [A s * T, T e ; where, L cs refers to the starting sub - IO request, L cs+1 → L ce-1 refers to the intermediate sub - IO request, L ce refers to the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, T refers to the data block length, P s refers to the in - block position offset length of the starting sub - IO request, A s refers to the floor - down starting data block identifier, T e refers to the offset position of the terminating sub - IO request within the terminating sub - IO.
[0017] In one embodiment, when the target splitting scenario is the third splitting scenario, the third splitting formula corresponding to the third splitting scenario includes: L cs = L ce = [T s , S]; where, L cs refers to the starting sub - IO request, L ce refers to the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, S refers to the main IO length.
[0018] In one embodiment, when the target splitting scenario is the fourth splitting scenario, the fourth splitting formula corresponding to the fourth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = L ce = [T s , (A e - A s ) * T - P s + P e ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; Wherein, L [0,...,cs-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the ceilinged starting data block identifier, T refers to the data block length, R e refers to the ceilinged terminating data block identifier, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A e refers to the floored terminating data block identifier, A s refers to the floored starting data block identifier, P s refers to the in-block position offset length of the starting sub-IO request, P e refers to the in-block offset length of the terminating sub-IO request.
[0019] In one embodiment, when the target splitting scenario is the fifth splitting scenario, the fifth splitting formula corresponding to the fifth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = [T s , (R e - A s ) * T - P s ; L cs+1→ce-1 = [A s * T, (R e - A s ) * T]; L ce = [A s * T, (Ae -A s )*T+P e ]; L [ce+1,...,N-1] =[A s *T,(A e -A s )*T]; where L [0,...,cs-1] Refers to the first intermediate sub-IO request, L cs Refers to the starting sub-IO request, L cs+1→ce-1 Refers to the second intermediate sub-IO request, L ce Refers to the termination IO request, L [ce+1,...,N-1] Refers to the third intermediate sub-IO request, R s Refers to the starting data block identifier after rounding up, T refers to the data block length, R e Refers to the end data block identifier after rounding up, A s Refers to the starting data block identifier after rounding down, P e Refers to the offset length within the block of the termination sub-IO request, T s Refers to the offset position of the starting sub-IO request within the starting sub-IO, P s Refers to the offset length of the block of the starting sub-IO request.
[0020] In one embodiment, when the target splitting scenario is the sixth splitting scenario, the sixth splitting formula corresponding to the sixth splitting scenario includes: [0,...,ce-1] =[R s *T,(R e -R s )*T];L ce =[R s *T,(A e -R s )*T+P e ]; L ce+1→cs-1 =[R s *T,(A e -R s )*T];L cs =[T s , (A e -A s )*TP s ]; L [cs+1,...,N-1] =[A s *T,(A e -A s )*T]; where L [0,...,ce-1] Refers to the first intermediate sub-IO request, L cs Refers to the starting sub-IO request, L ce+1→cs-1 Refers to the second intermediate sub-IO request, L ceRefers to the terminator IO request, L [cs+1,...,N-1] Refers to the third intermediate sub-IO request, R s Refers to the ceilinged starting data block identifier, T refers to the data block length, R e Refers to the ceilinged terminating data block identifier, P e Refers to the in-block offset length of the terminator IO request, A e Refers to the floored terminating data block identifier, P s Refers to the in-block position offset length of the starting sub-IO request, A s Refers to the floored starting data block identifier, T s Refers to the offset position of the starting sub-IO request within the starting sub-IO.
[0021] In one embodiment, when the target splitting scenario is the seventh splitting scenario, the seventh splitting formula corresponding to the seventh splitting scenario includes: L [0,...,ce-1] =[R s *T, (R e -R s )*T]; L ce =[R s *T, (A e -R s )*T+P e ; L cs =[T s , (A e -A s )*T-P s ; L [cs+1,...,N-1] =[A s *T, (A e -A s )*T]; Wherein, L [0,...,ce-1] Refers to the first intermediate sub-IO request, L cs Refers to the starting sub-IO request, L ce Refers to the terminator IO request, L [cs+1,...,N-1] Refers to the second intermediate sub-IO request, R s Refers to the ceilinged starting data block identifier, T refers to the data block length, R e Refers to the ceilinged terminating data block identifier, A e Refers to the floored terminating data block identifier, P e Refers to the in-block offset length of the terminator IO request, P s Refers to the in-block position offset length of the starting sub-IO request, T s Refers to the offset position of the starting sub-IO request within the starting sub-IO, A sRefers to the starting data block identifier after rounding down.
[0022] In one embodiment, the method further includes: during the process of data merging for each sub-IO request, for each sub-IO request among the sub-IO requests, obtaining the sub-IO attribute information of the sub-IO request; according to the sub-IO attribute information, the main IO attribute information, the stripe ratio information, and the granularity information of the sub-IO request, determining the starting position information and the ending position information of the sub-IO request, where the starting position information of the sub-IO request includes the data block identifier of the starting position of the sub-IO request after rounding down, the in-block offset length of the starting position of the sub-IO request, the page identifier of the starting position of the sub-IO request after rounding down, the in-block page identifier of the starting position of the sub-IO request after rounding down, and the page identifier of the starting position of the sub-IO request in the IO request, and the ending position information of the sub-IO request includes the page identifier of the ending position of the sub-IO request after rounding up; substituting the starting position information and the ending position information of the sub-IO request into the merging formula to determine the position information of the sub-IO request in the IO request.
[0023] In one embodiment, the sub-IO request includes multiple pages, the position information is used to represent the position information of each page in the sub-IO request in the IO request, and the merging formula includes: C i = B o +(((i + B k ) / B) * (N - 1) * B) + i; O' i = OC i ; where C i refers to the page identifier of the i-th page of the sub-IO request in the IO request, B o refers to the page identifier of the starting position of the sub-IO request in the IO request, i refers to the serial number of the sub-IO request, B k refers to the in-block page identifier of the starting position of the sub-IO request after rounding down, B refers to the granularity information of the sub-IO request, N refers to the stripe width, O' i refers to the data block result of the i-th page in the sub-IO request, and O refers to the starting offset position of the IO.
[0024] In a second aspect, the present application further provides an IO request processing apparatus, including:
[0025] A receiving module, configured to receive an IO request to be split, where the IO request carries main IO attribute information, and the main IO attribute information includes the main IO starting offset position and the main IO length information of the IO request;
[0026] A determination module, configured to determine a target splitting scenario of the IO request according to the main IO attribute information and preset strip ratio information;
[0027] An execution module, configured to determine a splitting result of the IO request according to the main IO attribute information, the strip ratio information, and the target splitting scenario, where the splitting result includes sub-IO attribute information of each sub-IO request after splitting the IO request, and the sub-IO attribute information includes a sub-IO start position and sub-IO length information of the sub-IO request.
[0028] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method described in any one of the embodiments in the first aspect above is implemented.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any one of the embodiments in the first aspect above is implemented.
[0030] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method described in any one of the embodiments in the first aspect above is implemented.
[0031] For the above-mentioned IO request processing method, device, computer device, storage medium, and computer program product, an IO request to be split is received, and the IO request carries main IO attribute information, where the main IO attribute information includes a main IO start offset position and main IO length information of the IO request; according to the main IO attribute information and preset strip ratio information, a target splitting scenario of the IO request is determined; according to the main IO attribute information, the strip ratio information, and the target splitting scenario, a splitting result of the IO request is determined, where the splitting result includes sub-IO attribute information of each sub-IO request after splitting the IO request, and the sub-IO attribute information includes a sub-IO start position and sub-IO length information of the sub-IO request. The IO request processing method provided by the present application determines a target splitting scenario according to the main IO attribute information and strip ratio information of the IO request to be split, and determines the splitting result of the IO request based on the main IO attribute information, strip ratio information, and target splitting scenario. In the case of a large IO request or a high ratio, the splitting result of the IO request can also be quickly determined. By using the IO request processing method provided by the present application, the problem of long IO request splitting time in the prior art in the case of a large IO request or a high ratio can be avoided, thereby effectively improving the splitting efficiency of the IO request. Description of the Drawings
[0032] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0033] Figure 1 It is a schematic flowchart of an IO request processing method in an embodiment;
[0034] Figure 2 It is a schematic flowchart of a method for determining the target splitting scenario of the IO request according to the main IO attribute information and the stripe ratio information in an embodiment;
[0035] Figure 3 It is a schematic flowchart of a method for determining the target splitting scenario according to the size relationship between the start data block identifier and the end data block identifier in an embodiment;
[0036] Figure 4 It is a schematic flowchart of a method for determining each candidate splitting scenario according to the size relationship between the start data block identifier and the end data block identifier in an embodiment;
[0037] Figure 5 It is a schematic flowchart of a method for determining the target splitting scenario from each candidate splitting scenario according to the size relationship between the sequence number of the start sub-IO request and the sequence number of the end sub-IO request in an embodiment;
[0038] Figure 6 It is a schematic flowchart of a method for determining the target splitting scenario from each candidate splitting scenario according to the size relationship between the sequence number of the start sub-IO request and the sequence number of the end sub-IO request in another embodiment;
[0039] Figure 7 It is a schematic flowchart of a method for determining the target splitting scenario according to the size relationship between the rounded-down end data block identifier and the rounded-up start data block identifier in an embodiment;
[0040] Figure 8 It is a schematic flowchart of a method for the process of data merging for each sub-IO request in an embodiment;
[0041] Figure 9 It is a schematic flowchart of an IO request processing method for splitting an IO request in an embodiment;
[0042] Figure 10 It is a schematic flowchart of an IO request processing method for data merging of sub-IOs in an embodiment;
[0043] Figure 11 is a structural block diagram of an IO request processing device in an embodiment;
[0044] Figure 12 is a structural block diagram of an IO request processing device in another embodiment;
[0045] Figure 13 is an internal structure diagram of a computer device in an embodiment;
[0046] Figure 14 is a schematic diagram of a first splitting scenario in an embodiment;
[0047] Figure 15 is a schematic diagram of a second splitting scenario in an embodiment;
[0048] Figure 16 is a schematic diagram of a third splitting scenario in an embodiment;
[0049] Figure 17 is a schematic diagram of a fourth splitting scenario in an embodiment;
[0050] Figure 18 is a schematic diagram of a fifth splitting scenario in an embodiment;
[0051] Figure 19 is a schematic diagram of a sixth splitting scenario in an embodiment;
[0052] Figure 20 is a schematic diagram of a seventh splitting scenario in an embodiment. Detailed implementation manners
[0053] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] In order to improve the processing efficiency of IO requests, in a distributed system, an IO request is usually split into multiple sub-IO requests, so as to process the multiple sub-IO requests based on multiple threads and improve the processing efficiency of the IO requests.
[0055] In the prior art, the splitting and processing of IO requests is usually implemented based on a method of circular traversal.
[0056] However, in the case of a large IO or a high ratio, the time consumption of using this method is relatively long, and thus the splitting efficiency of the IO requests is relatively low.
[0057] In view of this, the present application provides an IO request processing method, which can effectively improve the splitting efficiency of IO requests.
[0058] This application provides an IO request processing method, and the execution subject thereof may be a computer device, which may be a server.
[0059] In an exemplary embodiment, as Figure 1 shown, an IO request processing method is provided, and the method includes the following steps:
[0060] Step 101: Receive an IO request to be split, and the IO request carries main IO attribute information.
[0061] Optionally, the IO request refers to the communication between an information processing system and the external world, such as the communication between a computer and a person or other information processing systems.
[0062] In a possible implementation manner, the IO request may be an input (Input) request, that is, a write request, or may also be an output (Output) request, that is, a read request.
[0063] Optionally, the main IO attribute information includes the main IO starting offset position O and the main IO length information S of the IO request.
[0064] Step 102: Determine the target split scenario of the IO request according to the main IO attribute information and the preset strip ratio information.
[0065] Optionally, the strip ratio information includes a strip depth T and a strip width N, and the strip ratio information can be determined according to the actual situation.
[0066] Optionally, the strip depth T refers to the size of a strip, also called the strip size, and the strip depth is used to characterize the size of the strip data block written on each disk.
[0067] Optionally, the strip width N refers to the number of strips that can be concurrently read or written at the same time, and the strip width can also be used to characterize the number of physical hard disks.
[0068] Optionally, the preset multiple split scenarios are obtained by technicians in advance based on the divide-and-conquer idea, that is, technicians classify and discuss the scenarios that will be encountered after splitting various IO requests in advance, and obtain them through induction and collation.
[0069] In a possible implementation manner, a technician can, based on the divide-and-conquer idea, classify, discuss, and summarize the possible scenarios that may occur after splitting various different IO requests, so as to obtain multiple splitting scenarios, and summarize the characteristic parameters corresponding to these splitting scenarios. After receiving the IO request, the technician can first determine the target characteristic parameters of the IO request according to the main IO attribute information and stripe ratio information of the IO request, and then compare the target characteristic parameters with the characteristic parameters corresponding to the multiple splitting scenarios, so as to match the target splitting scenario corresponding to the IO request from multiple preset splitting scenarios.
[0070] In another possible implementation manner, a technician can, based on the divide-and-conquer idea, classify, discuss, and summarize the possible scenarios that may occur after splitting various different IO requests, so as to obtain multiple splitting scenarios. Different splitting scenarios are set with different splitting conditions. After receiving the IO request, the technician can first determine which splitting condition of the multiple splitting scenarios the IO request meets according to the main IO attribute information and stripe ratio information of the IO request, so as to match the target splitting scenario corresponding to the IO request from the multiple splitting scenarios.
[0071] Step 103: Determine the splitting result of the IO request according to the main IO attribute information, the stripe ratio information, and the target splitting scenario.
[0072] Wherein, the splitting result includes the sub-IO attribute information of each sub-IO request after the IO request is split, and the sub-IO attribute information includes the sub-IO start position and sub-IO length information of the sub-IO request.
[0073] In a possible implementation manner, after determining the target splitting scenario, the main IO attribute information and the stripe ratio information can be substituted into the sub-IO calculation formula corresponding to the target splitting scenario to obtain the sub-IO start position and sub-IO length information of each sub-IO request after the IO request is split.
[0074] The above IO request processing method receives an IO request to be split. The IO request carries main IO attribute information, and the main IO attribute information includes the main IO starting offset position and the main IO length information of the IO request. According to the main IO attribute information and the preset strip ratio information, determine the target split scenario of the IO request. According to the main IO attribute information, the strip ratio information, and the target split scenario, determine the split result of the IO request. The split result includes the sub-IO attribute information of each sub-IO request after the IO request is split, and the sub-IO attribute information includes the sub-IO starting position and the sub-IO length information of the sub-IO request. The IO request processing method provided by this application determines the target split scenario according to the main IO attribute information and the strip ratio information of the IO request to be split, and determines the split result of the IO request based on the main IO attribute information, the strip ratio information, and the target split scenario. In the case of a large IO request or a high ratio, the split result of the IO request can also be quickly determined. By using the IO request processing method provided by this application, the problem of long IO request split time in the prior art in the case of a large IO request or a high ratio can be avoided, thereby effectively improving the split efficiency of the IO request.
[0075] In an exemplary embodiment, as Figure 2 shown, the step of determining the target split scenario of the IO request according to the main IO attribute information and the strip ratio information includes the following steps:
[0076] Step 201: According to the main IO attribute information and the strip ratio information, obtain the starting data block identifier of the starting sub-IO request and the ending data block identifier of the ending sub-IO request in each sub-IO request.
[0077] Optionally, the starting sub-IO request refers to the sub-IO request storing the first data block, the first data block refers to the first data block among the multiple data blocks into which the IO request is split, the ending sub-IO request refers to the sub-IO request storing the last data block, and the last data block refers to the last data block among the multiple data blocks into which the IO request is split.
[0078] In a possible implementation manner, the starting data block identifier R s and the ending data block identifier R e can be determined according to the main IO starting offset position O in the main IO attribute information, the main IO length information S, the strip depth T and the strip width N in the strip ratio information. Specifically, the R s =(O + N * T - 1) / (N * T), and R e =(O + S + N * T - 1) / (N * T).
[0079] Step 202: Determine the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier.
[0080] In a possible implementation, if the starting data block identifier is equal to the ending data block identifier, determine that the target splitting scenario is the candidate first splitting scenario among multiple splitting scenarios.
[0081] In another possible implementation, if the starting data block identifier is less than the ending data block identifier, determine that the target splitting scenario is the candidate second splitting scenario among multiple splitting scenarios.
[0082] The method of obtaining the starting data block identifier of the starting sub-IO request and the ending data block identifier of the ending sub-IO request according to the main IO attribute information and the strip ratio information, and determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier. By determining the starting data block identifier of the starting sub-IO request and the ending data block identifier of the ending sub-IO request according to the main IO attribute information and the strip ratio information, and then determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier, the target splitting scenario corresponding to the IO request can be quickly determined, avoiding the problem of long IO request splitting time in the prior art, and effectively improving the splitting efficiency of the IO request.
[0083] In an exemplary embodiment, as Figure 3 shown, determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier includes the following steps:
[0084] Step 301: Determine each candidate splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier.
[0085] Optionally, the candidate splitting scenario may include the above-mentioned candidate first splitting scenario and candidate second splitting scenario.
[0086] Step 302: Determine the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request according to the main IO attribute information and the strip ratio information.
[0087] Optionally, the sequence number C s of the starting sub-IO request refers to the sequence number of the strip where the starting sub-IO request is located, and the sequence number C e of the ending sub-IO request refers to the sequence number of the strip where the ending sub-IO request is located.
[0088] In a possible implementation manner, the sequence number C of the starting sub-IO request can be determined according to the starting offset position O in the main IO attribute information, the main IO length information S, the stripe depth T and the stripe width N in the stripe ratio information s and the sequence number C of the terminating sub-IO request e , specifically, the C s =(O / T)%N, the C e =((O + S) / T)%N. It should be noted that if the result obtained by calculating based on this formula is not an integer, the calculation result is rounded down
[0089] Step 303: Determine the target splitting scenario from each of the candidate splitting scenarios according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the terminating sub-IO request
[0090] In a possible implementation manner, when the candidate splitting scenario is a candidate first splitting scenario, the target splitting scenario is determined from the candidate first splitting scenario according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the terminating sub-IO request
[0091] In another possible implementation manner, when the candidate splitting scenario is a candidate second splitting scenario, the target splitting scenario is determined from the candidate second splitting scenario according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the terminating sub-IO request
[0092] The method of determining the candidate splitting scenarios according to the size relationship between the starting data block identifier and the terminating data block identifier, determining the sequence numbers of the starting sub-IO request and the terminating sub-IO request according to the main IO attribute information and the stripe ratio information, and determining the target splitting scenario from the candidate splitting scenarios according to the size relationship between the sequence numbers of the starting sub-IO request and the terminating sub-IO request can quickly determine the target splitting scenario corresponding to the IO request, avoid the problem of long IO request splitting time in the prior art, and effectively improve the splitting efficiency of the IO request
[0093] In an exemplary embodiment, as Figure 4 shown, determining each candidate splitting scenario according to the size relationship between the starting data block identifier and the terminating data block identifier includes the following steps
[0094] Step 401: Perform ceiling processing on the starting data block identifier to obtain the ceilinged starting data block identifier, and perform ceiling processing on the terminating data block identifier to obtain the ceilinged terminating data block identifier
[0095] Optionally, the ceilinged starting data block identifier refers to the line number corresponding to the first data block in the starting sub-IO request, that is, the starting line of the starting sub-IO request. The ceilinged ending data block identifier refers to the line number corresponding to the last data block in the ending sub-IO request, that is, the ending line of the ending sub-IO request.
[0096] In a possible implementation, if the calculated starting data block identifier based on the above formula is not an integer, then round up the calculation result, and determine the calculation result after the rounding-up process as the ceilinged starting data block identifier.
[0097] In another possible implementation, if the calculated ending data block identifier based on the above formula is not an integer, then round up the calculation result, and determine the calculation result after the rounding-up process as the ceilinged ending data block identifier.
[0098] Step 402: If the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, then determine that the candidate split scenario is a single-layer split loop scenario.
[0099] In a possible implementation, if the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, it can be explained that the IO request has been split after only one loop, that is, the split of the IO request does not cause an increase in the stripe depth.
[0100] Step 403: If the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, then determine that the candidate split scenario is a multi-layer split loop scenario.
[0101] In a possible implementation, if the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, it can be explained that the IO request has been split after at least two loops, that is, the split of the IO request causes an increase in the stripe depth.
[0102] The method of determining that the candidate split scenario is a single-layer loop scenario if the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, and determining that the candidate split scenario is a multi-layer loop scenario if the ceilinged starting data block identifier is less than the ceilinged ending data block identifier can quickly determine the target split scenario corresponding to the IO request, avoid the problem of long IO request split time in the prior art, and effectively improve the split efficiency of the IO request.
[0103] In an exemplary embodiment, such as Figure 5As shown, when the candidate split scenario is the single-layer split loop scenario, determining the target split scenario from each of the candidate split scenarios according to the magnitude relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request includes the following steps:
[0104] Step 501: If the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target split scenario is the first split scenario.
[0105] Among them, the first split scenario is used to represent that the IO request is split into at least two sub-IO requests, and there is an in-block position offset at the end position of the ending sub-IO request.
[0106] In a possible implementation manner, when the candidate split scenario is the single-layer split loop scenario, if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target split scenario is the first split scenario. The first split scenario can be as Figure 14 shown. It should be noted that Figure 14 what is shown in is only an exemplary one and does not represent all situations under the first split scenario.
[0107] Step 502: If the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine that the target split scenario is the second split scenario.
[0108] Among them, the second split scenario is used to represent that the IO request is split into at least two sub-IO requests, and there is no in-block position offset at the end position of the ending sub-IO request.
[0109] In a possible implementation manner, when the candidate split scenario is the single-layer split loop scenario, if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine that the target split scenario is the second split scenario. The second split scenario can be as Figure 15 shown. It should be noted that Figure 15 what is shown in is only an exemplary one and does not represent all situations under the second split scenario.
[0110] Step 503: If the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target split scenario is the third split scenario.
[0111] Among them, the third split scenario is used to represent that the IO request is split into one sub-IO request.
[0112] In a possible implementation manner, when the candidate splitting scenario is the single-layer splitting loop scenario, if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, it is determined that the target splitting scenario is the third splitting scenario. The third splitting scenario can be as Figure 16 shown. It should be noted that Figure 16 only three exemplary ones are shown in
[0113] and they do not represent all situations under the third splitting scenario. Figure 6 In an exemplary embodiment, as
[0114] shown, when the candidate splitting scenario is the multi-layer splitting loop scenario, the target splitting scenario is determined from each candidate splitting scenario according to the magnitude relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request, including the following steps:
[0115] In a possible implementation manner, when the candidate splitting scenario is the multi-layer splitting loop scenario, if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, it is also necessary to determine the target splitting scenario according to the magnitude relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier. The floor of the ending data block identifier refers to taking the floor of the calculation result if the ending data block identifier calculated according to the above calculation formula is not an integer.
[0116] Step 601: If the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine the target splitting scenario according to the magnitude relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier.
[0117] Among them, the fourth splitting scenario is used to represent that in each sub-IO request obtained by splitting the IO request, the starting sub-IO request and the ending sub-IO request are the same sub-IO request.
[0118] In a possible implementation manner, when the candidate splitting scenario is the multi-layer splitting loop scenario, if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, it is determined that the target splitting scenario is the fourth splitting scenario. The fourth splitting scenario can be as Figure 17 shown. It should be noted that Figure 17 only one exemplary one is shown in
[0119] Step 603: If the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fifth splitting scenario.
[0120] Among them, the fifth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps after the starting sub-IO request.
[0121] In a possible implementation manner, when the candidate splitting scenario is the multi-layer splitting loop scenario, if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fifth splitting scenario. The fifth splitting scenario can be as Figure 18 shown. It should be noted that Figure 18 only one exemplary case is shown in
[0122] and it does not represent all situations under the fifth splitting scenario. Figure 7 In an exemplary embodiment, as
[0123] shown, determining the target splitting scenario according to the size relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier includes:
[0124] Step 701: If the floor of the ending data block identifier is greater than or less than the ceiling of the starting data block identifier, determine that the target splitting scenario is the sixth splitting scenario.
[0125] Among them, the sixth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers each stripe. Figure 19 shown. It should be noted that Figure 19 only one exemplary case is shown in
[0126] and it does not represent all situations under the sixth splitting scenario.
[0127] Step 702: If the floor of the ending data block identifier is equal to the ceiling of the starting data block identifier, determine that the target splitting scenario is the seventh splitting scenario.
[0127] Among them, the seventh splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the terminating sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers a part of each stripe.
[0128] In a possible implementation manner, when the candidate splitting scenario is the multi-layer splitting loop scenario, and the sequence number of the starting sub-IO request is greater than the sequence number of the terminating sub-IO request, and the rounded-down terminating data block identifier is equal to the rounded-up starting data block identifier, it is determined that the target splitting scenario is the seventh splitting scenario. The seventh splitting scenario can be as Figure 20 shown. It should be noted that Figure 20 only an exemplary one shown in
[0129] does not represent all situations under the seventh splitting scenario.
[0130] In an exemplary embodiment, determining the splitting result of the IO request according to the main IO attribute information, the stripe ratio information, and the target splitting scenario includes: substituting the main IO attribute information and the stripe ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result.
[0130] In an exemplary embodiment, when the target splitting scenario is the first splitting scenario, the first splitting formula corresponding to the first splitting scenario includes: L cs =[T s ,T - P s ; L cs+1 →L ce-1 =[A s *T,T]; L ce =[A s *T,P e .
[0131] Among them, L cs refers to the starting sub-IO request, L cs+1 →L ce-1 refers to the intermediate sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, T refers to the data block length, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the rounded-down starting data block identifier, P e refers to the in-block offset length of the terminating sub-IO request.
[0132] In a possible implementation manner, when the target splitting scenario is the first splitting scenario, the main IO attribute information and the stripe ratio information can be substituted into the splitting formula L corresponding to the first splitting scenario cs =[T s ,T-P s , L cs+1 →L ce-1 =[A s *T,T],
[0133] L ce =[A s *T,P e where the T s refers to the sub-IO start position of the starting sub-IO request, and the T s =A s *T+P s , the A s =O / (N*T), the P s =O%T, and the T-P s refers to the sub-IO length information of the starting sub-IO request. The A s *T refers to the sub-IO start position of the intermediate sub-IO request, the T refers to the sub-IO length information of the intermediate sub-IO request, and the A s *T also refers to the sub-IO start position of the terminating sub-IO request, the P e refers to the sub-IO length information of the terminating sub-IO request, and the P e =(O+S)%T.
[0134] In an exemplary embodiment, when the target splitting scenario is the second splitting scenario, the second splitting formula corresponding to the second splitting scenario includes: L cs =[T s ,T-P s ; L cs+1 →L ce-1 =[A s *T,T]; L ce =[A s *T,T e .
[0135] Among them, L cs refers to the starting sub-IO request, L cs+1 →L ce-1 refers to the intermediate sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, T refers to the data block length, and P s refers to the in-block position offset length of the starting sub-IO request, and As Refers to the starting data block identifier after floor division, T e Refers to the offset position of the terminating sub-IO request within the terminating sub-IO.
[0136] In a possible implementation manner, when the target splitting scenario is the second splitting scenario, the main IO attribute information and the strip ratio information can be substituted into the splitting formula corresponding to the second splitting scenario L cs =[T s ,T - P s , L cs+1 →L ce-1 =[A s *T, T], L ce =[A s *T, T e where the T s refers to the sub-IO starting position of the starting sub-IO request, the T - P s refers to the sub-IO length information of the starting sub-IO request, the A s *T refers to the sub-IO starting position of the intermediate sub-IO request, the T refers to the length information of the intermediate sub-IO request, the A s *T refers to the sub-IO starting position of the terminating sub-IO request, the T e refers to the sub-IO length information of the terminating sub-IO request, the T e =A e *T + P e , the A e refers to the floor division terminating data block identifier, the A e =(O + S) / (N * T).
[0137] In an exemplary embodiment, when the target splitting scenario is the third splitting scenario, the third splitting formula corresponding to the third splitting scenario includes: L cs =L ce =[T s , S].
[0138] where L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, and S refers to the main IO length.
[0139] In a possible implementation manner, when the target splitting scenario is the third splitting scenario, the main IO attribute information and the strip ratio information can be substituted into the splitting formula corresponding to the third splitting scenario L cs =L ce =[Ts , in [S], the T s refers to the starting position of the sub-IO of the only existing sub-IO request, and the S refers to the sub-IO length information of the only existing sub-IO request.
[0140] In an exemplary embodiment, when the target splitting scenario is the fourth splitting scenario, the fourth splitting formula corresponding to the fourth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = L ce = [T s , (A e - A s ) * T - P s + P e ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T].
[0141] Among them, L [0,...,cs-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the rounded-up starting data block identifier, T refers to the data block length, R e refers to the rounded-up terminating data block identifier, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A e refers to the rounded-down terminating data block identifier, A s refers to the rounded-down starting data block identifier, P s refers to the in-block position offset length of the starting sub-IO request, P e refers to the in-block offset length of the terminating sub-IO request.
[0142] Optionally, the first intermediate sub-IO request includes the sub-IO request with serial number zero and the sub-IO requests between the sub-IO request with serial number zero and the starting sub-IO request, and the second intermediate sub-IO request includes the sub-IO requests between the starting sub-IO request and the sub-IO request with serial number N - 1 and the sub-IO request with serial number N - 1.
[0143] In a possible implementation manner, when the target splitting scenario is the fourth splitting scenario, the main IO attribute information and the stripe ratio information can be substituted into the splitting formula L corresponding to the fourth splitting scenario [0,...,cs-1] =[R s *T,(R e -R s )*T],L cs =[T s ,(A e -A s )*T-P s +P e ,L [cs+1,...,N-1] =[A s *T,(A e -A s )*T],L ce =[T s ,(A e -A s )*T-P s +P e In this formula, R s *T refers to the sub-IO start position of the first intermediate sub-IO request, (R e -R s )*T refers to the sub-IO length information of the first intermediate sub-IO request, T s refers to the sub-IO start position of the start sub-IO request, (A e -A s )*T-P s +P e refers to the sub-IO length information of the start sub-IO request, A s *T refers to the sub-IO start position of the second intermediate sub-IO request, (A e -A s )*T refers to the sub-IO length information of the second intermediate sub-IO request, T s refers to the sub-IO start position of the end sub-IO request, (A e -A s )*T-P s +P e refers to the sub-IO length information of the end sub-IO request.
[0144] In an exemplary embodiment, when the target splitting scenario is the fifth splitting scenario, the fifth splitting formula corresponding to the fifth splitting scenario includes: L [0,...,cs-1] =[R s *T,(R e -R s )*T];L cs =[T s ,(Re -A s )*T - P s ; L cs+1→ce-1 = [A s *T, (R e -A s )*T]; L ce = [A s *T, (A e -A s )*T + P e ; L [ce+1,...,N-1] = [A s *T, (A e -A s )*T].
[0145] Among them, L [0,...,cs-1] refers to the first intermediate sub - IO request, L cs refers to the starting sub - IO request, L cs+1→ce-1 refers to the second intermediate sub - IO request, L ce refers to the terminating sub - IO request, L [ce+1,...,N-1] refers to the third intermediate sub - IO request, R s refers to the ceiling - rounded starting data block identifier, T refers to the data block length, R e refers to the ceiling - rounded terminating data block identifier, A s refers to the floor - rounded starting data block identifier, P e refers to the in - block offset length of the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, P s refers to the in - block position offset length of the starting sub - IO request.
[0146] Optionally, the first intermediate sub - IO request includes the sub - IO request with serial number zero and the sub - IO requests between the sub - IO request with serial number zero and the starting sub - IO request. The second intermediate sub - IO request includes the sub - IO requests between the starting sub - IO request and the terminating sub - IO request. The third intermediate sub - IO request includes the sub - IO requests between the terminating sub - IO request and the sub - IO request with serial number N - 1 and the sub - IO request with serial number N - 1.
[0147] In a possible implementation manner, when the target splitting scenario is the fifth splitting scenario, the main IO attribute information and the strip ratio information can be substituted into the splitting formula corresponding to the fifth splitting scenario L [0,...,cs-1] = [R s *T, (R e -R s )*T], L cs = [T s, (R e -A s ) * T - P s , L cs+1→ce-1 = [A s *T, (R e -A s ) * T], L ce = [A s *T, (A e -A s ) * T + P e , L [ce+1,...,N-1] = [A s *T, (A e -A s ) * T] where the R s *T refers to the sub - IO start position of the first intermediate sub - IO request, the (R e -R s ) * T refers to the sub - IO length information of the first intermediate sub - IO request, the T s refers to the sub - IO start position of the starting sub - IO request, the (R e -A s ) * T - P s refers to the sub - IO length information of the starting sub - IO request, the A s *T refers to the sub - IO start position of the second intermediate sub - IO request, the (R e -A s ) * T refers to the sub - IO length information of the second intermediate sub - IO request, the T s *T refers to the sub - IO start position of the terminating sub - IO request, the (A e -A s ) * T + P s refers to the sub - IO length information of the terminating sub - IO request, the A s *T refers to the sub - IO start position of the third intermediate sub - IO request, the (A e -A s ) * T refers to the sub - IO length information of the third intermediate sub - IO request.
[0148] In an exemplary embodiment, when the target splitting scenario is the sixth splitting scenario, the sixth splitting formula corresponding to the sixth splitting scenario includes: L [0,...,ce-1] = [R s *T, (R e -R s ) * T]; L ce = [R s *T, (A e -R s ) * T + P e ; L ce+1→cs-1= [R s * T, (A e - R s ) * T]; L cs = [T s , (A e - A s ) * T - P s ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T].
[0149] Among them, L [0,...,ce-1] refers to the first intermediate sub - IO request, L cs refers to the starting sub - IO request, L ce+1→cs-1 refers to the second intermediate sub - IO request, L ce refers to the terminating sub - IO request, L [cs+1,...,N-1] refers to the third intermediate sub - IO request, R s refers to the ceiling - rounded starting data block identifier, T refers to the data block length, R e refers to the ceiling - rounded terminating data block identifier, P e refers to the in - block offset length of the terminating sub - IO request, A e refers to the floor - rounded terminating data block identifier, P s refers to the in - block position offset length of the starting sub - IO request, A s refers to the floor - rounded starting data block identifier, T s refers to the offset position of the starting sub - IO request within the starting sub - IO.
[0150] Optionally, the first intermediate sub - IO request includes the sub - IO request with serial number zero and the sub - IO requests between the sub - IO request with serial number zero and the terminating sub - IO request. The second intermediate sub - IO request includes the sub - IO requests between the terminating sub - IO request and the starting sub - IO request. The third intermediate sub - IO request includes the sub - IO requests between the starting sub - IO request and the sub - IO request with serial number N - 1 and the sub - IO request with serial number N - 1.
[0151] In a possible implementation manner, when the target splitting scenario is the sixth splitting scenario, the main IO attribute information and the stripe ratio information can be substituted into the splitting formula L [0,...,ce-1] = [R s * T, (R e - R s ) * T],
[0152] L ce = [R s*T, (A e -R s ) *T + P e , L ce+1→cs-1 =[R s *T, (A e -R s ) *T], L cs =[T s , (A e -A s ) *T - P s ,
[0153] L [cs+1,...,N-1] =[A s *T, (A e -A s ) *T] where the R s *T refers to the sub - IO start position of the first intermediate sub - IO request, and the (R e -R s ) *T refers to the sub - IO length information of the first intermediate sub - IO request. The R s *T refers to the sub - IO start position of the terminating sub - IO request, and the (A e -R s ) *T + P e refers to the sub - IO length information of the terminating sub - IO request. The R s *T refers to the sub - IO start position of the second intermediate sub - IO request, and the (A e -R s ) *T refers to the sub - IO length information of this second intermediate sub - IO request. The T s refers to the sub - IO start position of the starting sub - IO request, and the (A e -A s ) *T - P s refers to the sub - IO length information of the starting sub - IO request. The A s *T refers to the sub - IO start position of this third intermediate sub - IO request, and the (A e -A s ) *T refers to the sub - IO length information of the third intermediate sub - IO request.
[0154] In an exemplary embodiment, when the target splitting scenario is the seventh splitting scenario, the seventh splitting formula corresponding to the seventh splitting scenario includes: L [0,...,ce-1] =[R s *T, (R e -R s ) *T]; L ce =[R s *T, (A e -R s ) *T + Pe ; L cs = [T s , (A e -A s ) * T - P s ; L [cs+1,...,N-1] = [A s * T, (A e -A s ) * T]。
[0155] Among them, L [0,...,ce-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the rounded-up starting data block identifier, T refers to the data block length, R e refers to the rounded-up terminating data block identifier, A e refers to the rounded-down terminating data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, P s refers to the in-block position offset length of the starting sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A s refers to the rounded-down starting data block identifier.
[0156] Optionally, the first intermediate sub-IO request includes the sub-IO request with serial number zero and the sub-IO requests between the sub-IO request with serial number zero and the terminating sub-IO request, and the second intermediate sub-IO request includes the sub-IO requests between the starting sub-IO request and the sub-IO request with serial number N - 1 and the sub-IO request with serial number N - 1.
[0157] In a possible implementation manner, when the target splitting scenario is the seventh splitting scenario, the main IO attribute information and the stripe ratio information can be substituted into the splitting formula corresponding to the seventh splitting scenario L [0,...,ce-1] = [R s * T, (R e -R s ) * T],
[0158] L ce = [R s * T, (A e -R s ) * T + P e , L cs = [T s , (A e -As ) * T - P s , L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T] in, the R s * T refers to the sub - IO start position of the first intermediate sub - IO request, and the (R e - R s ) * T refers to the sub - IO length information of the first intermediate sub - IO request. The R s * T refers to the sub - IO start position of the terminating sub - IO request, and the (A e - R s ) * T + P e refers to the sub - IO length information of the terminating sub - IO request. The T s refers to the sub - IO start position of the starting sub - IO request, and the (A e - A s ) * T - P s refers to the sub - IO length information of the starting sub - IO request. The A s * T refers to the sub - IO start position of the second intermediate sub - IO request, and the (A e - A s ) * T refers to the sub - IO length information of the second intermediate sub - IO request.
[0159] Substituting the main IO attribute information and the stripe ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result can quickly determine the splitting result of the IO request based on simple calculations, avoiding the problem of long IO request splitting time in the prior art and effectively improving the splitting efficiency of the IO request.
[0160] In an exemplary embodiment, as Figure 8 shown, in the process of data merging for each sub - IO request, the method further includes the following steps:
[0161] Step 801: For each sub - IO request among the sub - IO requests, obtain the sub - IO attribute information of the sub - IO request.
[0162] Optionally, the sub - IO attribute information includes the start position O' of the sub - IO request, the length information S' of the sub - IO request, and the serial number I of the sub - IO.
[0163] Step 802: Determine the start position information of the sub - IO request and the end position information of the sub - IO request according to the sub - IO attribute information, the main IO attribute information, the stripe ratio information, and the granularity information of the sub - IO request.
[0164] Among them, the start position information of the sub-IO request includes the data block identifier of the start position of the sub-IO request after rounding down, the in-block offset length of the start position of the sub-IO request, the page identifier of the start position of the sub-IO request after rounding down, the in-block page identifier of the start position of the sub-IO request after rounding down, and the page identifier of the start position of the sub-IO request in this IO request. The end position information of the sub-IO request includes the page identifier of the end position of the sub-IO request after rounding up.
[0165] Optionally, the data block identifier of the start position of the sub-IO request after rounding down is A s , the in-block offset length of the start position of the sub-IO request is P s , the page identifier of the start position of the sub-IO request after rounding down is B s , the in-block page identifier of the start position of the sub-IO request after rounding down is B k , the page identifier of the start position of the sub-IO request in this IO request is B o , the page identifier of the end position of the sub-IO request after rounding up is B e .
[0166] In a possible implementation manner, the A s = O' / T, the P s = O'%T, the B s = O' / 8, the B k = (O' / 8)%B, the B o = ((A s * N * T + I * T + P s ) / 8) - (O / 8), B e = (O' + S' + 7) / 8, where B refers to the granularity information of the sub-IO request.
[0167] Step 803: Substitute the start position information and the end position information of the sub-IO request into the merging formula to determine the position information of the sub-IO request in this IO request.
[0168] In an optional embodiment of the present application, the sub-IO request includes multiple pages, the position information is used to represent the position information of each page in the sub-IO request in this IO request, and the merging formula includes: C i = B o + (((i + B k ) / B) * (N - 1) * B) + i; O' i = OC i ;
[0169] Among them, C i refers to the page identifier of the i-th page of the sub-IO request in this IO request, Bo refers to the page identifier of the starting position of the sub-IO request in the IO request, i refers to the sequence number of the sub-IO request, B k refers to the page identifier within the block of the starting position of the sub-IO request after rounding down, B refers to the granularity information of the sub-IO request, N refers to the stripe width, O' i refers to the data block result of the i-th page in the sub-IO request, and O refers to the starting offset position of the IO.
[0170] In a possible implementation manner, the page count of the sub-IO request can be determined first according to the page identifier of the ending position of the sub-IO request after rounding up and the page identifier of the starting position of the sub-IO request after rounding down. The page count of the sub-IO request is B t , the B t =B e -B s , and then for each page in the sub-IO request, substitute the starting position information and the ending position information of the sub-IO request into the merging formula to determine the page identifier of the page in the IO request.
[0171] In a possible implementation manner, as described above, the sub-IO request includes multiple pages. The page identifier of the i-th page in the sub-IO request in the IO request is C i , the C i =B o +(((i + B k ) / B) * (N - 1) * B) + i, that is, the data block result of the i-th page in the sub-IO request is the data block result of the C i -th page in the IO request, that is, O' i =O_C i .
[0172] Determining the page count of the sub-IO request according to the page identifier of the ending position of the sub-IO request after rounding up and the page identifier of the starting position of the sub-IO request after rounding down, and for each page in the sub-IO request, determining the page identifier of the page in the IO request according to the page identifier of the starting position of the sub-IO request in the IO request, the page identifier within the block of the starting position of the sub-IO request after rounding down, the granularity information of the sub-IO request, the stripe ratio information, and the identifier of the page realizes the restoration of the IO through simple calculations. Compared with the prior art where a specific storage space needs to be set to store the mapping relationship, the method provided in this embodiment can effectively reduce costs and thus effectively improve the processing efficiency of IO requests.
[0173] In an exemplary embodiment, as Figure 9As shown, another method for processing IO requests is provided. During the process of splitting an IO request, this method includes the following steps:
[0174] Step 901: Receive the IO request to be split. This IO request carries main IO attribute information, which includes the starting offset position of the main IO and the main IO length information of this IO request. According to this main IO attribute information and this stripe ratio information, obtain the starting data block identifier of the starting sub-IO request and the ending data block identifier of the ending sub-IO request among each sub-IO request. Perform a ceiling operation on the starting data block identifier to obtain the ceilinged starting data block identifier, and perform a ceiling operation on the ending data block identifier to obtain the ceilinged ending data block identifier.
[0175] Step 902: If the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, determine that the candidate splitting scenario is a single-layer splitting loop scenario. In the case where the candidate splitting scenario is this single-layer splitting loop scenario, if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the first splitting scenario; if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the second splitting scenario; if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is the third splitting scenario.
[0176] Step 903: If the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, determine that the candidate splitting scenario is a multi-layer splitting loop scenario. In the case where the candidate splitting scenario is this multi-layer splitting loop scenario, if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fourth splitting scenario; if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fifth splitting scenario; if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, and the floor-ceilinged ending data block identifier is greater than or less than the ceilinged starting data block identifier, determine that the target splitting scenario is the sixth splitting scenario. This sixth splitting scenario is used to represent that among the sub-IO requests obtained by splitting this IO request, if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, and the floor-ceilinged ending data block identifier is equal to the ceilinged starting data block identifier, determine that the target splitting scenario is the seventh splitting scenario.
[0177] Step 904: Determine the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request according to the main IO attribute information and the strip ratio information; determine the target splitting scenario from each of the candidate splitting scenarios according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request. Substitute the main IO attribute information and the strip ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result. The splitting result includes the sub-IO attribute information of each sub-IO request after the IO request is split, and the sub-IO attribute information includes the sub-IO starting position and the sub-IO length information of the sub-IO request.
[0178] In an exemplary embodiment, as Figure 10 shown, another method for processing an IO request is provided, which is used in the process of data merging of sub-IO requests. The method includes the following steps:
[0179] Step 1001: In the process of data merging of each sub-IO request, for each sub-IO request among the sub-IO requests, obtain the sub-IO attribute information of the sub-IO request.
[0180] Step 1002: Determine the starting position information and the ending position information of the sub-IO request according to the sub-IO attribute information, the main IO attribute information, the strip ratio information, and the granularity information of the sub-IO request.
[0181] Step 1003: Substitute the starting position information and the ending position information of the sub-IO request into the merging formula to determine the position information of the sub-IO request in the IO request. The sub-IO request includes multiple pages, and the position information is used to represent the position information of each page in the sub-IO request in the IO request.
[0182] It should be understood that although each step in the flowcharts involved in the above embodiments is shown in sequence according to the indication of the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0183] Based on the same inventive concept, an embodiment of the present application further provides an IO request processing apparatus for implementing the IO request processing method involved above. The solution provided by this apparatus for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the IO request processing apparatus provided below may refer to the limitations on the IO request processing method in the above text, and will not be elaborated here.
[0184] In an exemplary embodiment, as Figure 11 shown, an IO request processing apparatus 1100 is provided, including: a receiving module 1101, a determining module 1102, and an executing module 1103, where:
[0185] The receiving module 1101 is configured to receive an IO request to be split, where the IO request carries main IO attribute information, and the main IO attribute information includes the main IO start offset position and the main IO length information of the IO request;
[0186] The determining module 1102 is configured to determine a target splitting scenario of the IO request according to the main IO attribute information and preset strip ratio information;
[0187] The executing module 1103 is configured to determine a splitting result of the IO request according to the main IO attribute information, the strip ratio information, and the target splitting scenario, where the splitting result includes sub-IO attribute information of each sub-IO request after the IO request is split, and the sub-IO attribute information includes the sub-IO start position and the sub-IO length information of the sub-IO request.
[0188] In one embodiment, the determining module 1102 is specifically configured to obtain the start data block identifier of the start sub-IO request and the end data block identifier of the end sub-IO request in each sub-IO request according to the main IO attribute information and the strip ratio information; and determine the target splitting scenario according to the size relationship between the start data block identifier and the end data block identifier.
[0189] In one embodiment, the determining module 1102 is specifically configured to determine each candidate splitting scenario according to the size relationship between the start data block identifier and the end data block identifier; determine the sequence number of the start sub-IO request and the sequence number of the end sub-IO request according to the main IO attribute information and the strip ratio information; and determine the target splitting scenario from each candidate splitting scenario according to the size relationship between the sequence number of the start sub-IO request and the sequence number of the end sub-IO request.
[0190] In one embodiment, the determining module 1102 is specifically configured to perform ceiling processing on the starting data block identifier to obtain the ceilinged starting data block identifier, and perform ceiling processing on the ending data block identifier to obtain the ceilinged ending data block identifier; if the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, determine that the candidate splitting scenario is a single-layer splitting loop scenario; if the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, determine that the candidate splitting scenario is a multi-layer splitting loop scenario.
[0191] In one embodiment, the determining module 1102 is specifically configured to: if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is a first splitting scenario, where the first splitting scenario is used to represent that the IO request is split into at least two sub-IO requests, and there is an in-block position offset at the end position of the ending sub-IO request; if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine that the target splitting scenario is a second splitting scenario, where the second splitting scenario is used to represent that the IO request is split into at least two sub-IO requests, and there is no in-block position offset at the end position of the ending sub-IO request; if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is a third splitting scenario, where the third splitting scenario is used to represent that the IO request is split into one sub-IO request.
[0192] In one embodiment, the determining module 1102 is specifically configured to: if the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine the target splitting scenario according to the size relationship between the floor'ed ending data block identifier and the ceilinged starting data block identifier; if the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is a fourth splitting scenario, where the fourth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the starting sub-IO request and the ending sub-IO request are the same sub-IO request; if the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is a fifth splitting scenario, where the fifth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps after the starting sub-IO request.
[0193] In one embodiment, the determining module 1102 is specifically configured to determine that the target splitting scenario is the sixth splitting scenario if the floor-terminated data block identifier is greater than or less than the ceiling-starting data block identifier. The sixth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the terminating sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers each stripe. If the floor-terminated data block identifier is equal to the ceiling-starting data block identifier, it is determined that the target splitting scenario is the seventh splitting scenario. The seventh splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the terminating sub-IO request overlaps before the starting sub-IO request, and each sub-IO request covers a part of each of the stripes.
[0194] In one embodiment, the execution module 1103 is specifically configured to substitute the main IO attribute information and the stripe ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result.
[0195] In one embodiment, when the target splitting scenario is the first splitting scenario, the first splitting formula corresponding to the first splitting scenario includes: L cs =[T s , T - P s ; L cs+1 →L ce-1 =[A s *T, T]; L ce =[A s *T, P e ; where L cs refers to the starting sub-IO request, L cs+1 →L ce-1 refers to the intermediate sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, T refers to the data block length, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the floor-starting data block identifier, P e refers to the in-block offset length of the terminating sub-IO request.
[0196] In one embodiment, when the target splitting scenario is the second splitting scenario, the second splitting formula corresponding to the second splitting scenario includes: L cs =[T s , T - P s ; L cs+1 →L ce-1 =[A s *T, T]; Lce = [A s * T, T e ; where, L cs refers to the starting sub - IO request, L cs+1 → L ce-1 refers to the intermediate sub - IO request, L ce refers to the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, T refers to the data block length, P s refers to the in - block position offset length of the starting sub - IO request, A s refers to the starting data block identifier after floor - down, T e refers to the offset position of the terminating sub - IO request within the terminating sub - IO.
[0197] In one embodiment, when the target splitting scenario is the third splitting scenario, the third splitting formula corresponding to the third splitting scenario includes: L cs = L ce = [T s , S]; where, L cs refers to the starting sub - IO request, L ce refers to the terminating sub - IO request, T s refers to the offset position of the starting sub - IO request within the starting sub - IO, S refers to the main IO length.
[0198] In one embodiment, when the target splitting scenario is the fourth splitting scenario, the fourth splitting formula corresponding to the fourth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = L ce = [T s , (A e - A s ) * T - P s + P e ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; where, L [0,...,cs-1] refers to the first intermediate sub - IO request, L cs refers to the starting sub - IO request, L ce refers to the terminating sub - IO request, L [cs+1,...,N-1] refers to the second intermediate sub - IO request, R s refers to the starting data block identifier after ceiling - up, T refers to the data block length, Re Refers to the ceiling-terminated data block identifier, T s Refers to the offset position of the start sub-IO request within the start sub-IO, A e Refers to the floor-terminated data block identifier, A s Refers to the floor-started data block identifier, P s Refers to the in-block position offset length of the start sub-IO request, P e Refers to the in-block offset length of the end sub-IO request.
[0199] In one embodiment, when the target splitting scenario is the fifth splitting scenario, the fifth splitting formula corresponding to the fifth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = [T s , (R e - A s ) * T - P s ; L cs+1→ce-1 = [A s * T, (R e - A s ) * T]; L ce = [A s * T, (A e - A s ) * T + P e ; L [ce+1,...,N-1] = [A s * T, (A e - A s ) * T]; where L [0,...,cs-1] Refers to the first intermediate sub-IO request, L cs Refers to the start sub-IO request, L cs+1→ce-1 Refers to the second intermediate sub-IO request, L ce Refers to the end sub-IO request, L [ce+1,...,N-1] Refers to the third intermediate sub-IO request, R s Refers to the ceiling-started data block identifier, T refers to the data block length, R e Refers to the ceiling-terminated data block identifier, A s Refers to the floor-started data block identifier, P e Refers to the in-block offset length of the end sub-IO request, T s Refers to the offset position of the start sub-IO request within the start sub-IO, P s Refers to the in-block position offset length of the start sub-IO request.
[0200] In one embodiment, when the target splitting scenario is the sixth splitting scenario, the sixth splitting formula corresponding to the sixth splitting scenario includes: L [0,...,ce-1] = [R s * T, (R e - R s ) * T]; L ce = [R s * T, (A e - R s ) * T + P e ;
[0201] L ce+1→cs-1 = [R s * T, (A e - R s ) * T]; L cs = [T s , (A e - A s ) * T - P s ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; Wherein, L [0,...,ce-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce+1→cs-1 refers to the second intermediate sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the third intermediate sub-IO request, R s refers to the ceilinged starting data block identifier, T refers to the data block length, R e refers to the ceilinged terminating data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, A e refers to the floored terminating data block identifier, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the floored starting data block identifier, T s refers to the offset position of the starting sub-IO request within the starting sub-IO.
[0202] In one embodiment, when the target splitting scenario is the seventh splitting scenario, the seventh splitting formula corresponding to the seventh splitting scenario includes: L [0,...,ce-1] = [R s * T, (R e - R s ) * T]; L ce = [Rs *T, (A e -R s ) *T + P e ; L cs = [T s , (A e -A s ) *T - P s ; L [cs+1,...,N-1] = [A s *T, (A e -A s ) *T]; where, L [0,...,ce-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the ceilinged starting data block identifier, T refers to the data block length, R e refers to the ceilinged terminating data block identifier, A e refers to the floored terminating data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, P s refers to the in-block position offset length of the starting sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A s refers to the floored starting data block identifier.
[0203] In one embodiment, as Figure 12As shown, another IO request processing device 1200 is provided. In addition to each module included in the IO request device 1100, the IO request processing device 1200 further includes an acquisition module 1204. The acquisition module 1204 is configured to, during the process of merging data for each sub-IO request, for each sub-IO request among the sub-IO requests, acquire the sub-IO attribute information of the sub-IO request; determine the start position information and the end position information of the sub-IO request according to the sub-IO attribute information, the main IO attribute information, the stripe ratio information, and the granularity information of the sub-IO request. The start position information of the sub-IO request includes the data block identifier of the start position of the sub-IO request after rounding down, the in-block offset length of the start position of the sub-IO request, the page identifier of the start position of the sub-IO request after rounding down, the in-block page identifier of the start position of the sub-IO request after rounding down, and the page identifier of the start position of the sub-IO request in the IO request. The end position information of the sub-IO request includes the page identifier of the end position of the sub-IO request after rounding up; substitute the start position information and the end position information of the sub-IO request into the merging formula to determine the position information of the sub-IO request in the IO request.
[0204] In one embodiment, the sub-IO request includes multiple pages. The position information is used to represent the position information of each page in the sub-IO request in the IO request. The merging formula includes: C i = B o +(((i + B k ) / B) * (N - 1) * B) + i; O' i = OC i ; where C i refers to the page identifier of the i-th page in the sub-IO request in the IO request, B o refers to the page identifier of the start position of the sub-IO request in the IO request, i refers to the serial number of the sub-IO request, B k refers to the in-block page identifier of the start position of the sub-IO request after rounding down, B refers to the granularity information of the sub-IO request, N refers to the stripe width, and O' i refers to the data block result of the i-th page in the sub-IO request, and O refers to the IO start offset position.
[0205] Each module in the above-mentioned IO request processing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above-mentioned modules.
[0206] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in Figure 13 Shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, 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 the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements an IO request processing method.
[0207] Those skilled in the art can understand that Figure 13 The structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0208] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, it implements any one of the steps in the above embodiments.
[0209] In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, it implements any one of the steps in the above embodiments.
[0210] In an embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, it implements any one of the steps in the above embodiments.
[0211] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, 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, it should be considered as the scope recorded in this specification.
[0212] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. An IO request processing method, characterized in that, The method includes: Receiving an IO request to be split, where the IO request carries main IO attribute information, and the main IO attribute information includes the main IO starting offset position and the main IO length information of the IO request; Determining a target splitting scenario of the IO request according to the main IO attribute information and preset strip ratio information; Determining a splitting result of the IO request according to the main IO attribute information, the strip ratio information, and the target splitting scenario, where the splitting result includes sub-IO attribute information of each sub-IO request after splitting the IO request, and the sub-IO attribute information includes the sub-IO starting position and the sub-IO length information of the sub-IO request.
2. The method according to claim 1, wherein The determining the target splitting scenario of the IO request according to the main IO attribute information and the strip ratio information includes: Obtaining the starting data block identifier of the starting sub-IO request and the ending data block identifier of the ending sub-IO request in each sub-IO request according to the main IO attribute information and the strip ratio information; Determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier.
3. The method according to claim 2, characterized in that The determining the target splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier includes: Determining each candidate splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier; Determining the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request according to the main IO attribute information and the strip ratio information; Determining the target splitting scenario from each candidate splitting scenario according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request.
4. The method according to claim 3, characterized in that, The determining each candidate splitting scenario according to the size relationship between the starting data block identifier and the ending data block identifier includes: Performing ceiling processing on the starting data block identifier to obtain the ceilinged starting data block identifier, and performing ceiling processing on the ending data block identifier to obtain the ceilinged ending data block identifier; If the ceilinged starting data block identifier is equal to the ceilinged ending data block identifier, determining the candidate splitting scenario as a single-layer splitting loop scenario; If the ceilinged starting data block identifier is less than the ceilinged ending data block identifier, determining the candidate splitting scenario as a multi-layer splitting loop scenario.
5. The method according to claim 4, characterized in that, In the case where the candidate splitting scenario is the single-layer splitting loop scenario, the determining the target splitting scenario from each candidate splitting scenario according to the size relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request includes: If the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determining the target splitting scenario as a first splitting scenario, where the first splitting scenario is used to represent that at least two sub-IO requests are obtained by splitting the IO request, and there is an in-block position offset at the end position of the ending sub-IO request; If the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the second splitting scenario, where the second splitting scenario is used to represent that the IO request is split into at least two sub-IO requests, and there is no in-block position offset at the end position of the ending sub-IO request; If the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is the third splitting scenario, where the third splitting scenario is used to represent that the IO request is split into one sub-IO request.
6. The method according to claim 4, characterized in that When the candidate splitting scenario is the multi-layer splitting loop scenario, the determining of the target splitting scenario from each of the candidate splitting scenarios according to the magnitude relationship between the sequence number of the starting sub-IO request and the sequence number of the ending sub-IO request includes: If the sequence number of the starting sub-IO request is greater than the sequence number of the ending sub-IO request, determine the target splitting scenario according to the magnitude relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier; If the sequence number of the starting sub-IO request is equal to the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fourth splitting scenario, where the fourth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the starting sub-IO request and the ending sub-IO request are the same sub-IO request; If the sequence number of the starting sub-IO request is less than the sequence number of the ending sub-IO request, determine that the target splitting scenario is the fifth splitting scenario, where the fifth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps after the starting sub-IO request.
7. The method according to claim 6, wherein The determining of the target splitting scenario according to the magnitude relationship between the floor of the ending data block identifier and the ceiling of the starting data block identifier includes If the floor of the ending data block identifier is greater than or less than the ceiling of the starting data block identifier, determine that the target splitting scenario is the sixth splitting scenario, where the sixth splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps before the starting sub-IO request, and each of the sub-IO requests covers each stripe; If the floor of the ending data block identifier is equal to the ceiling of the starting data block identifier, determine that the target splitting scenario is the seventh splitting scenario, where the seventh splitting scenario is used to represent that among the sub-IO requests obtained by splitting the IO request, the ending sub-IO request overlaps before the starting sub-IO request, and each of the sub-IO requests covers a part of each of the stripes.
8. The method according to any one of claims 5 to 7, characterized in that, The determining of the splitting result of the IO request according to the main IO attribute information, the stripe ratio information, and the target splitting scenario includes: Substitute the main IO attribute information and the stripe ratio information into the splitting formula corresponding to the target splitting scenario to obtain the splitting result.
9. The method according to claim 8, characterized in that, In the case where the target splitting scenario is the first splitting scenario, the first splitting formula corresponding to the first splitting scenario includes: L cs = [T s , T - P s ; L cs+1 →L ce-1 =[A s *T,T]; L ce = [A s * T, P e ; Among them, L cs refers to the starting sub-IO request, L cs+1 →L ce-1 refers to the intermediate sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, T refers to the data block length, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the floor of the starting data block identifier, P e refers to the in-block offset length of the terminating sub-IO request.
10. The method according to claim 8, characterized in that, In the case where the target splitting scenario is the second splitting scenario, the second splitting formula corresponding to the second splitting scenario includes: L cs = [T s , T - P s ; L cs+1 →L ce-1 =[A s *T,T]; L ce = [A s * T, T e ; Among them, L cs refers to the starting sub-IO request, L cs+1 →L ce-1 refers to the intermediate sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, T refers to the data block length, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the floor-started starting data block identifier, T e refers to the offset position of the terminating sub-IO request within the terminating sub-IO.
11. The method according to claim 8, characterized in that In the case where the target splitting scenario is the third splitting scenario, the third splitting formula corresponding to the third splitting scenario includes: L cs = L ce = [T s , S]; Among them, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, and S refers to the main IO length.
12. The method according to claim 8, wherein In the case where the target splitting scenario is the fourth splitting scenario, the fourth splitting formula corresponding to the fourth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = L ce = [T s , (A e - A s ) * T - P s + P e ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; Wherein, L [0,...,cs-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the rounded-up starting data block identifier, T refers to the data block length, R e refers to the rounded-up terminating data block identifier, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A e refers to the rounded-down terminating data block identifier, A s refers to the rounded-down starting data block identifier, P s refers to the in-block position offset length of the starting sub-IO request, P e refers to the in-block offset length of the terminating sub-IO request.
13. The method according to claim 8, wherein In the case where the target splitting scenario is the fifth splitting scenario, the fifth splitting formula corresponding to the fifth splitting scenario includes: L [0,...,cs-1] = [R s * T, (R e - R s ) * T]; L cs = [T s , (R e - A s ) * T - P s ; L cs+1→ce-1 = [A s * T, (R e - A s ) * T]; L ce = [A s * T, (A e - A s ) * T + P e ; L [ce+1,...,N-1] = [A s * T, (A e - A s ) * T]; Among them, L [0,...,cs-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L cs+1→ce-1 refers to the second intermediate sub-IO request, L ce refers to the terminating sub-IO request, L [ce+1,...,N-1] refers to the third intermediate sub-IO request, R s refers to the ceilinged starting data block identifier, T refers to the data block length, R e refers to the ceilinged terminating data block identifier, A s refers to the floored starting data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, P s refers to the in-block position offset length of the starting sub-IO request.
14. The method according to claim 8, characterized in that In the case where the target splitting scenario is the sixth splitting scenario, the sixth splitting formula corresponding to the sixth splitting scenario includes: L [0,...,ce-1] = [R s * T, (R e - R s ) * T]; L ce = [R s * T, (A e - R s ) * T + P e ; L ce+1→cs-1 = [R s * T, (A e - R s ) * T]; L cs = [T s , (A e - A s ) * T - P s ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; Among them, L [0,...,ce-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce+1→cs-1 refers to the second intermediate sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the third intermediate sub-IO request, R s refers to the ceilinged starting data block identifier, T refers to the data block length, R e refers to the ceilinged terminating data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, A e refers to the floored terminating data block identifier, P s refers to the in-block position offset length of the starting sub-IO request, A s refers to the floored starting data block identifier, T s refers to the offset position of the starting sub-IO request within the starting sub-IO,.
15. The method according to claim 8, characterized in that In the case where the target splitting scenario is the seventh splitting scenario, the seventh splitting formula corresponding to the seventh splitting scenario includes: L [0,...,ce-1] = [R s * T, (R e - R s ) * T]; L ce = [R s * T, (A e - R s ) * T + P e ; L cs = [T s , (A e - A s ) * T - P s ; L [cs+1,...,N-1] = [A s * T, (A e - A s ) * T]; Among them, L [0,...,ce-1] refers to the first intermediate sub-IO request, L cs refers to the starting sub-IO request, L ce refers to the terminating sub-IO request, L [cs+1,...,N-1] refers to the second intermediate sub-IO request, R s refers to the rounded-up starting data block identifier, T refers to the data block length, R e refers to the rounded-up terminating data block identifier, A e refers to the rounded-down terminating data block identifier, P e refers to the in-block offset length of the terminating sub-IO request, P s refers to the in-block position offset length of the starting sub-IO request, T s refers to the offset position of the starting sub-IO request within the starting sub-IO, A s refers to the rounded-down starting data block identifier.
16. The method according to claim 1, characterized in that, The method further includes: During the process of data merging for each of the sub-IO requests, for each sub-IO request among the sub-IO requests, obtain the sub-IO attribute information of the sub-IO request; Determine the start position information and the end position information of the sub-IO request according to the sub-IO attribute information, the main IO attribute information, the stripe ratio information, and the granularity information of the sub-IO request. The start position information of the sub-IO request includes the data block identifier of the start position of the sub-IO request after rounding down, the in-block offset length of the start position of the sub-IO request, the page identifier of the start position of the sub-IO request after rounding down, the in-block page identifier of the start position of the sub-IO request after rounding down, and the page identifier of the start position of the sub-IO request in the IO request. The end position information of the sub-IO request includes the page identifier of the end position of the sub-IO request after rounding up; Substitute the start position information and the end position information of the sub-IO request into the merging formula to determine the position information of the sub-IO request in the IO request.
17. The method according to claim 16, wherein The sub-IO request includes multiple pages, the position information is used to represent the position information of each page in the sub-IO request in the IO request, and the merging formula includes: C i = B o +(((i + B k ) / B) * (N - 1) * B)+ i; O' i = OC i ; Among them, C i refers to the page identifier of the i-th page of the sub-IO request in the IO request, B o refers to the page identifier of the starting position of the sub-IO request in the IO request, i refers to the serial number of the sub-IO request, B k refers to the page identifier within the block of the starting position of the sub-IO request after rounding down, B refers to the granularity information of the sub-IO request, N refers to the stripe width, O' i refers to the data block result of the i-th page in the sub-IO request, O refers to the IO starting offset position.
18. A request processing device, characterized in that, The apparatus includes: A receiving module, configured to receive an IO request to be split, where the IO request carries main IO attribute information, and the main IO attribute information includes the main IO start offset position and the main IO length information of the IO request; A determining module, configured to determine the target splitting scenario of the IO request according to the main IO attribute information and a preset stripe ratio information; An execution module, configured to determine the splitting result of the IO request according to the main IO attribute information, the stripe ratio information, and the target splitting scenario. The splitting result includes the sub-IO attribute information of each sub-IO request after splitting the IO request, and the sub-IO attribute information includes the sub-IO start position and the sub-IO length information of the sub-IO request.
19. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 17 are implemented.
20. 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 17 are implemented.
21. A computer program product, comprising a computer program, 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 17 are implemented.