Storage Multipath Routing Method, Apparatus, Device, and Storage Medium
By comprehensively considering multiple dimensions of storage multi-path routing method, dynamically calculate the path weight value, and selecting the optimal path for I/O processing, it solves the problem of path selection in traditional methods and improves I/O processing speed and efficiency.
Patent Information
- Application Number
- CN202211048768.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-08-30
AI Technical Summary
The existing storage multipath path selection method only evaluates the I/O processing capability of the path based on a single dimension, resulting in the optimal path selection being one-sided, which cannot meet the actual I/O processing speed and efficiency.
By taking into account the preset I/O weight value of the memory hard disk, the current unprocessed I/O information value of the physical link, and the standard time-consuming of one I/O processing on the link, the weight value of each path is dynamically calculated, and the link with the smallest path weight value is selected as the optimal path for I/O processing.
Real-time dynamic selection of the optimal path is realized, the I/O processing speed and efficiency are improved, and the problem of path selection in traditional methods is solved.
Smart Images

Figure CN115525223B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer storage technologies, and particularly to a storage multi-path routing method, apparatus, device, and storage medium. Background Art
[0002] With the development of computer storage technologies, the demand for all-weather data access has become the norm, making the I / O processing speed and reliability of storage systems the focus of attention of various storage manufacturers. As a way to simultaneously solve load balancing and path reliability, storage I / O multi-path has also become a research direction for various storage manufacturers. Generally, storage I / O multi-path has two main functions, namely path redundancy and load balancing. Among them, path redundancy is used to improve path reliability and prevent problems such as I / O read / write failures caused by single-path failures from affecting host business applications; while load balancing is used to increase the I / O throughput of the client host and make it not restricted by the bandwidth of a single-path link.
[0003] In traditional implementation methods, storage multi-path routing methods include a failover mode, a polling mode, a minimum queue depth mode, and a minimum I / O block size mode, etc. However, the foregoing methods all evaluate the expected I / O processing capabilities of each I / O path based on a certain dimension. In this way, the obtained evaluation results are all one-sided, and further, the processing speed of the optimal path finally selected based on the expected I / O processing capabilities still fails to reach the expectation. Summary of the Invention
[0004] Based on this, the present application provides a storage multi-path routing method, apparatus, device, and storage medium, which solves the problem that in conventional multi-path routing methods, only path load or I / O processing time cannot reflect the real-time changes in the real-time I / O processing capabilities of different paths; and realizes dynamically calculating the weights of each path in real time through multiple dimensions and selecting the optimal path to achieve the effects of accelerating I / O processing speed and improving I / O processing efficiency.
[0005] In a first aspect, a storage multi-path routing method is provided, which is applied to a system including a host and a memory, and multiple physical links are provided between the host and the memory. The method includes:
[0006] Obtain the preset I / O weight value of the memory hard disk and the current unprocessed I / O information values of each physical link;
[0007] Based on the obtained preset I / O weight value and the current unprocessed I / O information values of each physical link, obtain the to-be-processed I / O capability values of each physical link;
[0008] Obtain the standard time consumption of the previous I / O processing on each physical link, and combine the corresponding to-be-processed I / O capability values to obtain the path weight values of each physical link;
[0009] Compare the path weight values of each physical link, and select the physical link with the smallest path weight value as the optimal path;
[0010] Send the I / O currently to be processed by the host to the memory for processing through the optimal path.
[0011] According to an implementable manner in the embodiments of the present application, the preset I / O weight value includes a preset I / O quantity weight value and a preset I / O size weight value; the current unprocessed I / O information value includes the current unprocessed I / O quantity value and the current unprocessed total I / O size value; based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link, obtain the to-be-processed I / O capacity value of each physical link, including:
[0012] Based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link;
[0013] Based on the preset I / O size weight value and the current unprocessed total I / O size value of each physical link, obtain the to-be-processed total I / O size capacity value of each physical link;
[0014] Perform an addition operation on the to-be-processed I / O quantity capacity value and the corresponding to-be-processed total I / O size capacity value of each physical link to obtain the to-be-processed I / O capacity value of each physical link.
[0015] According to an implementable manner in the embodiments of the present application, the preset I / O quantity weight value includes a preset read I / O quantity weight value and a preset write I / O quantity weight value; the current unprocessed I / O quantity value includes the current unprocessed read I / O quantity value and the current unprocessed write I / O quantity value; based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link, including:
[0016] Perform a multiplication operation on the preset read I / O quantity weight value and the current unprocessed read I / O quantity value of each physical link respectively to obtain the to-be-processed read I / O quantity capacity value of each physical link;
[0017] Perform a multiplication operation on the preset write I / O quantity weight value and the current unprocessed write I / O quantity value of each physical link respectively to obtain the to-be-processed write I / O quantity capacity value of each physical link;
[0018] Perform an addition operation on the to-be-processed read I / O quantity capacity value and the corresponding to-be-processed write I / O quantity capacity value of each physical link to obtain the to-be-processed I / O quantity capacity value of each physical link.
[0019] According to an implementable manner in the embodiments of the present application, the preset I / O size weight value includes a preset read I / O size weight value and a preset write I / O size weight value; the current unprocessed total I / O size value includes the current unprocessed total read I / O size value and the current unprocessed total write I / O size value; based on the preset I / O size weight value and the current unprocessed total I / O size value of each physical link, obtaining the to-be-processed total I / O size capability value of each physical link includes:
[0020] Performing a multiplication operation on the preset read I / O size weight value and the current unprocessed total read I / O size value of each physical link respectively to obtain the to-be-processed read I / O size capability value of each physical link;
[0021] Performing a multiplication operation on the preset write I / O size weight value and the current unprocessed total write I / O size value of each physical link respectively to obtain the to-be-processed write I / O size capability value of each physical link;
[0022] Performing an addition operation on the to-be-processed read I / O size capability value and the corresponding to-be-processed write I / O size capability value of each physical link to obtain the to-be-processed total I / O size capability value of each physical link.
[0023] According to an implementable manner in the embodiments of the present application, obtaining the standard time consumption of the previous I / O processing on each physical link and combining it with the corresponding to-be-processed I / O capability value to obtain the path weight value of each physical link includes:
[0024] Obtaining the time weight value of the previous I / O processing on each physical link;
[0025] Performing an addition operation on the preset read I / O size weight value and the preset write I / O size weight value of the memory hard disk to obtain the sum of the preset I / O size weight values;
[0026] Performing a ratio operation on the time weight value of the previous I / O processing on each physical link and the sum of the preset I / O size weight values respectively to obtain the standard time consumption of the previous I / O processing on each physical link;
[0027] Performing a multiplication operation on the to-be-processed I / O capability value of each physical link and the standard time consumption of the corresponding previous I / O processing to obtain the path weight value of each physical link.
[0028] According to an implementable manner in the embodiments of the present application, obtaining the time weight value of the previous I / O processing on each physical link includes:
[0029] Obtaining the I / O type of the previous I / O processing on each physical link; wherein, the I / O type includes a read I / O type and a write I / O type;
[0030] Obtain the time taken for the last I / O processing on each physical link; wherein, the time taken for I / O processing includes the time taken for read I / O processing and the time taken for write I / O processing;
[0031] When the I / O type is the read I / O type, multiply the time taken for the last read I / O processing on each physical link by the preset write I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link;
[0032] When the I / O type is the write I / O type, multiply the time taken for the last write I / O processing on each physical link by the preset read I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link.
[0033] According to an implementable manner in the embodiments of the present application, during the process of sending the currently to-be-processed I / O of the host to the memory for processing through the optimal path and after the memory finishes processing, the current unprocessed I / O information value of the optimal path is updated in real time.
[0034] In a second aspect, a storage multi-path routing device is provided, which is applied to a system including a host and a memory, and multiple physical links are set between the host and the memory. The device is set in the system, and the device includes:
[0035] An acquisition module, configured to acquire the preset I / O weight value of the memory hard disk and the current unprocessed I / O information value of each physical link;
[0036] A first calculation module, configured to obtain the to-be-processed I / O capacity value of each physical link based on the acquired preset I / O weight value and the current unprocessed I / O information value of each physical link;
[0037] A second calculation module, configured to obtain the standard time taken for the last I / O processing on each physical link, and combine the corresponding to-be-processed I / O capacity value to obtain the path weight value of each physical link;
[0038] A comparison and routing module, configured to compare the path weight values of each physical link, and take the physical link with the smallest path weight value as the optimal path;
[0039] A storage sending module, configured to send the currently to-be-processed I / O of the host to the memory for processing through the optimal path
[0040] In a third aspect, a computer device is provided, including:
[0041] At least one processor; and
[0042] A memory communicatively connected to at least one processor; wherein,
[0043] The memory stores computer instructions that can be executed by at least one processor. The computer instructions are executed by at least one processor to enable the at least one processor to execute the method involved in the above first aspect.
[0044] In a fourth aspect, a computer-readable storage medium is provided, on which computer instructions are stored. The computer instructions are used to cause a computer to execute the method involved in the above first aspect.
[0045] According to the technical content provided by the embodiments of the present application, by obtaining the preset I / O weight value of the memory hard disk and the current unprocessed I / O information value of each physical link; obtaining the to-be-processed I / O capability value of each physical link based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link; obtaining the standard time-consuming of the previous I / O processing on each physical link, and combining the corresponding to-be-processed I / O capability value to obtain the path weight value of each physical link; comparing the path weight values of each physical link, and taking the physical link with the smallest path weight value as the optimal path; sending the I / O currently to be processed by the host to the memory through the optimal path for processing. By comprehensively considering the three dimensions of the I / O processing capability of the memory hard disk, the load conditions of each physical link, and the standard time-consuming of the previous I / O processing on each physical link, the path weight value of each physical link is calculated in real time, and the time-consuming required for the unprocessed I / O on the current path is predicted and evaluated based on the calculated path weight value of each physical link. The physical link with the smallest path weight value, that is, the one with the least predicted time-consuming for the unprocessed I / O on the current path, is selected as the optimal path. It is expected that sending the I / O currently to be processed by the host to this path can achieve the effect of accelerating the I / O processing speed and improving the I / O processing efficiency. Description of the Drawings
[0046] Figure 1 It is a system architecture diagram of a storage multi-path routing method in an embodiment;
[0047] Figure 2 It is a flowchart of a storage multi-path routing method in an embodiment;
[0048] Figure 3 It is a flowchart of step 203 in a storage multi-path routing method in an embodiment;
[0049] Figure 4 It is a flowchart of step 2031 in a storage multi-path routing method in an embodiment;
[0050] Figure 5 It is a flowchart of step 2033 in a storage multi-path routing method in an embodiment;
[0051] Figure 6It is a schematic flowchart of step 205 in a storage multi-path routing method in an embodiment;
[0052] Figure 7 It is a structural block diagram of a storage multi-path routing device in an embodiment;
[0053] Figure 8 It is a schematic structural diagram of a computer device in an embodiment. Detailed implementation manners
[0054] The present application will be further described in detail below in conjunction with 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.
[0055] For ease of understanding, the system applicable to the present application will be described first. A storage multi-path routing method provided by the present application can be applied to a system architecture as Figure 1 shown. This system architecture includes: host-switch-memory. In an FC network environment, when the host and the memory communicate, an FC HBA card (Fibre Channel Host Bus Adapter) is required, and both the host side and the storage side support multiple FC HBA cards. Each FC HBA card supports multiple ports, thereby realizing the redundancy of the physical links on the host side and the storage side, and solving the problem that the hard disk of the memory cannot be accessed due to the failure of a certain HBA card or port on the host side or the storage side; at the same time, switch redundancy is added between the host and the memory to realize the problem that the host cannot access the hard disk of the memory due to the failure of a single switch. Figure 1 Taking two hosts, two switches, and one memory as an example, both host A, host B, and the memory contain two FC HBA cards, and each FC HBA card contains two Port ports. Then either host A or host B can access the hard disk of the memory through 32 (4*2*4) physical links.
[0056] Figure 2 It is a flowchart of a storage multi-path routing method provided by an embodiment of the present application. This method can be executed by a system as Figure 1 shown. As Figure 2 shown, this method may include the following steps:
[0057] Step 201: Obtain the preset I / O weight value of the memory hard disk and the current unprocessed I / O information value of each physical link.
[0058] Among them, the full name of I / O is MPIO (Multipath I / O), which is a framework provided by Microsoft that allows storage providers to develop ALUA (Asymmetric Logical Unit Access) multipaths. Here, ALUA is a storage multipath mode, that is, storage multipaths can be divided into an optimal group and a non-optimal group. The I / O processing speed of selecting the lower path in the optimal group is faster than that of the non-optimal group path.
[0059] Specifically, obtain the preset I / O weight value of the storage hard disk; among them, the preset I / O weight value is pre-set inside the storage hard disk by the staff based on the ability of the storage to process I / O, which reflects the staff's judgment on the expected ability of the current storage to process I / O. Obtain the current unprocessed I / O information value of each physical link between the host and the storage; among them, the current unprocessed I / O information value reflects the load situation of each physical link.
[0060] Step 203: Obtain the to-be-processed I / O ability value of each physical link based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link.
[0061] Here, based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link, it can be preliminarily judged the ability to process I / O when sending the current to-be-processed I / O to the corresponding physical link, that is, the to-be-processed I / O ability value of each physical link.
[0062] Step 205: Obtain the standard time consumption of the last I / O processing on each physical link, and combine the corresponding to-be-processed I / O ability value to obtain the path weight value of each physical link.
[0063] Here, obtain the standard time consumption of the last I / O processing on each physical link; among them, the standard time consumption of the last I / O processing on each physical link is the standard time consumption of the most recent I / O processing on each physical link, which represents the I / O processing ability of each physical link under the combined action of known and unknown influencing factors (such as differences in physical link bandwidth, network fluctuations, the impact of storage ALUA on the path, etc., will all be reflected in the standard time consumption of I / O processing), that is, it can reflect the real-time ability situation of each physical link to process I / O.
[0064] It should be noted that if the current physical link has not processed any I / O yet, the standard time consumption of the last I / O processing is defaulted to 0.
[0065] Specifically, by comprehensively considering the I / O capacity value to be processed and the standard time consumption of the previous I / O processing on each physical link, the path weight value of each physical link can be obtained, which is the predicted I / O processing capacity value of each physical link.
[0066] Step 207: Compare the path weight values of each physical link, and select the physical link with the smallest path weight value as the optimal path.
[0067] Here, since there are multiple physical links (i.e., multiple paths) between the host and the memory, it is necessary to compare the path weight values of each physical link. Through comparison, the physical link with the smallest path weight value can be obtained. Selecting the physical link with the smallest path weight value as the optimal path is the path with the fastest expected I / O processing speed. It should be noted that if there are multiple physical links with the same and smallest path weight values, any one of them can be randomly selected as the optimal path.
[0068] Step 209: Send the I / O currently to be processed by the host to the memory for processing through the optimal path.
[0069] Specifically, after determining the optimal path, send the I / O currently to be processed by the host to the memory for processing through this path, in order to achieve the fastest processing effect.
[0070] It can be seen that in the embodiment of the present application, by obtaining the preset I / O weight value of the memory hard disk and the current unprocessed I / O information value of each physical link; obtaining the I / O processing capacity value to be processed of each physical link based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link; obtaining the standard time consumption of the previous I / O processing on each physical link, and combining the corresponding I / O processing capacity value to be processed to obtain the path weight value of each physical link; comparing the path weight values of each physical link, and selecting the physical link with the smallest path weight value as the optimal path; sending the I / O currently to be processed by the host to the memory for processing through the optimal path. By comprehensively considering the three dimensions of the I / O processing capacity of the memory hard disk, the load conditions of each physical link, and the standard time consumption of the previous I / O processing on each physical link, the path weight value of each physical link is calculated in real time. Based on the calculated path weight value of each physical link, the time consumption required for the unprocessed I / O on the current path is predicted and evaluated. Selecting the physical link with the smallest path weight value, that is, the one with the least predicted time consumption required for the unprocessed I / O on the current path, as the optimal path, it is expected that sending the I / O currently to be processed by the host to this path can achieve the effect of accelerating the I / O processing speed and improving the I / O processing efficiency.
[0071] Refer to Figure 3, The above step 203, that is, "obtaining the to-be-processed I / O capacity value of each physical link based on the obtained preset I / O weight value and the current unprocessed I / O information value of each physical link", will be described in detail below in conjunction with the embodiments.
[0072] Step 2031: Based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link.
[0073] Among them, the preset I / O weight value includes a preset I / O quantity weight value and a preset I / O size weight value; the preset I / O quantity weight value is the weight value of the current memory's I / O quantity processing capacity, and the larger the weight value, the lower the processing capacity. The preset I / O size weight value is the weight value of the current memory's I / O size processing capacity, and the larger the weight value, the lower the processing capacity. The current unprocessed I / O information value includes the current unprocessed I / O quantity value and the current unprocessed total I / O size value. The current unprocessed I / O quantity value is the quantity of unprocessed I / Os on the current physical link, representing the load of I / O traffic or bandwidth on the current path; the current unprocessed total I / O size value is the total size of unprocessed I / Os on the current physical link, representing the depth load of the I / O to-be-processed queue on the current path. Therefore, the load situation of the current path can be evaluated from the dimensions of the current unprocessed total I / O size value and the quantity value.
[0074] Here, there is only one preset I / O quantity weight value, while there are multiple current unprocessed I / O quantity values corresponding to each physical link. Therefore, based on the preset I / O quantity weight value and the current unprocessed I / O quantity values of each physical link, the preset I / O quantity weight value needs to be processed separately with each current unprocessed I / O quantity value to obtain the to-be-processed I / O quantity capacity value of each physical link. The to-be-processed I / O quantity capacity value of one physical link is represented by io.
[0075] Step 2033: Based on the preset I / O size weight value and the current unprocessed total I / O size value of each physical link, obtain the to-be-processed total I / O size capacity value of each physical link.
[0076] Here, there is only one preset I / O size weight value, while there are multiple current unprocessed total I / O size values corresponding to each physical link. Therefore, based on the preset I / O size weight value and the current unprocessed total I / O size values of each physical link, the preset I / O size weight value needs to be processed separately with each current unprocessed total I / O size value to obtain the to-be-processed total I / O size capacity value of each physical link. The to-be-processed total I / O size capacity value of one physical link is represented by sector.
[0077] Step 2035, perform an addition operation on the to-be-processed I / O quantity capacity values and the corresponding to-be-processed I / O total size capacity values of each physical link to obtain the to-be-processed I / O capacity value of each physical link.
[0078] Here, after obtaining the to-be-processed I / O quantity capacity values of each physical link and the to-be-processed I / O total size capacity values of each physical link, perform an addition operation on the to-be-processed I / O quantity capacity value and the to-be-processed I / O total size capacity value corresponding to each physical link, and then obtain the to-be-processed I / O capacity value of each physical link, which is represented by And. The specific expression of the to-be-processed I / O capacity value of one physical link is as follows:
[0079] And = io + sector
[0080] In one embodiment, as Figure 4 shown, the above step 2031, that is, "based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link", is described in detail.
[0081] Step 20311, perform a multiplication operation on the preset read I / O quantity weight value and the current unprocessed read I / O quantity value of each physical link respectively to obtain the to-be-processed read I / O quantity capacity value of each physical link.
[0082] Among them, the preset I / O quantity weight value includes the preset read I / O quantity weight value and the preset write I / O quantity weight value. The preset read I / O quantity weight value is represented by weight_read_io, which reflects the ability of the current memory to process the read I / O quantity. The current unprocessed I / O quantity value includes the current unprocessed read I / O quantity value and the current unprocessed write I / O quantity value. The current unprocessed read I / O quantity value is represented by active_read_io, which is the quantity of unprocessed read I / O on the current physical link.
[0083] Here, assume that the to-be-processed read I / O quantity capacity value of one physical link is represented by read_io, and the specific expression is as follows:
[0084] read_io = active_read_io * weight_read_io
[0085] Step 20313, perform a multiplication operation on the preset write I / O quantity weight value and the current unprocessed write I / O quantity value of each physical link respectively to obtain the to-be-processed write I / O quantity capacity value of each physical link.
[0086] Among them, the preset write I / O quantity weight value is represented by weight_write_io, which reflects the ability of the current memory to process the quantity of write I / Os. The value of the current unprocessed write I / O quantity is represented by active_write_io, which is the quantity of unprocessed write I / Os on the current physical link.
[0087] Here, assume that the ability value of the write I / O quantity to be processed on one of the physical links is represented by write_io, and the specific expression is as follows:
[0088] write_io = active_write_io * weight_write_io
[0089] Step 20315, perform an addition operation on the ability values of the read I / O quantity to be processed and the corresponding ability values of the write I / O quantity to be processed for each physical link, to obtain the ability values of the I / O quantity to be processed for each physical link.
[0090] Here, as can be seen from the above, the ability value of the I / O quantity to be processed on one of the physical links is represented by io, and its specific expression is as follows:
[0091] io = read_io + write_io
[0092] It should be noted that when the staff preset the preset read I / O quantity weight value and the preset write I / O quantity weight value, they will consider the read and write speeds. That is, if the memory writes data slower than reading data, a larger weight can be preset for write I / O and a smaller weight for read I / O. For example, weight_read_io = 80 and weight_write_io = 90, which means that writing 1 I / O is slower than reading 1 I / O, and the average time for writing 8 I / Os is equal to the time for reading 9 I / Os.
[0093] In one embodiment, as Figure 5 shown, a detailed description is given for the above step 2033, that is, "Based on the preset I / O total size weight value and the current unprocessed I / O total size values of each physical link, obtain the ability values of the I / O total size to be processed for each physical link".
[0094] Step 20331, perform a multiplication operation on the preset read I / O total size weight value and the current unprocessed read I / O total size values of each physical link respectively, to obtain the ability values of the read I / O total size to be processed for each physical link.
[0095] Among them, the preset I / O total size weight value includes the preset read I / O total size weight value and the preset write I / O total size weight value. The preset read I / O total size weight value is represented by weight_read_sector, which reflects the ability of the current memory to process the total size of read I / O. The current unprocessed I / O total size value includes the current unprocessed read I / O total size value and the current unprocessed write I / O total size value. The current unprocessed read I / O total size value is represented by active_read_sector, which is the total size of the unprocessed read I / O on the current physical link.
[0096] Here, assuming that the value of the read I / O total size processing ability of one of the physical links is represented by read_sector, the specific expression is as follows:
[0097] read_sector = active_read_sector * weight_read_sector
[0098] Step 20333: Multiply the preset write I / O total size weight value and the current unprocessed write I / O total size value of each physical link respectively to obtain the write I / O total size processing ability value of each physical link to be processed.
[0099] Among them, the preset write I / O total size weight value is represented by weight_write_sector, which reflects the ability of the current memory to process the total size of write I / O. The current unprocessed write I / O total size value is represented by active_write_sector, which is the total size of the unprocessed write I / O on the current physical link.
[0100] Here, assuming that the value of the write I / O total size processing ability of one of the physical links is represented by write_io, the specific expression is as follows:
[0101] write_sector = active_write_sector * weight_write_sector
[0102] Step 20335: Add the read I / O total size processing ability value and the corresponding write I / O total size processing ability value of each physical link to obtain the I / O total size processing ability value of each physical link to be processed.
[0103] Here, as can be seen from the above, the value of the I / O total size processing ability of one of the physical links is represented by sector, and the specific expression is as follows:
[0104] sector = read_sector + write_sector
[0105] It should be noted that when the staff sets the preset I / O quantity weight value and the preset I / O size weight value, if the preset total read I / O size weight value and the preset total write I / O size weight value are set to be the same, for example, weight_read_sector = 10 and weight_write_sector = 10, it means that the processing speeds of the read I / O and write I / O of this memory are independent of the total I / O size.
[0106] In one embodiment, as Figure 6 shown, step 205, i.e., "obtain the standard time consumption of the previous I / O processing on each physical link, and combine the corresponding I / O processing capacity values to obtain the path weight values of each physical link", is described in detail.
[0107] Step 2051: Obtain the time weight values of the previous I / O processing on each physical link.
[0108] Here, since the standard time consumption of the previous I / O processing on each physical link is the standard time consumption converted according to the I / O type and the preset I / O size weight value, it is necessary to first obtain the I / O type of the previous I / O processing on each physical link. Among them, the I / O type includes the read I / O type and the write I / O type. At the same time, it is necessary to obtain the time consumption of the previous I / O processing on each physical link; among them, the I / O processing time consumption includes the read I / O processing time consumption represented by last_read_io_process_time and the write I / O processing time consumption represented by last_write_io_process_time.
[0109] When the I / O type is the read I / O type, the time consumption of the previous read I / O processing on each physical link is respectively multiplied by the preset write I / O size weight value of the memory hard disk to obtain the time weight value of the previous I / O processing on each physical link, denoted as weight_time. The specific expression of the time weight value of the previous I / O processing on one of the physical links is as follows:
[0110] weight_time = last_read_io_process_time * weight_write_sector
[0111] When the I / O type is the write I / O type, the time consumption of the previous write I / O processing on each physical link is respectively multiplied by the preset read I / O size weight value of the memory hard disk to obtain the time weight value of the previous I / O processing on each physical link, still denoted as weight_time. The specific expression of the time weight value of the previous I / O processing on one of the physical links is as follows:
[0112] weight_time = last_write_io_process_time * weight_read_sector
[0113] Step 2053: Add the preset read I / O size weight value and the preset write I / O size weight value of the memory hard disk to perform an addition operation to obtain the sum of the preset I / O size weight values, denoted as weight_sector_and. The specific expression is as follows:
[0114] weight_sector_and = weight_read_sector + weight_write_sector
[0115] Step 2055: Perform a ratio operation on the time weight value of the last I / O process on each physical link and the sum of the preset I / O size weight values to obtain the standard elapsed time of the last I / O process on each physical link.
[0116] In an implementable manner, when the I / O type is the read I / O type, the standard elapsed time of the last I / O process on one of the physical links is denoted as last_io_process_standard_time. The overall expression is as follows:
[0117] last_io_process_standard_time = weight_time ÷ weight_sector_and
[0118] = (last_read_io_process_time * weight_write_sector) ÷ (weight_read_sector + weight_write_sector)
[0119] In another implementable manner, when the I / O type is the write I / O type, the standard elapsed time of the last I / O process on one of the physical links is denoted as last_io_process_standard_time. The overall expression is as follows:
[0120] last_io_process_standard_time = weight_time ÷ weight_sector_and
[0121] = (last_write_io_process_time * weight_read_sector) ÷ (weight_read_sector + weight_write_sector)
[0122] Step 2057, perform a multiplication operation on the to-be-processed I / O capability value of each physical link and the standard time taken for the corresponding previous I / O processing to obtain the path weight value of each physical link. That is, when the host performs read / write I / O operations on the memory hard disk, the storage multipath routing system calculates the path weight value of each physical link based on the to-be-processed I / O capability value of each physical link and in combination with the standard time taken for the previous I / O processing on each physical link. The overall expression for the path weight value of one physical link is as follows:
[0123] path_weight = And * last_io_process_standard_time
[0124] = (io + sector) * last_io_process_standard_time
[0125] = (read_io + write_io + read_sector + write_sector) * last_io_process_standard_time
[0126] = (active_read_io * weight_read_io + active_write_io * weight_write_io +
[0127] active_read_sector * weight_read_sector + active_write_sector * weight_write_sector) * last_io_process_standard_time
[0128] Among them, path_weight is the path weight value of the current physical link. The larger the weight, the greater the processing time required. The smaller the weight, the better the path and the faster the processing speed of the to-be-processed I / O.
[0129] The above method comprehensively considers the real-time processing capabilities of each physical link for current I / O processing, the size and quantity of the current unprocessed I / O of each physical link, and at the same time takes into account the differences in the read / write I / O processing capabilities of the memory, realizes the calculation of the path weight value of each physical link, makes the calculation result more comprehensive and accurate, and further improves the processing efficiency of the to-be-processed I / O.
[0130] In one embodiment, the method further includes: during the process of sending the current to-be-processed I / O of the host to the memory for processing through the optimal path and after the memory finishes processing, real-time update the current unprocessed I / O information value of the optimal path.
[0131] In an implementable manner, during the process of sending the currently to-be-processed I / O of the host to the memory for processing through the optimal path, according to the type and size of the to-be-processed I / O, the value of the currently to-be-processed I / O information is counted into the statistical information of active_read_io or active_write_io, active_read_sector or active_write_sector of the currently selected optimal path, that is, the total size value of the unprocessed I / O of the current optimal path is added with the total size value of this I / O, and the number value of the unprocessed I / O of the optimal path is incremented by 1.
[0132] In an implementable manner, after the currently to-be-processed I / O of the host is sent to the memory for processing through the optimal path and completed, according to the type and size of the to-be-processed I / O, the value of the currently to-be-processed I / O information is deleted from the statistical information of active_read_io or active_write_io, active_read_sector or active_write_sector of the selected optimal path, that is, the total size value of the unprocessed I / O of the current optimal path is subtracted by the size value of this I / O, and the number value of the unprocessed I / O of the optimal path is decremented by 1; meanwhile, the standard time consumption for processing the current I / O is counted into the statistical information of this optimal path. The standard time consumption for processing the current I / O can represent the I / O processing efficiency on this path, and can reflect the comprehensive result of the differences in physical link, network, and storage processing capabilities on this path.
[0133] Through the above operations, since the statistical information of each physical link is updated every time 1 I / O is processed, the real-time standard time consumption for processing each I / O on the path will be updated, so that the path weight values finally obtained by each physical link are dynamically and real-time refreshed, further ensuring the real-time dynamic balance of I / O load and processing capabilities.
[0134] It should be understood that although Figures 2 - 6 the steps in the flowchart of Figures 2 - 6 are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this application, the execution of these steps has no strict order restriction, and these steps can be executed in other orders. Moreover,
[0135] The above method embodiments can be applied to a variety of application scenarios, for example, including but not limited to the following application scenarios:
[0136] In an application scenario where there are multiple physical links between the host and the memory, by comprehensively considering various factors such as the real-time I / O processing time-consuming that affects the I / O processing efficiency on the physical link, the total size value and quantity value of the outstanding I / Os, and the difference in the expected processing capabilities of the memory for read and write I / Os, the path weight values of each physical link are calculated dynamically in real time, and one optimal path is selected for the current read or write I / O of the host. This optimal path is selected on the premise of comprehensively considering the current path I / O processing speed and the current path load, and it is expected that the I / O to be processed will be sent to the memory through this path and can be received and processed by the memory fastest.
[0137] Figure 7 FIG. is a schematic structural diagram of a storage multi-path routing device provided by an embodiment of the present application. This device can be set in Figure 1 the system shown, and is used to execute the method flow as shown in Figures 2 - 6 shown. As shown in Figure 7 shown, this device may include: an acquisition module 701, a first calculation module 703, a second calculation module 705, a comparison and routing module 707, and a storage sending module 709. The main functions of each component module are as follows:
[0138] The acquisition module 701 is used to acquire the preset I / O weight value of the memory hard disk and the current unprocessed I / O information value of each physical link;
[0139] The first calculation module 703 is used to obtain the to-be-processed I / O capability value of each physical link based on the acquired preset I / O weight value and the current unprocessed I / O information value of each physical link;
[0140] The second calculation module 705 is used to obtain the standard time-consuming of the previous I / O processing on each physical link, and combine the corresponding to-be-processed I / O capability value to obtain the path weight value of each physical link;
[0141] The comparison and routing module 707 is used to compare the path weight values of each physical link, and select the physical link with the smallest path weight value as the optimal path;
[0142] The storage sending module 709 is used to send the I / O currently to be processed by the host to the memory for processing through the optimal path.
[0143] In some embodiments, the preset I / O weight value includes a preset I / O quantity weight value and a preset I / O size weight value; the current unprocessed I / O information value includes the current unprocessed I / O quantity value and the current unprocessed I / O total size value. The first calculation module 703 is further used for:
[0144] Based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link;
[0145] Based on the preset I / O size weight value and the current total unprocessed I / O size value of each physical link, obtain the to-be-processed total I / O size capacity value of each physical link;
[0146] Perform an addition operation on the to-be-processed I / O quantity capacity value and the corresponding to-be-processed total I / O size capacity value of each physical link to obtain the to-be-processed I / O capacity value of each physical link.
[0147] In some embodiments, the preset I / O quantity weight value includes a preset read I / O quantity weight value and a preset write I / O quantity weight value; the current unprocessed I / O quantity value includes the current unprocessed read I / O quantity value and the current unprocessed write I / O quantity value; the first calculation module 703 is further configured to:
[0148] Perform a multiplication operation on the preset read I / O quantity weight value and the current unprocessed read I / O quantity value of each physical link respectively to obtain the to-be-processed read I / O quantity capacity value of each physical link;
[0149] Perform a multiplication operation on the preset write I / O quantity weight value and the current unprocessed write I / O quantity value of each physical link respectively to obtain the to-be-processed write I / O quantity capacity value of each physical link;
[0150] Perform an addition operation on the to-be-processed read I / O quantity capacity value and the corresponding to-be-processed write I / O quantity capacity value of each physical link to obtain the to-be-processed I / O quantity capacity value of each physical link.
[0151] In some embodiments, the preset I / O size weight value includes a preset read I / O size weight value and a preset write I / O size weight value; the current total unprocessed I / O size value includes the current total unprocessed read I / O size value and the current total unprocessed write I / O size value; the first calculation module 703 is further configured to:
[0152] Perform a multiplication operation on the preset read I / O size weight value and the current total unprocessed read I / O size value of each physical link respectively to obtain the to-be-processed read I / O size capacity value of each physical link;
[0153] Perform a multiplication operation on the preset write I / O size weight value and the current total unprocessed write I / O size value of each physical link respectively to obtain the to-be-processed write I / O size capacity value of each physical link;
[0154] Sum the to-be-processed read I / O size capability values and the corresponding to-be-processed write I / O size capability values of each physical link to obtain the to-be-processed I / O size capability value of each physical link.
[0155] In some embodiments, the second calculation module 705 is further configured to:
[0156] Obtain the time weight values of the last I / O processing on each physical link;
[0157] Sum the preset read I / O size weight value and the preset write I / O size weight value of the memory hard disk to obtain the sum of the preset I / O size weight values;
[0158] Perform a ratio operation on the time weight values of the last I / O processing on each physical link and the sum of the preset I / O size weight values respectively to obtain the standard time consumption of the last I / O processing on each physical link;
[0159] Perform a product operation on the to-be-processed I / O capability value of each physical link and the standard time consumption of the corresponding last I / O processing to obtain the path weight value of each physical link.
[0160] In some embodiments, the second calculation module 705 is further configured to:
[0161] Obtain the I / O type of the last I / O processing on each physical link; wherein, the I / O type includes read I / O type and write I / O type;
[0162] Obtain the time consumption of the last I / O processing on each physical link; wherein, the I / O processing time consumption includes read I / O processing time consumption and write I / O processing time consumption;
[0163] When the I / O type is read I / O type, perform a product operation on the time consumption of the last read I / O processing on each physical link and the preset write I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link;
[0164] When the I / O type is write I / O type, perform a product operation on the time consumption of the last write I / O processing on each physical link and the preset read I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link.
[0165] In some embodiments, the device is further configured to:
[0166] During the process of sending the currently to-be-processed I / O of the host to the memory for processing through the optimal path and after the memory processing is completed, the current unprocessed I / O information value of the optimal path is updated in real time.
[0167] For the same or similar parts among the above-described embodiments, reference may be made to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, they are described relatively simply, and for the relevant parts, reference may be made to the description of the method embodiments.
[0168] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data may be used in the solutions described herein within the scope permitted by applicable laws and regulations of the country where it is located (such as when the user clearly consents, is effectively notified, and clearly authorizes the user, etc.).
[0169] According to the embodiments of the present application, the present application also provides a computer device and a computer-readable storage medium.
[0170] As Figure 8 shown, it is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. Among them, the digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0171] As Figure 8 shown, the device 800 includes a computing unit 801, a ROM 802, a RAM 803, a bus 804, and an input / output (I / O) interface 805. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through the bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0172] The computing unit 801 can execute various processes in the method embodiments of the present application according to the computer instructions stored in the read-only memory (ROM) 802 or the computer instructions loaded from the storage unit 808 into the random access memory (RAM) 803. The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. The computing unit 801 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. In some embodiments, the method provided by the embodiments of the present application can be implemented as a computer software program, which is tangibly included in a computer-readable storage medium, such as the storage unit 808.
[0173] The RAM 803 can also store various programs and data required for the operation of the device 800. Part or all of the computer programs can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809.
[0174] The input unit 806, output unit 807, storage unit 808, and communication unit 809 in the device 800 can be connected to the I / O interface 805. Among them, the input unit 806 can be, for example, a keyboard, mouse, touch screen, microphone, etc.; the output unit 807 can be, for example, a display, speaker, indicator light, etc. The device 800 can exchange information, data, etc. with other devices through the communication unit 809.
[0175] It should be noted that the device may also include other components necessary for normal operation. It may also only include the components necessary to implement the solution of this application, and does not necessarily include all the components shown in the figure.
[0176] The various embodiments of the systems and technologies described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0177] The computer instructions for implementing the methods of this application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 801, such that when the computer instructions are executed by a computing unit 801 such as a processor, the steps involved in the method embodiments of this application are executed.
[0178] The computer-readable storage medium provided by this application can be a tangible medium that can contain or store computer instructions for executing the steps involved in the method embodiments of this application. The computer-readable storage medium can include, but is not limited to, storage media in the forms of electronic, magnetic, optical, electromagnetic, etc.
[0179] The above specific embodiments do not constitute a limitation on the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A storage multi-path routing method, characterized in that Applied to a system including a host and a memory, with multiple physical links provided between the host and the memory, the method includes: Obtain the preset I / O quantity weight value and preset I / O size weight value of the memory hard disk, as well as the current unprocessed I / O quantity value and current unprocessed I / O total size value of each physical link. The preset I / O size weight value includes a preset read I / O size weight value and a preset write I / O size weight value; Based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O quantity capacity value of each physical link; Based on the preset I / O size weight value and the current unprocessed I / O total size value of each physical link, obtain the to-be-processed I / O total size capacity value of each physical link; Perform an addition operation on the to-be-processed I / O quantity capacity value and the to-be-processed I / O total size capacity value of each physical link to obtain the to-be-processed I / O capacity value of each physical link; Obtain the time weight value of the previous I / O processing on each physical link; Perform an addition operation on the preset read I / O size weight value and the preset write I / O size weight value to obtain the sum of the preset I / O size weight values; Perform a ratio operation on the time weight value of the previous I / O processing on each physical link and the sum of the preset I / O size weight values to obtain the standard time consumption of the previous I / O processing on each physical link; Perform a multiplication operation on the to-be-processed I / O capacity value of each physical link and the standard time consumption of the previous I / O processing to obtain the path weight value of each physical link; Compare the path weight values of each physical link, and select the physical link with the smallest path weight value as the optimal path; Send the I / O currently to be processed by the host to the memory for processing through the optimal path.
2. The method according to claim 1, characterized in that, The preset I / O quantity weight value includes a preset read I / O quantity weight value and a preset write I / O quantity weight value; the current unprocessed I / O quantity value includes the current unprocessed read I / O quantity value and the current unprocessed write I / O quantity value; the obtaining of the to-be-processed I / O quantity capacity value of each physical link based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link includes: Perform a multiplication operation on the preset read I / O quantity weight value and the current unprocessed read I / O quantity value of each physical link respectively to obtain the to-be-processed read I / O quantity capacity value of each physical link; Perform a multiplication operation on the preset write I / O quantity weight value and the current unprocessed write I / O quantity value of each physical link respectively to obtain the to-be-processed write I / O quantity capacity value of each physical link; Perform an addition operation on the to-be-processed read I / O quantity capacity value and the corresponding to-be-processed write I / O quantity capacity value of each physical link to obtain the to-be-processed I / O quantity capacity value of each physical link.
3. The method according to claim 1, wherein The current unprocessed I / O total size value includes the current unprocessed read I / O total size value and the current unprocessed write I / O total size value; obtaining the to-be-processed I / O total size capability value of each physical link based on the preset I / O size weight value and the current unprocessed I / O total size value of each physical link includes: Performing a multiplication operation on the preset read I / O size weight value and the current unprocessed read I / O total size value of each physical link respectively to obtain the to-be-processed read I / O size capability value of each physical link; Performing a multiplication operation on the preset write I / O size weight value and the current unprocessed write I / O total size value of each physical link respectively to obtain the to-be-processed write I / O size capability value of each physical link; Performing an addition operation on the to-be-processed read I / O size capability value and the corresponding to-be-processed write I / O size capability value of each physical link to obtain the to-be-processed I / O size capability value of each physical link.
4. The method according to claim 1, wherein Obtaining the time weight value of the last I / O processing on each physical link includes: Obtaining the I / O type of the last I / O processing on each physical link; wherein, the I / O type includes the read I / O type and the write I / O type; Obtaining the time taken for the last I / O processing on each physical link; wherein, the time taken for I / O processing includes the time taken for read I / O processing and the time taken for write I / O processing; When the I / O type is the read I / O type, performing a multiplication operation on the time taken for the last read I / O processing on each physical link and the preset write I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link; When the I / O type is the write I / O type, performing a multiplication operation on the time taken for the last write I / O processing on each physical link and the preset read I / O size weight value of the memory hard disk respectively to obtain the time weight value of the last I / O processing on each physical link.
5. The method according to claim 1, characterized in that, The method further includes: During the process of sending the currently to-be-processed I / O of the host to the memory for processing through the optimal path and after the memory finishes processing, the current unprocessed I / O information value of the optimal path is updated in real time.
6. A storage multi-path routing device, characterized in that Applied to a system including a host and a memory, multiple physical links are set between the host and the memory, this device is set in this system, and this device includes: An obtaining module, configured to obtain the preset I / O quantity weight value and the preset I / O size weight value of the memory hard disk and the current unprocessed I / O quantity value and the current unprocessed I / O total size value of each physical link, and the preset I / O size weight value includes the preset read I / O size weight value and the preset write I / O size weight value; A first calculation module, configured to obtain the to-be-processed I / O quantity capacity value of each physical link based on the preset I / O quantity weight value and the current unprocessed I / O quantity value of each physical link, obtain the to-be-processed I / O total size capacity value of each physical link based on the preset I / O size weight value and the current unprocessed I / O total size value of each physical link, and perform an addition operation on the to-be-processed I / O quantity capacity value and the to-be-processed I / O total size capacity value of each physical link to obtain the to-be-processed I / O capacity value of each physical link; A second calculation module, configured to obtain the time weight value of the previous I / O processing on each physical link, perform an addition operation on the preset read I / O size weight value and the preset write I / O size weight value to obtain the sum of the preset I / O size weight values, perform a ratio operation on the time weight value of the previous I / O processing on each physical link and the sum of the preset I / O size weight values to obtain the standard time consumption of the previous I / O processing on each physical link, and perform a multiplication operation on the to-be-processed I / O capacity value and the standard time consumption of the previous I / O processing on each physical link to obtain the path weight value of each physical link; A comparison and routing selection module, configured to compare the path weight values of the physical links and select the physical link with the smallest path weight value as the optimal path; A storage sending module, configured to send the I / O currently to be processed by the host to the memory for processing through the optimal path.
7. A computer device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions executable by the at least one processor, and the computer instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having computer instructions stored thereon, characterized in that, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
HBA compatibility processing method, device and system
CN103577149A
AOMDV-based energy aware node-disjoint multipath routing algorithm
CN106686659A