A method, apparatus, and medium for dynamically predicting the optimal path.

By generating IO information and the correspondence between optimal path devices in real time, the problem of lag in multi-path software path selection is solved, enabling rapid determination of the optimal path and improving IO processing efficiency.

CN115373843BActive Publication Date: 2026-05-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2022-08-19
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing multipath software suffers from lag in path selection, failing to pre-calculate the optimal path at each I/O location, resulting in low path selection efficiency.

Method used

By performing real-time statistical analysis on each multipath device, the system generates a correspondence between IO information and the optimal path device, and quickly determines the target optimal path device when an IO task is generated.

Benefits of technology

It saves path selection time, reduces IO latency, and significantly improves IO processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373843B_ABST
    Figure CN115373843B_ABST
Patent Text Reader

Abstract

This invention relates to the field of data access technology, and more particularly to a method, apparatus, and medium for dynamically predicting the optimal path device. The method includes: performing real-time statistical analysis on each multipath device to generate a correspondence between IO information and the optimal path device for each multipath device; in response to a host generating an IO task to be processed for a certain multipath device, acquiring the IO information of the IO task to be processed; matching the IO information with the IO information and the correspondence between the IO information and the optimal path device for a certain multipath device to determine the target optimal path device; and having the host send the IO task to be processed to the storage end through the target optimal path device. The solution of this invention generates the correspondence between IO information and the optimal path device through real-time statistical analysis of multipath devices. Only IO information is needed to match the target optimal path device, saving path selection time, reducing IO latency, and improving IO processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data access technology, and in particular to a method, apparatus, and medium for dynamically predicting the optimal path. Background Technology

[0002] Multipathing refers to multiple physical transport layer connections between a server and storage devices, providing higher availability and performance advantages for network storage systems. Multipathing software, installed on the server side, aggregates multiple devices on the same volume into a single device. The high availability of multipathing software is reflected in the fact that if any path between the server and storage device fails, IO requests can be sent through other paths, avoiding data access interruptions between the server and storage device due to single points of failure. The high throughput performance advantage of multipathing software is reflected in the fact that IO requests from the server to the storage device can be sent concurrently through multiple paths, improving the IO throughput of server data access.

[0003] like Figure 1 and Figure 2 As shown, the current path selection strategy of multipath software is roughly as follows: If the starting position of an IO is 20M and its size is 512KB, then according to the segment division, this IO belongs to L1, and the mirror relationship corresponding to L1 is Domain1. The master node of Domain1 is Node1, and the path devices connecting Node1 to the server (host) are sdb and sdc. The optimal path device is obtained by using a path selection algorithm on sdb and sdc, and this IO is then sent to the storage through that device. The above path selection process is performed when the IO occurs, which has a certain lag and fails to calculate the optimal path at each IO location in advance, resulting in low path selection efficiency. Therefore, further improvement is needed. Summary of the Invention

[0004] In view of this, it is necessary to provide a method, apparatus, and medium for dynamically predicting the optimal path in order to address the above technical problems.

[0005] According to a first aspect of the present invention, a method for dynamically predicting the optimal path device is provided, the method comprising:

[0006] Real-time statistical analysis of information for each multipath device is performed to generate IO information and optimal path device correspondence for each multipath device;

[0007] In response to the host generating an I / O task to be processed for a certain multipath device, the I / O information of the I / O task to be processed is obtained;

[0008] The IO information is matched with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device;

[0009] The host sends the I / O task to be processed to the storage end through the target optimal path device.

[0010] In some embodiments, the real-time statistical analysis of information for each multipath device to generate IO information and optimal path device correspondence for each multipath device includes:

[0011] Perform the following operations for each multipath device:

[0012] Obtain all nodes included in the multi-path device, the location range corresponding to each node, and the number of path devices included in each node;

[0013] The target path information is matched with the target path algorithm based on the preset path selection algorithm and the path information correspondence. The preset path selection algorithm and path information correspondence includes: the path device name and path device sorting corresponding to the round robin algorithm; the path device name and the number of unprocessed IOs of the path device corresponding to the queue length algorithm; and the path device name, the number of unprocessed IOs of the path device and the path device throughput corresponding to the service time algorithm.

[0014] Based on the target path information, I / O information and the correspondence between the optimal path device are generated for each node, wherein the optimal path device is selected from a number of path devices included in the node according to the target path information.

[0015] In some embodiments, the step of matching the target path information corresponding to the target path algorithm based on the preset path selection algorithm and the path information correspondence includes:

[0016] If the target path algorithm is the round robin algorithm, then the target path information includes the path device name and the path device order.

[0017] If the target path algorithm is the queue length algorithm, then the target path information includes the path device name and the number of unprocessed I / Os on the path device.

[0018] If the target path algorithm is the service time algorithm, then the target path information includes the path device name, the number of unprocessed I / Os on the path device, and the path device throughput.

[0019] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information includes:

[0020] In response to the target path information being the path device name and the path device sorting, the path device at the front of all path devices included in each node is selected as the optimal path device.

[0021] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0022] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information further includes:

[0023] In response to the target path information being the path device name and the number of unprocessed IOs of the path device, the path device with the fewest unprocessed IOs among all the path devices included in each node is selected as the optimal path device;

[0024] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0025] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information further includes:

[0026] In response to the target path information being the path device name, the number of unprocessed I / Os on the path device, and the path device throughput, the optimal path device is selected from all path devices included in each node based on the following rules:

[0027] If the number of unprocessed I / Os is the same for all path devices, then the path device with the highest throughput is selected as the optimal path device.

[0028] If the throughput of each path device is the same, the path device with the smallest number of unprocessed IOs is selected as the optimal path device.

[0029] Since the number of unprocessed IOs and the throughput of each path device are different, the path device with the smallest ratio of the sum of the number of unprocessed IOs and the IO size to the path device throughput is selected as the optimal path device, and the range of IO size corresponding to the optimal path device is calculated.

[0030] Summarize the location range corresponding to each node, and generate the correspondence between the path device name and IO size range for the selected optimal path, as well as the IO location range, IO size range and optimal path device.

[0031] In some embodiments, matching the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device includes:

[0032] In response to the target path algorithm being either the round robin algorithm or the queue length algorithm, the IO information is the IO position, and the optimal path device corresponding to the IO range that matches the IO position of the IO task to be processed is taken as the target optimal path device.

[0033] If the target path algorithm is the service time algorithm, then the IO information is the IO location and IO size. The optimal path device corresponding to the range of IO location and IO size that matches the IO location and IO size of the IO task to be processed is taken as the target optimal path device.

[0034] According to a second aspect of the present invention, an apparatus for dynamically predicting the optimal path is provided, the apparatus comprising:

[0035] The statistical analysis module is configured to perform real-time statistical analysis on each multipath device to generate IO information and the optimal path device correspondence for each multipath device.

[0036] The acquisition module is configured to acquire the IO information of the pending IO task in response to the host generating a pending IO task for a certain multipath device.

[0037] A matching module is configured to match the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device.

[0038] The distribution module is configured to distribute the I / O task to be processed from the host to the storage end through the target optimal path device.

[0039] According to a third aspect of the present invention, a computer is also provided, the computer comprising:

[0040] At least one processor; and

[0041] The memory stores a computer program that can run on a processor, and when the processor executes the program, it performs the aforementioned method for dynamically predicting the optimal path device.

[0042] According to a fourth aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, performs the aforementioned method for dynamically predicting the optimal path device.

[0043] The above-mentioned method for dynamically predicting the optimal path device generates a correspondence between IO information and the optimal path device by performing real-time statistical analysis on each multi-path device. When the host generates an IO task, the IO information is matched with the correspondence between the IO information and the optimal path device to quickly determine the target optimal path device, saving path selection time, reducing IO latency, and significantly improving IO processing efficiency.

[0044] In addition, the present invention also provides a device for dynamically predicting the optimal path, a computer, and a computer-readable storage medium, which can achieve the above-mentioned technical effects, and will not be described in detail here. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0046] Figure 1 A diagram illustrating the networking of existing servers and storage clusters;

[0047] Figure 2 A schematic diagram of a circular mirror pair formed by an existing host and storage;

[0048] Figure 3 A flowchart of a method for dynamically predicting the optimal path device is provided as an embodiment of the present invention;

[0049] Figure 4A To discover the command intent of the target on the storage;

[0050] Figure 4B A diagram illustrating the command code for logging into the target;

[0051] Figure 4C A diagram showing the command codes for viewing established links;

[0052] Figure 5 A schematic diagram of a device for dynamically predicting the optimal path is provided in another embodiment of the present invention;

[0053] Figure 6 This is a diagram of the internal structure of a computer in another embodiment of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0055] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.

[0056] To facilitate understanding of the present invention, the connection between existing servers and storage is first established, and technical terms such as multipath software, path device selection strategy, circular mirror pair, path device, and multipath device are explained.

[0057] DM-multipath: A multipath software solution for the Linux platform based on Device Mapper technology.

[0058] Path selector: The path device selection strategy for multipath software.

[0059] sdX: Path device. After a volume is mapped to a host, each link maps the volume to a path device.

[0060] dm-X: Multipath device. DM-multipath aggregates multiple path devices into a single multipath device.

[0061] The main functions of multipath software include failover, fault recovery, and load balancing:

[0062] Failover can handle multiple path failures, including HBA failures, link failures, and storage controller failures.

[0063] For fault recovery, in systems that support hot-swapping, a disconnection between the server and storage will cause the SCSI device to be deleted. When the link is restored, the SCSI device will be recreated. In this scenario, path recovery can be detected immediately. For systems that do not support hot-swapping (lower versions of Linux), path recovery can be detected through periodic probing.

[0064] Load balancing is one of the most important features of multipath software besides failover. Through load balancing technology, multipath software can fully utilize the bandwidth of multiple links, improving the overall throughput of the system. The path range for load balancing is the pathgroup.

[0065] Path device selection strategy: If there are 4 links between the server and storage, each volume on the storage will be mapped to the server, resulting in 4 devices on the server, typically named sdX (e.g., / dev / sdb). Multipathing software will aggregate these 4 devices into a single multipath device, typically named dm-X (e.g., / dev / dm-0). The path device selection strategy of multipathing software refers to how the software selects a device from the multiple sdX devices when an application on the server performs I / O operations on the multipath device dm-X, and then issues the I / O. The selection strategies for multipathing software on Windows and Linux platforms are largely the same, with three main strategies: round-robin, queue-length, and service-time. Round-robin: Prioritizes sending I / O to all available path devices within the optimal path group. If no path device is available within the optimal path group, it then sends I / O to available path devices outside the optimal path group. Leastqueue depth: Prioritizes sending I / O to the path device in the optimal path group with the fewest pending I / O requests. service-tim: Sends I / O to the path with the shortest service time.

[0066] Circular mirror pair: Reference Figure 2 As shown, each volume on the storage is divided into four L's with a segment granularity (32M): L1: {[0,32M),[128M,160M),…}, L2: {[32M,64M),[160M,192M),…}, L3: {[64M,96M),[192M,224M),…}, L4: {[96M,128M),[224M,256M),…}. The four controllers in one IO Group are divided into four mirror relationships: Domain1: (Node1,Node2); Domain2: (Node2,Node3); Domain3: (Node3,Node4); Domain4: (Node4,Node1). When IO occurs, a path group is selected based on the IO's location, and then a path selection strategy is used within this path group to obtain the optimal path. For example: If the starting position of the IO is 20M and the size is 512KB, then according to the segment division, this IO belongs to L1, and the mirror relationship corresponding to L1 is Domain1.

[0067] In one embodiment, please refer to Figure 3 As shown, the present invention provides a method 100 for dynamically predicting the optimal path device. Specifically, the method includes the following steps:

[0068] Step 101: Perform real-time statistical analysis on information for each multipath device to generate IO information and optimal path device correspondence for each multipath device;

[0069] Step 102: In response to the host generating an I / O task to be processed for a certain multipath device, the I / O information of the I / O task to be processed is obtained.

[0070] Step 103: Match the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device;

[0071] Step 104: The host sends the IO task to be processed to the storage end through the target optimal path device.

[0072] The above-mentioned method for dynamically predicting the optimal path device generates a correspondence between IO information and the optimal path device by performing real-time statistical analysis on each multi-path device. When the host generates an IO task, the IO information is matched with the correspondence between the IO information and the optimal path device to quickly determine the target optimal path device, saving path selection time, reducing IO latency, and significantly improving IO processing efficiency.

[0073] In some embodiments, step 101 above, which involves real-time statistical analysis of information for each multipath device to generate IO information and optimal path device correspondence for each multipath device, includes:

[0074] Perform the following operations for each multipath device:

[0075] Obtain all nodes included in the multi-path device, the location range corresponding to each node, and the number of path devices included in each node;

[0076] The target path information is matched with the target path algorithm based on the preset path selection algorithm and the path information correspondence. The preset path selection algorithm and path information correspondence includes: the path device name and path device sorting corresponding to the round robin algorithm; the path device name and the number of unprocessed IOs of the path device corresponding to the queue length algorithm; and the path device name, the number of unprocessed IOs of the path device and the path device throughput corresponding to the service time algorithm.

[0077] Based on the target path information, I / O information and the correspondence between the optimal path device are generated for each node, wherein the optimal path device is selected from a number of path devices included in the node according to the target path information.

[0078] In some embodiments, the step of matching the target path information corresponding to the target path algorithm based on the preset path selection algorithm and the path information correspondence includes:

[0079] If the target path algorithm is the round robin algorithm, then the target path information includes the path device name and the path device order.

[0080] If the target path algorithm is the queue length algorithm, then the target path information includes the path device name and the number of unprocessed I / Os on the path device.

[0081] If the target path algorithm is the service time algorithm, then the target path information includes the path device name, the number of unprocessed I / Os on the path device, and the path device throughput.

[0082] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information includes:

[0083] In response to the target path information being the path device name and the path device sorting, the path device at the front of all path devices included in each node is selected as the optimal path device.

[0084] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0085] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information further includes:

[0086] In response to the target path information being the path device name and the number of unprocessed IOs of the path device, the path device with the fewest unprocessed IOs among all the path devices included in each node is selected as the optimal path device;

[0087] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0088] In some embodiments, generating IO information and the optimal path device correspondence for each node based on the target path information further includes:

[0089] In response to the target path information being the path device name, the number of unprocessed I / Os on the path device, and the path device throughput, the optimal path device is selected from all path devices included in each node based on the following rules:

[0090] If the number of unprocessed I / Os is the same for all path devices, then the path device with the highest throughput is selected as the optimal path device.

[0091] If the throughput of each path device is the same, the path device with the smallest number of unprocessed IOs is selected as the optimal path device.

[0092] Since the number of unprocessed IOs and the throughput of each path device are different, the path device with the smallest ratio of the sum of the number of unprocessed IOs and the IO size to the path device throughput is selected as the optimal path device, and the range of IO size corresponding to the optimal path device is calculated.

[0093] Summarize the location range corresponding to each node, and generate the correspondence between the path device name and IO size range for the selected optimal path, as well as the IO location range, IO size range and optimal path device.

[0094] In some embodiments, step 103 above, matching the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device, includes:

[0095] In response to the target path algorithm being either the round robin algorithm or the queue length algorithm, the IO information is the IO position, and the optimal path device corresponding to the IO range that matches the IO position of the IO task to be processed is taken as the target optimal path device.

[0096] If the target path algorithm is the service time algorithm, then the IO information is the IO location and IO size. The optimal path device corresponding to the range of IO location and IO size that matches the IO location and IO size of the IO task to be processed is taken as the target optimal path device.

[0097] In another embodiment, to facilitate understanding of the present invention, the principle of this solution is to dynamically calculate the optimal path for each path selection algorithm in real time when I / O occurs at different locations and sizes. This allows the optimal path to be given directly when I / O arrives, without requiring extensive judgment. This embodiment provides another method for dynamically predicting the optimal path, specifically including: First, real-time statistics of valid paths, i.e., usable paths, on each node. Second, different results are predicted for different path selection algorithms. For the round-robin algorithm, the optimal path is round-robin, and the predicted result is {IO location: sdX}. For the queue length algorithm, the optimal path is related to the number of uncompleted I / Os, and the predicted result is also {IO location: sdX}. For the service time algorithm, the optimal path is related to throughput and the size of the I / O to be processed; the predicted result is related not only to the I / O location but also to the I / O size. Finally, when I / O occurs, the optimal path is given directly based on the prediction result of the previous step, and the optimal path is counted again to achieve real-time statistics.

[0098] The following is based on Figure 2 The present invention will be explained in detail using the illustrated cyclic mirror pair as an example. The preparatory work before implementing the present invention can be carried out by referring to the following steps:

[0099] Step 1: Map the volume and establish the link.

[0100] Log in to the storage system and create hosts and volumes using commands or the visual interface. Note that "host" here refers to a concept within the storage system, corresponding one-to-one with an actual server. For iSCSI links, the server's IQN information must be entered when creating a host. For FC links, the server's WWPN information must be entered. Here, we assume the link type is iSCSI. Please refer to... Figure 4A As shown, the login server establishes a link with the storage system using the iscsadm command; there are typically multiple links. Please refer to... Figure 4B As shown, log in to the target using `iscsiadm -m node-T${target_iqn}-p${target_ip}--login`. Please refer to... Figure 4C As shown, the established links can be viewed through iscsiadm-m session.

[0101] Step 2: Discover devices and aggregate multipaths.

[0102] Log in to the server and use the scan command to find path devices in the directory / dev / disk / by-path / . If there are four links, then each volume corresponds to four path devices, for example: / dev / sdb, / dev / sdc, / dev / sdd, and / dev / sde. The code for the scan command is as follows:

[0103] echo'---'> / sys / class / scsi_host / ${hostName} / device / scsi_host / ${hostName} / scan

[0104] Log in to the server and start the multipathing software using the command `systemctl start multipathd`. Multipathd will automatically aggregate devices with the same wwid into a single multipath device, for example: ` / dev / dm-0`. The summarized information for path devices and multipath devices is shown in Table 1.

[0105] Table 1 Multipath devices and path devices

[0106]

[0107]

[0108] The method for dynamically predicting the optimal path device can be implemented by following these steps:

[0109] Step 1: Real-time statistics of information on each path device. The path device information to be collected varies for each path selection algorithm.

[0110] Please refer to Table 2. The information required for the round-robin algorithm includes the path devices for each Node and the order of the path devices for each Node. The path devices are arranged using a doubly linked list. The path device at the front of the list will be selected in the next path selection, and once selected, it will be moved to the back of the list.

[0111] Table 2. Statistical information of the Round Robin algorithm

[0112] Node commands Path device sorting Node1 sdb<->sdc Node2 sdd<->sde Node3 sdf<->sdg Node4 sdh<->sdi

[0113] Please refer to Table 3. The information required for the service time algorithm includes the path devices for each Node, the throughput of each path device, and the size of the outstanding I / O on each path device. The selection of the next I / O path will be calculated based on the throughput, the size of the outstanding I / O, and the size of the current I / O, ultimately determining the optimal path.

[0114] Table 3. Queue Length Algorithm Statistics

[0115]

[0116]

[0117] Please refer to Table 4. The information required for the service time algorithm includes the path devices for each Node, the throughput of each path device, and the size of the outstanding I / O on each path device. The selection of the next I / O path will be calculated based on the throughput, the size of the outstanding I / O, and the size of the current I / O, ultimately determining the optimal path.

[0118] Table 4 Service Time Algorithm Statistics

[0119]

[0120] Step two: Predict the optimal path for the round robin based on statistical information.

[0121] For the round-robin algorithm, predictions are made based on Table 2. Of the two path devices for Node1, sdb comes first. Therefore, if the next IO needs to be processed by Node1, sdb will be selected. Similarly, if the IO needs to be processed by Node2, sdd will be selected; if it needs to be processed by Node3, sdf will be selected; and if it needs to be processed by Node4, sdh will be selected. If a new IO occurs at location 124M (because 124 = 3 * 32 + 28), then the IO belongs to L4, which corresponds to Domain4. The master node of Domain4 is Node4, so this IO will be sent to storage via path device sdh.

[0122] Step 3: Predict the optimal path for queue length based on statistical information.

[0123] For the queue length algorithm, predictions are made based on Table 3. For the two path devices of Node 1, sdb has fewer incomplete IOs than sdc, so if the next IO needs to be processed by Node 1, sdb will be selected. Similarly, if the IO needs to be processed by Node 2, sdd will be selected (because 1 < 2); if the IO needs to be processed by Node 3, sdg will be selected (because 6 < 7); and if the IO needs to be processed by Node 4, sdi will be selected (because 2 < 3). If a new IO occurs at location 200M (because 200 = 6 * 32 + 8), then the IO belongs to L3, which corresponds to Domain 3. The master node of Domain 3 is Node 3, so this IO will be sent to storage via path device sdg.

[0124] Step 4: Predict the optimal path for service time based on statistical information.

[0125] For the service time algorithm, predictions are made according to Table 4. Compared to the other two algorithms, this algorithm is more complex in its predictions.

[0126] Consider two path devices, sdb and sdc, under Node1, with throughputs of 1 and 2 respectively, and incomplete IO sizes of 2048KB and 2048KB respectively. Suppose a new IO size is x... Therefore, the former is always greater than the latter, so the IO selects the path device sdc.

[0127] Consider two path devices, sdd and sde, under Node2, with throughputs of 2 and 1 respectively, and incomplete IO sizes of 512KB and 128KB. Suppose a new IO size is x... When x = 256, it can be seen that when x ∈ [0, 256), the latter is less than the former, and the IO selects the path device sde. When x ∈ [256, +∞), the former is less than the latter, and the IO selects the path device sdd.

[0128] Consider two path devices, sdf and sdh, under Node3, with throughputs of 1 and 1 respectively, and incomplete IO sizes of 256KB and 512KB respectively. Suppose a new IO size is x... Therefore, the former is always greater than the latter, so the IO selects the path device sdf.

[0129] Consider two path devices, sdh and sdi, under Node4, with throughputs of 5 and 4 respectively, and incomplete IO sizes of 4096KB and 2048KB. Suppose a new IO size is x... When x = 256, it can be seen that when x ∈ [0, 6144), the latter is less than the former, and the IO selects the path device sdi. When x ∈ [6144, +∞), the former is less than the latter, and the IO selects the path device sdh. If a new IO occurs, the IO location is 200M (because 250 = 7 * 32 + 26), and the size is 5120KB, then the IO belongs to L4, L4 corresponds to Domain4, and the master node of Domain4 is Node4. Since 5120 ∈ [0, 6144), the IO selects the path device sdi and sends it to storage.

[0130] The above-mentioned method for dynamically predicting the optimal path device has at least the following beneficial technical effects: by predicting the optimal path device in real time, it saves path selection time, improves IO efficiency, and reduces IO latency.

[0131] In another embodiment, please refer to Figure 5 As shown, the present invention also provides a device 200 for dynamically predicting the optimal path, the device comprising:

[0132] The statistical analysis module 201 is configured to perform real-time statistical analysis on each multipath device to generate IO information and the optimal path device correspondence for each multipath device.

[0133] The acquisition module 202 is configured to acquire the IO information of the pending IO task in response to the host generating a pending IO task for a certain multipath device.

[0134] Matching module 203 is configured to match the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device;

[0135] The distribution module 204 is configured to distribute the IO task to be processed from the host to the storage end through the target optimal path device.

[0136] The aforementioned device for dynamically predicting the optimal path device generates a correspondence between IO information and the optimal path device by performing real-time statistical analysis on each multi-path device. When the host generates an IO task, it matches the IO information with the correspondence between the IO information and the optimal path device to quickly determine the target optimal path device, saving path selection time, reducing IO latency, and significantly improving IO processing efficiency.

[0137] In some embodiments, the statistical analysis module 201 is further configured to:

[0138] Perform the following operations for each multipath device:

[0139] Obtain all nodes included in the multi-path device, the location range corresponding to each node, and the number of path devices included in each node;

[0140] The target path information is matched with the target path algorithm based on the preset path selection algorithm and the path information correspondence. The preset path selection algorithm and path information correspondence includes: the path device name and path device sorting corresponding to the round robin algorithm; the path device name and the number of unprocessed IOs of the path device corresponding to the queue length algorithm; and the path device name, the number of unprocessed IOs of the path device and the path device throughput corresponding to the service time algorithm.

[0141] Based on the target path information, I / O information and the correspondence between the optimal path device are generated for each node, wherein the optimal path device is selected from a number of path devices included in the node according to the target path information.

[0142] In some embodiments, the statistical analysis module 201 is further configured to:

[0143] If the target path algorithm is the round robin algorithm, then the target path information includes the path device name and the path device order.

[0144] If the target path algorithm is the queue length algorithm, then the target path information includes the path device name and the number of unprocessed I / Os on the path device.

[0145] If the target path algorithm is the service time algorithm, then the target path information includes the path device name, the number of unprocessed I / Os on the path device, and the path device throughput.

[0146] In some embodiments, the statistical analysis module 201 is further configured to:

[0147] In response to the target path information being the path device name and the path device sorting, the path device at the front of all path devices included in each node is selected as the optimal path device.

[0148] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0149] In some embodiments, the statistical analysis module 201 is further configured to:

[0150] In response to the target path information being the path device name and the number of unprocessed IOs of the path device, the path device with the fewest unprocessed IOs among all the path devices included in each node is selected as the optimal path device;

[0151] Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

[0152] In some embodiments, the statistical analysis module 201 is further configured to:

[0153] In response to the target path information being the path device name, the number of unprocessed I / Os on the path device, and the path device throughput, the optimal path device is selected from all path devices included in each node based on the following rules:

[0154] If the number of unprocessed I / Os is the same for all path devices, then the path device with the highest throughput is selected as the optimal path device.

[0155] If the throughput of each path device is the same, the path device with the smallest number of unprocessed IOs is selected as the optimal path device.

[0156] Since the number of unprocessed IOs and the throughput of each path device are different, the path device with the smallest ratio of the sum of the number of unprocessed IOs and the IO size to the path device throughput is selected as the optimal path device, and the range of IO size corresponding to the optimal path device is calculated.

[0157] Summarize the location range corresponding to each node, and generate the correspondence between the path device name and IO size range for the selected optimal path, as well as the IO location range, IO size range and optimal path device.

[0158] In some embodiments, the matching module 203 is further configured to:

[0159] In response to the target path algorithm being either the round robin algorithm or the queue length algorithm, the IO information is the IO position, and the optimal path device corresponding to the IO range that matches the IO position of the IO task to be processed is taken as the target optimal path device.

[0160] If the target path algorithm is the service time algorithm, then the IO information is the IO location and IO size. The optimal path device corresponding to the range of IO location and IO size that matches the IO location and IO size of the IO task to be processed is taken as the target optimal path device.

[0161] It should be noted that the specific limitations of the device for dynamically predicting the optimal path can be found in the limitations of the method for dynamically predicting the optimal path described above, and will not be repeated here. Each module in the aforementioned device for dynamically predicting the optimal path can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the computer's processor in hardware form, or stored in the computer's memory in software form, so that the processor can call and execute the operations corresponding to each module.

[0162] According to another aspect of the present invention, a computer is provided, which may be a server, and its internal structure diagram is shown below. Figure 6As shown. The computer includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the method for dynamically predicting the optimal path device described above. Specifically, the method includes the following steps:

[0163] Real-time statistical analysis of information for each multipath device is performed to generate IO information and optimal path device correspondence for each multipath device;

[0164] In response to the host generating an I / O task to be processed for a certain multipath device, the I / O information of the I / O task to be processed is obtained;

[0165] The IO information is matched with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device;

[0166] The host sends the I / O task to be processed to the storage end through the target optimal path device.

[0167] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the above-described method for dynamically predicting the optimal path device, specifically including the following steps:

[0168] Real-time statistical analysis of information for each multipath device is performed to generate IO information and optimal path device correspondence for each multipath device;

[0169] In response to the host generating an I / O task to be processed for a certain multipath device, the I / O information of the I / O task to be processed is obtained;

[0170] The IO information is matched with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device;

[0171] The host sends the I / O task to be processed to the storage end through the target optimal path device.

[0172] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0173] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0174] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for dynamically predicting the optimal path device, characterized in that, The method includes: Real-time statistical analysis is performed on each multipath device to generate IO information and optimal path device correspondences for each device. This includes performing the following operations on each multipath device: obtaining all nodes included in the multipath device, the location range corresponding to each node, and several path devices included in each node; matching the target path information corresponding to the target path algorithm based on a preset path selection algorithm and path information correspondences, wherein the preset path selection algorithm and path information correspondences include: path device name and path device sorting for the round robin algorithm, path device name and unprocessed IO count for the queue length algorithm, and service... The time algorithm corresponds to the path device name, the number of unprocessed I / Os on the path device, and the path device throughput. Based on the target path information, it generates I / O information and an optimal path device correspondence for each node. The optimal path device is selected from several path devices included in the node based on the target path information. Generating I / O information and an optimal path device correspondence for each node based on the target path information includes: In response to the target path information being the path device name, the number of unprocessed I / Os on the path device, and the path device throughput, the optimal path device is selected from all path devices included in each node based on the following rules: In response to the number of unprocessed I / Os on each path device being relatively equal... If the throughput of each path device is the same, the path device with the largest throughput is selected as the optimal path device. If the throughput of each path device is the same, the path device with the smallest number of unprocessed I / Os is selected as the optimal path device. If the number of unprocessed I / Os and the throughput of each path device are different, the path device with the smallest ratio of the sum of the number of unprocessed I / Os and the I / O size to the path device throughput is selected as the optimal path device, and the I / O size range corresponding to the optimal path device is calculated. The location range corresponding to each node is summarized, and the path device name and I / O size range corresponding to the selected optimal path are generated to form the correspondence between I / O location range, I / O size range and optimal path device. In response to the host generating an I / O task to be processed for a certain multipath device, the I / O information of the I / O task to be processed is obtained; The IO information is matched with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device; The host sends the I / O task to be processed to the storage end through the target optimal path device.

2. The method for dynamically predicting the optimal path device according to claim 1, characterized in that, The process of matching the target path information to the target path algorithm based on the preset path selection algorithm and the correspondence between path information includes: If the target path algorithm is the round robin algorithm, then the target path information includes the path device name and the path device order. If the target path algorithm is the queue length algorithm, then the target path information includes the path device name and the number of unprocessed I / Os on the path device. If the target path algorithm is the service time algorithm, then the target path information includes the path device name, the number of unprocessed I / Os on the path device, and the path device throughput.

3. The method for dynamically predicting the optimal path device according to claim 1, characterized in that, The step of generating IO information and the optimal path device correspondence for each node based on the target path information includes: In response to the target path information being the path device name and the path device sorting, the path device at the front of all path devices included in each node is selected as the optimal path device. Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

4. The method for dynamically predicting the optimal path device according to claim 1, characterized in that, The process of generating IO information and the optimal path device correspondence for each node based on the target path information also includes: In response to the target path information being the path device name and the number of unprocessed IOs of the path device, the path device with the fewest unprocessed IOs among all the path devices included in each node is selected as the optimal path device; Summarize the location range corresponding to each node, and generate the IO location range and the optimal path device correspondence for the path device name corresponding to the selected optimal path.

5. The method for dynamically predicting the optimal path device according to claim 1, characterized in that, The step of matching the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device includes: In response to the target path algorithm being either the round robin algorithm or the queue length algorithm, the IO information is the IO position, and the optimal path device corresponding to the IO range that matches the IO position of the IO task to be processed is taken as the target optimal path device. If the target path algorithm is the service time algorithm, then the IO information is the IO location and IO size. The optimal path device corresponding to the range of IO location and IO size that matches the IO location and IO size of the IO task to be processed is taken as the target optimal path device.

6. A device for dynamically predicting the optimal path, characterized in that, The device includes: The statistical analysis module is configured to perform real-time statistical analysis on each multipath device to generate IO information and the optimal path device correspondence for each multipath device. The acquisition module is configured to acquire the IO information of the pending IO task in response to the host generating a pending IO task for a certain multipath device. A matching module is configured to match the IO information with the correspondence between the IO information and the optimal path device corresponding to a certain multipath device to determine the target optimal path device. The distribution module is configured to distribute the I / O task to be processed from the host to the storage end through the target optimal path device. The statistical analysis module is also configured to perform the following operations for each multipath device: obtain all nodes included in the multipath device, the location range corresponding to each node, and several path devices included in each node; match the target path information corresponding to the target path algorithm based on a preset path selection algorithm and path information correspondence, wherein the preset path selection algorithm and path information correspondence include: the path device name and path device sorting corresponding to the round robin algorithm, the path device name and the number of unprocessed IOs of the path device corresponding to the queue length algorithm, and the path device name, the number of unprocessed IOs of the path device corresponding to the service time algorithm, and the path device throughput corresponding to the path device name, the number of unprocessed IOs of the path device, and the path device throughput; generate IO information and the optimal path device correspondence for each node based on the target path information, wherein the optimal path device is one selected from several path devices included in the node according to the target path information; in response to the target path information being the path device name, the number of unprocessed IOs of the path device, and the path device throughput, select one as the optimal path device from all path devices included in each node according to the following rules: in response to the fact that the number of unprocessed IOs of the path devices of each path device is the same, select the path device with the largest throughput as the optimal path device. The optimal path device is determined as follows: If the throughput of all path devices is the same, the path device with the smallest number of unprocessed IOs is selected as the optimal path device; if the number of unprocessed IOs and the throughput of all path devices are different, the path device with the smallest ratio of the sum of the number of unprocessed IOs and the IO size to the path device throughput is selected as the optimal path device, and the IO size range corresponding to the optimal path device is calculated; the location range corresponding to each node is summarized, and the path device name and IO size range corresponding to the selected optimal path are generated to form the correspondence between IO location range, IO size range and optimal path device.

7. A computer, characterized in that, include: At least one processor; as well as A memory storing a computer program executable in the processor, wherein the processor, when executing the program, performs the method according to any one of claims 1-5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the method described in any one of claims 1-5.