Path selection method and device

By selecting the path with the smallest performance index within the target block, the problems of low path selection efficiency and low resource utilization in the existing technology are solved, and more efficient path selection and resource utilization are achieved.

CN120434176BActive Publication Date: 2025-09-12INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510942246.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-12
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

The existing technology needs to traverse all available paths when selecting a path, resulting in low resource utilization and poor routing efficiency.

Method used

By obtaining the block address to determine the target block, and traversing and selecting the path with the smallest performance index from the highest priority path set within the target block, the traversal range is narrowed, and the path selection efficiency and resource utilization are improved.

Benefits of technology

It improves the efficiency of path selection and resource utilization, reduces repeated screening operations, and ensures the pertinence and efficiency of path selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120434176B_ABST
    Figure CN120434176B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of path selection technology, and discloses a path selection method and device. The method includes: obtaining a block address, and determining a target block corresponding to the block address from multiple blocks based on the block address; wherein the target block stores multiple path sets; when a first available path exists in a first path set in the target block, traversing the first available paths in the first path set, and determining a first target path with the smallest performance index from the first available paths; wherein the first path set is the path set with the highest priority in the target block, and the performance index indicates the transmission efficiency corresponding to the path; and selecting an input / output path based on the first target path. In response to an input / output request, the block address is obtained and the target block is determined. Since the target block stores multiple path sets, it is sufficient to select the input / output path corresponding to the input / output request from the path set within the target block, thereby improving the efficiency of path selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of path selection, and in particular to a path selection method and device. Background Art

[0002] In related technologies, path selection is performed based on the tpgid within a range of all available paths. The specific process is as follows: when an input / output (IO) request is received, the tpgid associated with the IO request is first identified. Then, all available paths are screened based on the tpgid, a range of paths that meet the tpgid criteria is selected, and finally a path within this range is selected to deliver the IO request.

[0003] However, for each IO request, the path selection range needs to be further narrowed down by tpgid within the range of all available paths. This means that all available paths need to be traversed and matched to determine which paths match the tpgid, resulting in low resource utilization and poor path selection efficiency.

[0004] Therefore, how to improve resource utilization while improving path selection efficiency becomes a technical problem that needs to be solved. Summary of the Invention

[0005] In view of this, the present invention provides a path selection method and device.

[0006] In a first aspect, the present invention provides a path selection method, comprising: obtaining a block address, and determining a target block corresponding to the block address from multiple blocks based on the block address; wherein the target block stores multiple path sets; when a first available path exists in a first path set in the target block, traversing the first available paths in the first path set, and determining a first target path with a minimum performance indicator from the first available paths; wherein the first path set is the path set with the highest priority in the target block, and the performance indicator indicates the transmission efficiency corresponding to the path; and selecting an input and output path based on the first target path.

[0007] In a second aspect, the present invention provides a path selection device, comprising: an acquisition module for acquiring a block address, and determining a target block corresponding to the block address from multiple blocks based on the block address; wherein the target block stores multiple path sets; a traversal determination module for traversing the first available paths in the first path set when a first available path exists in the first path set in the target block, and determining a first target path with the smallest performance indicator from the first available paths; wherein the first path set is the path set with the highest priority in the target block, and the performance indicator indicates the transmission efficiency corresponding to the path; and a first selection module for selecting an input and output path based on the first target path.

[0008] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the path selection method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0009] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the path selection method of the first aspect or any corresponding embodiment thereof.

[0010] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the path selection method of the first aspect or any corresponding embodiment thereof.

[0011] The path selection method provided by an embodiment of the present invention first obtains a block address and determines a target block when responding to an input / output request. Since the target block stores multiple path sets, only the input / output path corresponding to the input / output request is selected from the path sets within the target block, thereby narrowing the traversal range and improving path selection efficiency.

[0012] On the other hand, the first path set with the highest priority in the target block is processed first. When a first available path exists in the first path set, the first target path with the smallest performance indicator is determined from the first available paths. This avoids indiscriminate path screening among all available paths and further improves the path selection efficiency.

[0013] On the other hand, by pre-dividing the blocks and path sets, after determining the target blocks and path sets, the path selection for the target blocks corresponding to the input and output requests is more targeted. Compared with the method of screening paths among all available paths in related technologies, repeated screening operations are reduced and resource utilization is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0015] Figure 1 is a flow chart of a path selection method according to an embodiment of the present invention;

[0016] Figure 2is another flowchart of a path selection method provided by an embodiment of the present invention;

[0017] Figure 3 is another flowchart of a path selection method provided by an embodiment of the present invention;

[0018] Figure 4 is another flowchart of a path selection method provided according to an embodiment of the present invention;

[0019] Figure 5 is another flowchart of the path selection method provided according to an embodiment of the present invention;

[0020] Figure 6 It is a structural diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION

[0021] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0022] According to an embodiment of the present invention, an embodiment of a path selection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0023] In this embodiment, a path selection method is provided, which can be used for computer devices, such as computers, servers, etc. Figure 1 FIG. 1 is a flow chart of a path selection method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0024] Step S101 , obtaining a block address, and determining a target block corresponding to the block address from a plurality of blocks according to the block address; wherein the target block stores a plurality of path sets.

[0025] The block address may indicate the address of a target block in the path volume. The target block may be the block corresponding to the input / output request. Accordingly, the block address may be the block address corresponding to the input / output request.

[0026] The user triggers the input / output request by tapping the keyboard, clicking the mouse, or touching the screen. Accordingly, the computer device can obtain the block address in response to the input / output request.

[0027] There is a correlation between block addresses and input and output requests.

[0028] As an example, an I / O request can carry an identifier (such as tpgid), which is then mapped to a corresponding block address based on the identifier. For example, different business types may correspond to different identifiers. A predefined relationship between the identifier and the block address can be established. When an I / O request is received, the block address can be determined based on the relationship and the identifier.

[0029] As an example, I / O requests can be mapped to data characteristics, such as data size, data source, and data destination, and I / O requests with similar characteristics can be associated with block addresses. For example, for I / O requests for a large number of small files, the I / O request can be associated with the block address of a block that handles small file transfers, and the target block for processing small file transfers can be determined based on this block address.

[0030] As an example, the load of each block can be monitored in real time. When an input / output request is received, the address of a block with a lower load can be determined based on the load status of each block, and the target block with a lower load can be determined based on the block address.

[0031] As an example, after receiving an input / output request, it is possible to determine which blocks are frequently selected by the input / output request based on the path selection of historical input / output requests, wherein the block address of the block can be determined based on the input / output request, and then the target block corresponding to the input / output request can be determined based on the block address of the block.

[0032] A path device may correspond to multiple blocks. After determining a block address, the block corresponding to that block address can be further determined based on the block address. For example, the blocks corresponding to path device A1 may include blocks B11, B12, B13, and B14. Another example: the blocks corresponding to path device A2 may include blocks B21, B22, B23, and B24. These are not specifically limited here.

[0033] After determining the block address, the target block corresponding to the block address can be determined based on the block address. The target block stores multiple path sets, each of which can include at least one path. The path sets can include a first path set, a second path set, and a third path set. The first path set can be a set of paths with the highest priority, the second path set can be a set of non-priority paths, and the third path set can be a set of invalid paths, although this is not specifically defined here.

[0034] As an example, block addresses can adopt a hierarchical structure. Each block address corresponds to a target block. A specific implementation can be to maintain a mapping table to record the correspondence between block addresses and target blocks. The mapping table can be, for example, an in-memory hash table, and is not specifically limited here.

[0035] Step S102: When a first available path exists in a first path set in the target block, the first available paths in the first path set are traversed, and a first target path with a minimum performance index is determined from the first available paths; wherein the first path set is the path set with the highest priority in the target block, and the performance index indicates the transmission efficiency corresponding to the path.

[0036] The first available path may indicate a currently idle and usable path in the first path set. For example, in a multi-link network environment, there are multiple paths in the first path set for data transmission. The first available path, that is, the currently idle and usable path, may be selected from the first path set.

[0037] If a first available path exists in the first path set in the target block, a first target path with the lowest performance index is determined from the first available paths. The performance index indicates the transmission efficiency of the path and may include, but is not limited to, queue depth, latency, and load. In other words, the smaller the performance index, the higher the transmission efficiency of the path. The first target path with the lowest performance index is determined from the first available paths. The first target path with the lowest performance index is considered to have the highest transmission efficiency among the first available paths.

[0038] Performance indicators may include, but are not limited to, queue depth, latency, and load. Queue depth can be detected by a deployed listener. Message transmission latency can be determined by sending a timestamped message over the first available path. Load can be determined by indicators such as memory utilization and interface bandwidth utilization of path devices. These are not specifically defined here and are subject to implementation by those skilled in the art.

[0039] As an example, when determining the performance indicator of the first available path, a single performance indicator can be used to determine the first target path with the lowest performance indicator from the first available paths. For example, if only a single performance indicator is considered (e.g., latency), the latency of each first available path can be compared. All first available paths are traversed, the latency of each first available path is recorded, and the first available path with the lowest latency is selected as the first target path.

[0040] As an example, when determining the performance index of the first available path, a first target path with the minimum performance index can be determined from the first available paths using multiple performance indexes. This can include the following implementation solutions:

[0041] As an example, a weight can be assigned to the performance indicator of each path in the first available path. The size of the weight can reflect the importance of the performance indicator in path selection. For example, if latency has the greatest impact on data transmission performance, then latency can be assigned a larger weight; if queue depth has a relatively small impact, then queue depth can be assigned a smaller weight.

[0042] For each first available path, multiply each performance metric by its corresponding weight and add the results together to obtain the final performance metric for that first available path. For example, assume three performance metrics: latency (weight 0.6), queue depth (weight 0.3), and load (weight 0.1). If a first available path has a latency of 10ms, a queue depth of 5, and a load of 30%, the final performance metric for that first available path is: 10 × 0.6 + 5 × 0.3 + 30% × 0.1 = 6 + 1.5 + 0.03 = 7.53. After calculating the performance metrics of all first available paths, compare the performance metrics of all first available paths and select the path with the lowest performance metric as the first target path.

[0043] As an example, a hierarchical model can be constructed to decompose the path selection problem into a target layer (selecting the first target path), a criterion layer (various performance indicators), and a solution layer (the first available path). By comparing the importance of each performance indicator in the criterion layer, a judgment matrix is ​​constructed and the weights of each performance indicator are calculated. For each first available path, the performance indicator is determined based on its value and weight, and the path with the lowest performance indicator is selected as the first target path.

[0044] Step S103: selecting an input and output path according to the first target path.

[0045] An input / output path may indicate the channel or route that data passes through from input to output in a network environment. After determining a first target path, there may be multiple or one first target path. When there are multiple first target paths, an input / output path may be selected from the multiple first target paths. When there is only one first target path, that first target path may be used as the input / output path.

[0046] As an example, when there are multiple first target paths, one first target path may be randomly selected from the first target paths and used as the input and output path.

[0047] The path selection method provided by an embodiment of the present invention first obtains a block address and determines a target block when responding to an input / output request. Since the target block stores multiple path sets, only the input / output path corresponding to the input / output request is selected from the path sets within the target block, thereby narrowing the traversal range and improving path selection efficiency.

[0048] On the other hand, the first path set with the highest priority in the target block is processed first. When a first available path exists in the first path set, the first target path with the smallest performance indicator is determined from the first available paths. This avoids indiscriminate path screening among all available paths and further improves the path selection efficiency.

[0049] On the other hand, by pre-dividing the blocks and path sets, after determining the target blocks and path sets, the path selection for the target blocks corresponding to the input and output requests is more targeted. Compared with the method of screening paths among all available paths in related technologies, repeated screening operations are reduced and resource utilization is improved.

[0050] In a possible implementation, the target block further stores a second path set, where the priority of the second path set is lower than the priority of the first path set; and the method further includes:

[0051] Step S201 : When there is no first available path in the first path set, traverse the second available paths in the second path set and determine a second target path from the second available paths; wherein the second target path is the path with the minimum performance index among the second available paths.

[0052] The multiple path sets stored in the target block include a second path set. The priority of the second path set is lower than that of the first path set, that is, when determining the target block and selecting a path from the target block, the input and output paths are selected from the first path set first. When the first available path does not exist in the first path set, the second available paths in the second path set are traversed, and the second target path is determined from the second available paths. The second available path can indicate a path in the second path set that is currently idle and can be used. For example: in a multi-link network environment, there are multiple paths in the second path set for data transmission. The second available path, that is, the path that is currently idle and can be used, can be selected from the second path set first.

[0053] The second target path is a path with the smallest performance indicator among the second available paths.

[0054] As an example, performance indicators of the second available path may include, but are not limited to, queue depth, latency, and load. The queue depth can be detected by a deployed listener. The message transmission delay can be determined by sending a timestamped message along the second available path. The load can be determined by indicators such as memory utilization and interface bandwidth utilization of path devices. These are not specifically defined here and are subject to implementation by those skilled in the art.

[0055] As an example, when determining the performance indicator of the second available path, a single performance indicator can be used to identify the second target path with the lowest performance indicator from the first available paths. For example, if only a single performance indicator is considered (e.g., latency), the latency of each second available path can be compared. All second available paths are traversed, the latency of each second available path is recorded, and the second available path with the lowest latency is selected as the second target path.

[0056] Step S202: Select an input and output path according to the second target path.

[0057] After determining the second target path, the number of the second target paths may be multiple or one. When there are multiple second target paths, an input / output path may be selected from the multiple second target paths; when there is only one second target path, the second target path may be used as the input / output path.

[0058] Specifically, the above step S202 includes:

[0059] Step S2021: When the number of the second target paths is greater than the number threshold, any one path is selected from the plurality of second target paths, and the selected one path is used as an input and output path.

[0060] Step S2022: When the number of the second target paths is not greater than the number threshold, the second target paths are used as input and output paths.

[0061] The quantity threshold may be a pre-set threshold. After determining the second target path, it is necessary to determine the number of second target paths, that is, whether multiple second target paths exist. If multiple second target paths exist, one second target path may be randomly selected as the input and output path. If only one second target path exists, that second target path is used as the input and output path.

[0062] If the path selection method provided in this embodiment relies solely on the first path set for data transmission, data transmission will not proceed normally if the first available path in the first path set is no longer available, resulting in data transmission interruption. This embodiment sets a second path set as a backup for the first path set. If the first available path in the first path set is no longer available, a second target path can be selected from the second path set for data transmission, reducing the risk of data transmission interruption due to single point failures.

[0063] In a possible implementation, determining the first target path with the minimum performance indicator from the first available paths in step S102 includes steps S1021 and S1022.

[0064] In step S1021, the performance index of the initial path in the first available path is determined.

[0065] The initial path may be the path with the smallest flag among the first available paths. The flag may indicate the number of the first available path. The flag of the first available path may be pre-set. After determining the first available path, the initial path may be determined from the first available paths, and the performance index of the initial path may be further determined. The method for determining the performance index of the initial path is described in step S102 above and will not be further elaborated here.

[0066] As an example, the flag bits of each first available path may be compared, and then the path with the smallest flag bit among the first available paths may be used as the initial path, etc. This is not specifically limited here and can be implemented by those skilled in the art.

[0067] Step S1022: Determine a first target path from the first available paths according to the performance indicator of the initial path; wherein the initial path is the path with the smallest flag among the first available paths.

[0068] After the performance indicator of the initial path is determined, a first target path may be determined from the first available paths.

[0069] As an example, after determining the performance indicator of the initial path, the performance indicator of the path corresponding to the next flag bit can be determined, and then the performance indicator of the path corresponding to the next flag bit can be compared with the performance indicator of the initial path. When the performance indicator of the path corresponding to the next flag bit is less than the performance indicator of the initial path, the path corresponding to the next flag bit can be used as an alternative input and output path, and the performance indicator of the path corresponding to the next flag bit can continue to be determined until all the first available paths are traversed and the first target path is obtained.

[0070] As an example, a neural network model can be used to determine the first target path based on the performance indicators of the initial path. The performance indicators of the initial path can serve as the input of the neural network model, and the first target available path can serve as the output of the neural network model. The neural network model can be a convolutional neural network (CNN), a recurrent neural network (RNN), or other similar model.

[0071] The path selection method provided in this embodiment can adapt to network performance changes, such as link failures and network congestion, by determining the performance indicators of the initial path and dynamically adjusting the first target path based on the performance indicators of the initial path.

[0072] Furthermore, by determining the performance indicators of the initial path, such as delay, the transmission efficiency of each first available path can be evaluated, avoiding the irrationality caused by relying solely on subjective judgment or random path selection, and ensuring that the selected first target path objectively has good transmission performance.

[0073] In a possible implementation, the above step S1022 includes: step S1022A to step S1022C.

[0074] In step S1022A, performance indicators of other paths in the first available path except the initial path are determined respectively.

[0075] There may be multiple paths in the first available path. When there may be multiple paths in the first available path, an initial path is first determined, and then performance indicators of other paths in the first available path except the initial path are determined.

[0076] As an example, when determining a first target path with the minimum performance indicator from among the first available paths using a single performance indicator, the delays of paths other than the initial path among the first available paths can be determined. The queue depths of the paths other than the initial path among the first available paths can also be determined.

[0077] For example, different services have different requirements for path performance indicators. For example, audio and video services have higher requirements for latency and packet loss rate, while big data transmission services require higher bandwidth utilization. Therefore, the weight of each performance indicator can be dynamically adjusted based on the priority of the service.

[0078] Therefore, different services can be assigned priorities, such as high, medium, and low. Different weight templates can be set based on service priority. For example, for high-priority audio and video services, latency and packet loss rate are weighted more heavily; for low-priority big data transmission services, bandwidth utilization is weighted more heavily. When a new service's data input or output requests arrive, the corresponding weight template is selected based on the service's priority, and the weights of each performance indicator are adjusted to determine the weight of each. The performance indicators for the initial path and other paths other than the initial path are then determined based on the weights of each performance indicator.

[0079] For example, performance indicators (such as latency and queue depth) have certain time series characteristics, that is, the performance indicators at the current moment are correlated with those at past moments. Time series analysis methods (such as LSTM neural networks) can be used to predict performance indicators.

[0080] Specifically, historical performance indicators for each path are collected and organized into a time series of performance indicators in chronological order. Stationarity tests and preprocessing are performed on these time series performance indicators. A time series analysis model (such as an LSTM neural network) is selected to model and train these time series performance indicators. The trained time series analysis model is used to predict future performance indicators for each path. Based on the predicted performance indicators and combined with other current performance indicators, the final performance indicator for each path is calculated.

[0081] Step S1022B: when there is a first path to be screened among the other paths, a set to be screened is constructed based on the first path to be screened; wherein the first path to be screened is a path whose performance index is smaller than the performance index of the initial path.

[0082] The first path to be filtered is a path whose performance index is smaller than the performance index of the initial path. If the first path to be filtered exists among the other paths, that is, the initial path is not an input or output path, a set to be filtered can be constructed, and the set to be filtered contains all paths whose performance index is smaller than the performance index of the initial path.

[0083] As an example, firstly, the paths other than the initial path in the first available path are roughly screened to quickly exclude the paths that do not meet the requirements in the first available path to narrow the path screening range; then, the remaining paths are finely screened to determine the first target path.

[0084] Specifically, limiting conditions such as a delay threshold and a queue depth threshold can be pre-set, and other paths can be preliminarily screened using the limiting conditions to exclude paths that do not meet the limiting conditions. For example, paths with delays greater than the delay threshold and paths with queue depths greater than the queue depth threshold can be excluded. Paths that meet the limiting conditions can be obtained from among the other paths. Then, based on performance indicators of the paths that meet the limiting conditions from among the other paths, it can be further determined whether the paths that meet the limiting conditions are the first paths to be screened.

[0085] Step S1022C: determining a second path to be screened with a minimum performance indicator from the first paths to be screened, and determining the second path to be screened as the first target path.

[0086] After the set to be screened is constructed, each first path to be screened in the set to be screened may be further compared to determine a second path to be screened with the minimum performance indicator, and the second path to be screened may be determined as the first target path.

[0087] The path selection method provided in this embodiment uses the performance indicators of the initial path as a reference, clearly defining the path selection direction. By comparing the performance indicators of other paths with those of the initial path, the path with the lowest performance indicator can be quickly identified. Furthermore, after constructing the set to be screened, only the path with the lowest performance indicator within the set needs to be identified, eliminating the need to consider all paths in the initial set, thus improving path selection efficiency.

[0088] In one possible implementation, the method further includes:

[0089] Step S1022D: When the first path to be screened does not exist in the other paths and a third path to be screened exists, the third path to be screened and the initial path are determined as the first target path; wherein the third path to be screened is a path whose performance index is equal to the performance index of the initial path.

[0090] The third path to be screened is a path whose performance index is equal to that of the initial path. If the first path to be screened is not present in the other paths and the third path to be screened is present, indicating that none of the other paths has a lower performance index than the initial path, but a path in the other paths has the same performance index as the initial path, then the third path to be screened and the initial path can be collectively determined as the first target path.

[0091] The path selection method provided in this embodiment introduces a third path to be screened during the process of determining the first path to be screened. If the first path to be screened does not exist, it introduces a third path to be screened and determines it along with the initial path as the first target path. This ensures that all possible paths that meet the requirements are considered, making path selection more comprehensive and complete. Furthermore, determining the third path to be screened along with the initial path as the first target path prevents the initial path from degrading its performance or becoming invalid, while still ensuring that other optional paths are available to respond to input / output requests.

[0092] In one possible implementation, the method further includes:

[0093] Step S1022E: When all other paths are the fourth path to be screened, the initial path is determined as the first target path; wherein the fourth path to be screened is a path having a performance index greater than the performance index of the initial path.

[0094] The fourth path to be screened is a path whose performance index is greater than that of the initial path. This means that the fourth path to be screened is not the first target path and is a non-optimal path. If all other paths are the fourth path to be screened, then all paths except the initial path are non-optimal paths. In this case, the initial path can be used as the first target path.

[0095] In the path selection method provided in this embodiment, the performance index of the fourth to-be-screened path is greater than that of the initial path, meaning that the transmission efficiency corresponding to the fourth to-be-screened path is lower than that corresponding to the initial path. Selecting the fourth to-be-screened path as the first target path may introduce issues such as higher latency, greater packet loss, or lower bandwidth. Selecting the initial path as the first target path, however, avoids issues such as higher latency, greater packet loss, or lower bandwidth that might result from selecting a path with lower performance.

[0096] In a possible implementation, the above step S103 includes: step S1031.

[0097] In step S1031 , when there are multiple first target paths, any one path is selected from the multiple first target paths, and the selected one path is used as an input and output path.

[0098] When there are multiple first target paths, it indicates that there are multiple selectable first target paths, and any one of the multiple first target paths can be selected and used as an input and output path.

[0099] In the path selection method provided in this embodiment, multiple first target paths can provide redundant backup. When a first target path fails, other first target paths are randomly selected to continue to ensure responses to input and output requests, thereby ensuring normal data transmission.

[0100] Please refer to Figure 2 , Figure 2 FIG. 4 is another flowchart of a path selection method according to an embodiment of the present invention.

[0101] In a specific implementation, combined with Figure 2 As shown, the path selection method may include the following steps:

[0102] Step a1: determine the target block N according to the block address.

[0103] Step a2: Obtain the relevant data structure of the target block N; wherein the relevant data structure may indicate the priority of the path set in the target block N.

[0104] Step a3: Determine whether the number of first available paths in the first path set of block N is greater than 0. If the number of first available paths in the first path set is greater than 0, jump to step a4; if the number of first available paths in the first path set is not greater than 0, adjust to step a12.

[0105] In step a4, the optimal priority list of the target block N is transmitted to the path selection module and the variable P is initialized to 0; wherein, the variable P indicates the flag of the first available path in the optimal priority list. When the variable P is 0, the first available path can be the initial path, and the optimal priority list can indicate the optimal priority list composed of the first available paths.

[0106] Step a5, determine whether the variable P is less than the number of first available paths to the target block N; if the variable P is less than the number of first available paths to the target block N, jump to step a6; if the variable P is not less than the number of first available paths to the target block N, jump to step a21.

[0107] Step a6: Determine the performance indicator of the first available path P.

[0108] Step a7: Determine whether the performance index of the first available path P is better than the performance index of the initial path. In this step, the variable P is greater than 0. If the performance index of the first available path P is better than the performance index of the initial path, jump to step a8; if the performance index of the first available path P is not better than the performance index of the initial path, jump to step a9.

[0109] Step a8: Delete the initial path and set the first available path P as the input and output path to be selected.

[0110] Step a9: Determine whether the performance index of the first available path P is equal to the performance index of the initial path; if the performance index of the first available path P is equal to the performance index of the initial path, jump to step Sa10; if the performance index of the first available path P is neither better than nor equal to the performance index of the initial path, jump to step a11.

[0111] Step a10: Increase the number of input and output paths to be selected, and record the first available path P.

[0112] In step a11, the variable P is incremented by 1, and then the process jumps to step a5.

[0113] Step a12, determine whether the number of second available paths in the second path set of target block N is greater than 0; if the number of second available paths in the second path set of target block N is greater than 0, jump to step a13; if the number of second available paths in the second path set of target block N is not greater than 0, end.

[0114] In step a13, the non-optimal priority linked list of the target block N is transmitted to the path selection module and the variable Q is initialized to 0; wherein, the variable Q indicates the flag of the second available path in the non-optimal priority linked list. When the variable Q is 0, the second available path may be the initial path among the second available paths, and the non-optimal priority linked list may indicate the non-optimal priority linked list composed of the second available paths, that is, the second path set.

[0115] Step a14, determine whether the variable Q is less than the number of the second available paths to the target block N; if the variable Q is less than the number of the second available paths to the target block N, jump to step a15; if the variable Q is not less than the number of the second available paths to the target block N, jump to step a21.

[0116] Step a15: Determine the performance indicator of the second available path Q.

[0117] Step a16: Determine whether the performance index of the second available path Q is better than the performance index of the initial path in the second available paths. If the performance index of the second available path Q is better than the performance index of the initial path in the second available paths, jump to step a17. If the performance index of the second available path Q is not better than the performance index of the initial path in the second available paths, jump to step a18.

[0118] Step a17: Delete the initial path in the second available path and determine the second available path Q as the input and output path to be screened.

[0119] In step a18, it is determined whether the performance index of the second available path Q is equal to the performance index of the initial path in the second available paths. If the performance index of the second available path Q is equal to the performance index of the initial path in the second available paths, the process proceeds to step a19. If the performance index of the second available path Q is not better than and is not equal to the performance index of the initial path in the second available paths, the process proceeds to step a20.

[0120] Step a19: Increase the number of input and output paths to be screened, and record the second available path Q.

[0121] In step a20, the variable Q is incremented by 1, and then the process jumps to step a14.

[0122] Step a21, determine whether the input and output paths to be screened exist in the first path set; if the input and output paths to be screened exist in the first path set, jump to step a22; if the input and output paths to be screened do not exist in the first path set, jump to step a23.

[0123] Step a22, determine whether the number of input and output paths to be screened in the first path set is greater than 1; if the number of input and output paths to be screened in the first path set is greater than 1, jump to step a23; if the number of input and output paths to be screened in the first path set is not greater than 1, jump to step a24.

[0124] Step a23: randomly select an input / output path from the input / output paths to be screened in the first path set, and then end.

[0125] Step a24: Select a unique input and output path to be screened from the first path set, and then end.

[0126] Step S25, determine whether the input and output paths to be screened exist in the second path set; if the input and output paths to be screened exist in the second path set, jump to step a26; if the input and output paths to be screened do not exist in the second path set, end.

[0127] Step a26, determine whether the number of input and output paths to be screened in the second path set is greater than 1; if the number of input and output paths to be screened in the second path set is greater than 1, jump to step a27; if the number of input and output paths to be screened in the second path set is not greater than 1, jump to step a28.

[0128] Step a27: randomly select an input / output path from the input / output paths to be screened in the second path set, and then end.

[0129] Step a28: Select a unique input and output path to be screened from the second path set, and then end.

[0130] The path selection method provided in this embodiment accurately selects input and output paths with superior performance by comparing the performance indicators of a first available path with those of its initial path, and of a second available path with those of its initial path. For example, in step a7, a strict determination is made as to whether the performance indicator of the first available path P is superior to that of the initial path. If so, the first available path P is selected as the candidate input and output path. This ensures that the superior performance path is always used for data transmission, thereby improving data read and write speeds and reducing latency.

[0131] In addition, a first path set and a second path set are set. If no paths are available in the first path set, the second path set is selected (steps a12-a13). This multipath redundancy design ensures that even if some paths fail, the service can continue operating through other available paths, avoiding data transmission interruptions caused by a single path failure and ensuring service continuity.

[0132] In a possible implementation, the above method further includes: step S301 to step S302.

[0133] In step S301 , a plurality of blocks of a path device are created; wherein each block of the path device is provided with a preset path, and the number of preset paths of each block is the same.

[0134] A path device refers to a device with multiple physical or logical paths for data transmission, communication, or access. A path device can be a disk array in a storage system, or a router or switch in a network, without specific limitation.

[0135] A preset path is a data transmission path pre-set during the path device initialization or configuration phase. Each block is assigned a preset path, and each block has the same number of preset paths. For example, each block may have four preset paths; another example may have five preset paths, and so on. This is not a specific limitation.

[0136] As an example, blocks can be divided according to the physical characteristics of the path device (such as the head and cylinder of the disk), the logical structure (such as the partition of the file system), or the business requirements (such as the data storage requirements of different applications).

[0137] Step S302, repeatedly performing a search operation for a first path set of a target block until the number of repetitions equals the total number of preset paths to determine a first path set, and performing a search operation for the first path set of the target block, including:

[0138] Obtain an optimal identifier of a target block and determine an identifier of a pending path targeted by a current search operation; when the identifier of the pending path is different from the optimal identifier of the target block, determine an identifier of the pending path targeted by a next search operation; when the identifier of the pending path is the same as the optimal identifier of the target block, determine the pending path as a first path set; the target block is any one of the multiple blocks.

[0139] The optimal identifier of the target block may indicate the optimal tpgid (Target Port Group ID) of the target block. The tpgid is used to identify and distinguish controller port groups of different storage devices. The optimal identifier of the target block may be a pre-set optimal identifier or may be determined by other means, which are not specifically limited here and may be determined by those skilled in the art.

[0140] The pending path may indicate a path within the target block that has not yet been divided, that is, the pending path has not yet been divided into one of the first path set, the second path set, and the third path set.

[0141] In this embodiment, the path corresponding to the optimal identifier of the target block may be a path belonging to the first path set. After obtaining the optimal identifier of the target block, each pending path may be divided into a corresponding path set based on the identifier of each pending path. Specifically, the identifier of the pending path targeted by the current search operation is determined, and then the identifier of the pending path targeted by the current search operation is compared with the optimal identifier of the target block. When the identifier of the pending path and the optimal identifier of the target block are different, it indicates that the pending path does not belong to the first path set. The identifier of the pending path targeted by the next search operation may be determined, and further judgment is made to determine whether the identifier of the pending path targeted by the next search operation and the optimal identifier of the target block are the same. If the identifier of the pending path targeted by the next search operation and the optimal identifier of the target block are the same, it indicates that the pending path targeted by the next search operation belongs to the first target set, and the pending path may be added to the first path set.

[0142] It should be noted that the target block is any one of the multiple blocks, that is, when the search operation of the first path set is repeatedly performed on a block, the block can be the target block.

[0143] The path selection method provided in this embodiment can accurately select pending paths that match the optimal identifier by repeatedly searching the first path set and comparing the optimal identifier of the target block with the identifiers of the pending paths. This search operation can eliminate paths with poor performance, such as links with high latency or low bandwidth, thereby ensuring that the ultimately determined first path set is the current optimal path combination.

[0144] In a possible implementation, the step S302 of determining the identifier of the pending path targeted by the current search operation includes steps S3021 and S3022.

[0145] In step S3021, it is determined whether the pending path targeted by the current search operation is a valid path.

[0146] A valid path may indicate a usable path, ie, a path without faults. Before determining the identifier of the pending path targeted by the current search operation, it may first be determined whether the pending path targeted by the current search operation is a valid path.

[0147] As an example, various types of sensors, such as temperature sensors, current sensors, and signal strength sensors, can be deployed on the pending path of a path device. For network paths, network performance monitoring sensors can be installed on network devices (such as routers and switches) to collect real-time data such as temperature, current, network signal strength, bandwidth utilization, and packet loss rate on the pending path. This data is then comprehensively analyzed. For example, if a temperature sensor detects an abnormally high temperature in a certain part of the path device, while a current sensor indicates excessive current, this may indicate a hardware failure risk on the pending path. In this case, the pending path is deemed invalid.

[0148] As an example, during data transmission, a real-time feedback mechanism is established between the sender and receiver. The sender adds a timestamp and sequence number to each data packet. Upon receiving the data packet, the receiver immediately feeds back information such as the reception time and sequence number. Based on this feedback, the sender calculates performance metrics such as the data packet's transmission delay and jitter. If the transmission delay exceeds a preset threshold or the jitter is excessive, the transmission performance of the proposed path is unstable and the proposed path is deemed invalid.

[0149] In step S3022, if the pending path targeted by the current search operation is a valid path, an identifier of the pending path targeted by the current search operation is determined.

[0150] If it is determined that the pending path targeted by the current search operation is a valid path, an identifier of the pending path targeted by the current search operation may be further determined to determine whether the pending path belongs to the first path set.

[0151] The path selection method provided in this embodiment determines whether the pending path is a valid path, thereby avoiding the waste of resources caused by using invalid paths, thereby more effectively utilizing limited path resources.

[0152] In a possible implementation, the above method further includes: step S3023.

[0153] In step S3023 , when the identifier of the pending path is different from the optimal identifier of the target block, the pending path targeted by the current search operation is added to the second path set.

[0154] When the identifier of the pending path is different from the optimal identifier of the target block, it indicates that the pending path does not belong to the first path set. In this case, the pending path can be added to the second path set as an alternative to the first path set. That is, when the first available path does not exist in the first path set, the second available path is selected from the second path set.

[0155] The path selection method provided in this embodiment provides a rich set of alternative paths for data transmission by incorporating non-optimal but valid pending paths into the second path set. In a network environment, paths in the first path set may become temporarily inoperable due to traffic surges, device failures, or network attacks. In such cases, paths in the second path set can replace those in the first path set, ensuring data transmission continuity.

[0156] In a possible implementation, the above method further includes: step S3024.

[0157] In step S3024, if the pending path targeted by the current search operation is an invalid path, the pending path targeted by the current search operation is added to the third path set of the target block; wherein the third path set is a set constructed by invalid paths.

[0158] The third path set is a set of invalid paths. That is, all paths stored in the third path set are invalid paths. During a search operation on the first path set, if the pending path targeted by the current search operation is an invalid path, the pending path is added to the third path set of the target block.

[0159] As an example, features are extracted from invalid paths. These features may include the invalid path's topology (number and type of nodes traversed by the invalid path), historical performance metrics of the invalid path (latency, packet loss rate, bandwidth utilization, etc.), and the time and frequency of failures. Machine learning models, such as decision trees, random forests, and neural networks, are trained using these features to predict the probability of a path becoming invalid in the future. The predicted results are compared with the actual status of the invalid path to continuously optimize the model. Based on the machine learning model's predictions, invalid paths are dynamically classified, for example, into high-risk invalid paths (highly likely to become invalid again in the future) and low-risk invalid paths (lower probability of becoming invalid again).

[0160] The path selection method provided in this embodiment integrates invalid paths into a third path set, effectively providing a dedicated fault path information database. Maintenance personnel no longer need to blindly search for fault points in a vast path network. By simply checking the third path set, they can quickly locate all known invalid paths, improving troubleshooting efficiency.

[0161] Please refer to Figure 3 , Figure 3 FIG. 4 is another flowchart of a path selection method according to an embodiment of the present invention.

[0162] In one possible implementation, combining Figure 3 As shown, the path selection method includes the following steps:

[0163] Step b1: Initialize the data structure of the path device, wherein the data structure includes: block-related data structure, that is, the identifier of the pending path in the block, the optimal identifier of the block, etc.

[0164] In step b2, the block identifier M is set to 0. Starting from identifier 0, each block in the path device is traversed to determine the path set corresponding to each block's pending path. When any block's turn comes, it can be used as the target block.

[0165] Step b3, determine whether the identifier M of the target block is less than the total number of blocks; if the identifier M of the target block is less than the total number of blocks, jump to step b4; if the identifier M of the target block is not less than the total number of blocks, end.

[0166] Step b4: Initialize the first path set of the target block M.

[0167] Step b5: Initialize the second path set of the target block M.

[0168] Step b6: Initialize the third path set of the target block M.

[0169] Step b7: determining the optimal identifier of the target block M; wherein the optimal identifier corresponding to each target block M may be pre-set.

[0170] Step b8: Determine whether the identifier X of the pending path in the target block M is greater than the total number of pending paths in the target block M. If the identifier X of the pending path in the target block M is greater than the total number of pending paths in the target block M, jump to step b9. If the identifier X of the pending path in the target block M is not greater than the total number of pending paths in the target block M, jump to step b15.

[0171] Step b9, determining whether the pending path X is a valid path; if the pending path X is a valid path, jump to step b11; if the pending path X is an invalid path, jump to step b10, where the pending path X may indicate the pending path identified as X.

[0172] Step b10: Add the pending path X to the third path set of the target block M, and jump to step b14.

[0173] Step b11, determine whether the identifier of the pending path X is equal to the optimal identifier; if the identifier of the pending path X is equal to the optimal identifier, jump to step b12; if the identifier of the pending path X is not equal to the optimal identifier, jump to step b13.

[0174] Step b12: Add the pending path X to the first path set in the target block M, and then jump to step b14.

[0175] Step b13: Add the pending path X to the second path set in the target block M, and then jump to step b14.

[0176] Step b14: Increment the identifier X of the pending path by 1, and then jump to step b3;

[0177] In step b15, the identifier M of the target block is incremented by 1, and then the process jumps to step b8.

[0178] The path selection method provided in this embodiment sequentially traverses each block using its identifier, ensuring comprehensive coverage of all blocks in the path device while avoiding duplicate block processing. Furthermore, when processing each block, the method traverses pending paths and determines and classifies them, reducing unnecessary calculations and operations and improving processing efficiency.

[0179] In a possible implementation, the above method further includes: step S401 to step S402.

[0180] In step S401, each of the multiple blocks is traversed to determine a target path set of the block where the second target path is located; wherein the target path set is one of the first path set and the second path set, and the second target path is a failed path.

[0181] The target path set is one of the first path set and the second path set, that is, for each block in the plurality of blocks, a second target path needs to be found from the first path set and the second path set. The second target path is the path where the failure occurs.

[0182] In a specific implementation, for each of the multiple blocks, all paths within the block are checked to see if any path has changed from a valid path to an invalid path. If any path within the block has changed from a valid path to an invalid path, the path can be determined to be the second target path, i.e., the failed path.

[0183] In step S402 , the second target path is removed from the target path set, and the second target path is added to a third path set corresponding to the block.

[0184] If the path is determined to be the second target path, the second target path needs to be removed from the target path set and added to the third path set corresponding to the block. For example, if path I in the first path set changes from a valid path to an invalid path, path I can be removed from the first path set and added to the third path set corresponding to the block.

[0185] The path selection method provided in this embodiment comprehensively checks the path conditions within each block by traversing multiple blocks, quickly locating the block where the faulty second target path resides and the target path set (either the first path set or the second path set). Compared to blindly and randomly searching for faulty paths, this method shortens the time it takes to discover the faulty path and improves the timeliness of fault resolution.

[0186] In a possible implementation, the above method further includes: steps S403 to S405.

[0187] In step S403, a unique identifier of the second target path is obtained.

[0188] The unique identifier of the second target path may indicate H:C:T information, that is, Header:Command:Trailer information. The unique identifier of the second target path may be a pre-set identifier.

[0189] In step S404, when there are multiple path devices, each of the multiple path devices is traversed, and a third target path is determined from each path device respectively; wherein the third target path is a path with a unique identifier.

[0190] If there are multiple path devices and a second target path exists on one of them, it is necessary to traverse each of the multiple path devices and then determine a third target path from each path device. The third target path is a path with a unique identifier. For example, if a second target path exists on path device Y1, it is necessary to determine the third target path from all path devices, including path devices Y2, Y3, and Y4. The unique identifier of the third target path is the same as the unique identifier of the second target path.

[0191] In step S405, for a target path device, a target path set to which a third target path of the target path device belongs is determined, the third target path is removed from the target path set to which the third target path belongs, and the third target path is added to the third path set; wherein the target path device is any one of the plurality of path devices.

[0192] The target path device is any one of multiple path devices. When a third target path exists for the target path device, it is necessary to determine the target path set to which the third target path belongs. The target path set may be the first path set or the second path set. The third target path is then removed from the first path set or the second path set and added to the third path set.

[0193] The path selection method provided in this embodiment traverses multiple path devices and determines a third target path with a unique identifier from each path device. This method can accurately locate invalid paths on each path device, thereby preventing invalid paths from occupying path device resources and improving resource utilization.

[0194] Please refer to Figure 4 , Figure 4 This is another flowchart of the path selection method provided according to an embodiment of the present invention.

[0195] In one possible implementation, combining Figure 4 As shown, the path selection method may include the following steps:

[0196] Step c1, determine whether path Z is a link fault error; if path Z is a link fault error, jump to step c11; if path Z is not a link fault error, jump to step c2.

[0197] Step c2, determine whether path Z has been set as an invalid path; if path Z is set as an invalid path, end; if path Z is not set as an invalid path, jump to step c3.

[0198] Step c3: Obtain the relevant data structure of the block of the multipath device to which the path Z belongs.

[0199] Step c4: Initialize the block identifier K and set the block identifier K to 0.

[0200] Step c5, determine whether the block identifier K is less than the total number of blocks; if the block identifier K is less than the total number of blocks, jump to step c6; if the block identifier K is not less than the total number of blocks, jump to step c10.

[0201] In step c6, it is determined whether the identifier of path Z is equal to the optimal identifier of block K. If the identifier of path Z is equal to the optimal identifier of block K, the process proceeds to step c7. If the identifier of path Z is not equal to the optimal identifier of block K, the process proceeds to step c8, where block K may indicate a block identified as K.

[0202] Step c7: move path Z out of the first path set of block K, add path Z to the third path set of block K, and then jump to step c9.

[0203] Step c8: move path Z out of the second path set of block K, add path Z to the third path set of block K, and then jump to step c9.

[0204] In step c9, the block identifier K is incremented by 1, and then the process jumps to step c5.

[0205] Step c10: Set path Z as an invalid path and set the link failure flag to 0.

[0206] Step c11: obtain the unique identification and identifier of path Z and initialize the identification i of the path device to 0.

[0207] Step c12, determine whether the path device identifier i is less than the total number of path devices; if the path device identifier i is less than the total number of path devices, jump to step c13; if the path device identifier i is not less than the total number of path devices, end.

[0208] Step c13 : searching for a path H whose unique identifier of the path device i is the same as the unique identifier of the path Z, wherein the path device i indicates the path device identified as i.

[0209] Step c14, determine whether path H has been set as an invalid path; if path H is set as an invalid path, jump to step c23; if path H is not set as an invalid path, jump to step c15.

[0210] Step c15: Obtain the relevant data structure of the block of the path device to which the path H belongs.

[0211] Step c16: The flag F of the initial block is set to 0.

[0212] Step c17, determine whether the block identifier F is less than the total number of blocks; if the block identifier F is less than the total number of blocks, jump to step c18; if the block identifier F is not less than the total number of blocks, jump to step c22.

[0213] Step c18, determine whether the identifier of path H is equal to the optimal identifier of block F; if the identifier of path H is equal to the optimal identifier of block F, jump to step c19; if the identifier of path H is not equal to the optimal identifier of block F, jump to step c20.

[0214] Step c19: move path H out of the first path set of block F, add path H to the third path set of block F, and then jump to step c21, where block F indicates the block identified as F.

[0215] Step c20 , moving path H out of the second path set of block F, adding path H to the third path set of block F, and then jumping to step c21 .

[0216] In step c21, the block identifier F is incremented by 1, and then the process jumps to step c17.

[0217] Step c22: Set path H as an invalid path and set the link failure flag to 1.

[0218] In step c23, the identifier i of the path device is incremented by 1, and then the process jumps to step c12.

[0219] The path selection method provided in this embodiment first determines whether a path is experiencing a link failure error, then isolates the link failure condition and performs targeted processing. This method can quickly identify paths experiencing link failures, avoiding misjudgment and unnecessary processing of normal paths, and improving path management accuracy. Furthermore, by traversing multiple path devices and determining uniquely identified paths from each path device, the method can accurately locate invalid paths on each path device, preventing invalid paths from occupying path device resources and improving resource utilization.

[0220] In a possible implementation, the above method further includes: steps S501 to S503.

[0221] In step S501, when a fourth target path exists in the third path set, an identifier of the fourth target path is obtained; wherein the fourth target path is a valid path in the third path set.

[0222] As can be seen above, the third path set consists of invalid paths. The fourth target path is a valid path in the third path set. Because path status can change, an invalid path in the third path set may become a valid path. Therefore, if the fourth target path exists in the third path set, the corresponding path set must be repartitioned. First, the identifier of the fourth target path, that is, the tpgid of the fourth target path, must be determined.

[0223] In step S502 , when the identifier of the fourth target path is the same as the optimal identifier of the target block, the fourth target path is added to the first path set.

[0224] In step S503 , when the identifier of the fourth target path is different from the optimal identifier of the target block, the fourth target path is added to the second path set.

[0225] The tpgid of the fourth target path is compared with the optimal identifier of the target block. When the identifier of the fourth target path and the optimal identifier of the target block are the same, the fourth target path is added to the first path set; when the identifier of the fourth target path and the optimal identifier of the target block are different, the fourth target path is added to the second path set.

[0226] The path selection method provided in this embodiment can redivide the path set for the fourth target path by determining to select a valid fourth target path from the third path set and obtaining its identifier, thereby avoiding resource waste caused by valid paths existing in the third path set.

[0227] In a possible implementation, the above method further includes: step S504.

[0228] In step S504, a link failure flag corresponding to the fourth target path is obtained, and the link failure flag corresponding to the fourth target path is deleted; wherein the link failure flag indicates that a fault exists in the link where the fourth target path is located.

[0229] The link failure flag can indicate a pre-set failure flag. When a path in the target block fails, the corresponding link failure flag can be set. After the failed path becomes the fourth target path, the link failure flag corresponding to the fourth target path can be deleted.

[0230] The path selection method provided in this embodiment can effectively indicate that the path is a valid path by deleting the link failure flag.

[0231] Please refer to Figure 5 , Figure 5 2 is another flowchart of the path selection method provided according to an embodiment of the present invention.

[0232] In one possible implementation, combining Figure 5 As shown, the path selection method includes the following steps:

[0233] Step d1, determine whether the link failure flag of path Z is 1; if the link failure flag of path Z is 1, jump to step d11; if the link failure flag of path Z is not 1, jump to step d2.

[0234] Step d2, determine whether path Z has been set as a valid path; if path Z has been set as a valid path, end; if path Z has not been set as a valid path, jump to step d3.

[0235] Step d3: Obtain the relevant data structure of the block of the path device to which the path Z belongs.

[0236] In step d4, the flag G of the initial block is set to 0.

[0237] Step d5, determine whether the block identifier G is less than the total number of blocks; if the block identifier G is less than the total number of blocks, jump to step d6; if the block identifier G is not less than the total number of blocks, jump to step d10.

[0238] In step d6, it is determined whether the identifier of path Z is equal to the optimal identifier of block G. If the identifier of path Z is equal to the optimal identifier of block G, the process proceeds to step d7. If the identifier of path Z is not equal to the optimal identifier of block G, the process proceeds to step d8. Block G indicates the block identified as G.

[0239] Step d7: Add path Z to the first path set of block G, remove path Z from the third path set of block M, and then jump to step d9.

[0240] Step d8: Add path Z to the second path set of block G, remove path Z from the third path set of block M, and then jump to step d9.

[0241] In step d9, the block identifier G is incremented by 1, and then the process jumps to step d5.

[0242] Step d10: Set path Z as a valid path and clear the link failure flag.

[0243] Step d11: Obtain the unique identification and identifier of path Z, and initialize the identification o of the path device to 0.

[0244] Step d12, determine whether the path device identifier o is less than the total number of path devices; if the path device identifier o is less than the total number of path devices, jump to step d13; if the path device identifier o is not less than the total number of path devices, end.

[0245] Step d13: Search for a path J whose unique identifier of the path device o is the same as the unique identifier of the path Z. The path device o indicates the path device with the identifier o.

[0246] Step d14, determine whether path J has been set as a valid path; if path J has been set as a valid path, jump to step d25; if path J has not been set as a valid path, jump to step d15.

[0247] Step d15, determine whether the link failure flag of path J is 1; if the link failure flag of path J is 1, jump to step d16; if the link failure flag of path J is not 1, jump to step d25.

[0248] Step d16, determine whether the input and output of path J are normal; if the input and output of path J are normal, jump to step d17; if the input and output of path J are abnormal, jump to step d25.

[0249] Step d17: Obtain the relevant data structure of the block of the path device to which the path J belongs.

[0250] In step d18, the identifier U of the initial block is set to 0.

[0251] Step d19, determine whether the block identifier U is less than the total number of blocks; if the block identifier U is less than the total number of blocks, jump to step d20; if the block identifier U is not less than the total number of blocks, jump to step d24.

[0252] Step d20, determine whether the identifier of path J is equal to the optimal identifier of block U; if the identifier of path J is equal to the optimal identifier of block U, jump to step d21; if the identifier of path J is not equal to the optimal identifier of block U, jump to step d22.

[0253] Step d21: add path J to the first path set of block U, remove path J from the third path set of block U, and then jump to step d23.

[0254] Step d22: add path J to the second path set of block U, remove path J from the third path set of block U, and then jump to step d23.

[0255] In step d23, the block identifier U is incremented by 1, and then the process jumps to step d19.

[0256] Step d24: Set path J as a valid path and clear the link failure flag.

[0257] In step d25, the identifier o of the path device is incremented by 1, and then the process jumps to step d12.

[0258] The path selection method provided in this embodiment distinguishes paths with link failures by evaluating the link failure flags of the paths, separating them from the normal path processing flow for specialized processing. This avoids path selection errors caused by link failures and ensures more accurate classification and management of paths in different states. Furthermore, by selecting valid paths from the third path set and obtaining their identifiers, the paths can be reclassified into the path set, avoiding resource waste caused by valid paths existing in the third path set.

[0259] This embodiment also provides a path selection device for implementing the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0260] This embodiment provides a path selection device, which includes:

[0261] An acquisition module is configured to acquire a block address and determine a target block corresponding to the block address from a plurality of blocks based on the block address; wherein the target block stores a plurality of path sets; a traversal determination module is configured to traverse the first available paths in the first path set in the target block when a first available path exists, and to determine a first target path with the minimum performance indicator from the first available paths; wherein the first path set is the path set with the highest priority in the target block, and the performance indicator indicates the transmission efficiency corresponding to the path; and a first selection module is configured to select an input and output path based on the first target path.

[0262] In one possible implementation, the target block further stores a second path set, wherein the priority of the second path set is lower than that of the first path set. The apparatus further includes: a traversal determination module configured to, when the first available path does not exist in the first path set, traverse the second available paths in the second path set and determine a second target path from the second available paths; wherein the second target path is the path with the lowest performance indicator among the second available paths. A second selection module configured to select an input or output path based on the second target path.

[0263] In one possible implementation, the traversal determination module includes: a first determination unit, configured to determine a performance indicator of an initial path among the first available paths; and a second determination unit, configured to determine a first target path from the first available paths based on the performance indicator of the initial path; wherein the initial path is the path with the smallest flag bit among the first available paths.

[0264] In one possible implementation, the second determination unit includes: a first determination subunit, used to separately determine the performance indicators of other paths except the initial path in the first available path; a construction subunit, used to construct a to-be-screened set based on the first to-be-screened path when a first to-be-screened path exists in other paths; a second determination subunit, used to determine a second to-be-screened path with the smallest performance indicator from the first to-be-screened path, and determine the second to-be-screened path as the first target path.

[0265] In one possible implementation, the above-mentioned device also includes: a first determination module, which is used to determine the third path to be filtered and the initial path as the first target path when the first path to be filtered does not exist in other paths and a third path to be filtered exists; wherein the third path to be filtered is a path whose performance index is equal to the performance index of the initial path.

[0266] In one possible implementation, the device further includes: a second determination module configured to determine the initial path as the first target path when all other paths are fourth paths to be screened; wherein the fourth path to be screened is a path having a performance index greater than that of the initial path.

[0267] In a possible implementation, the first selection module is configured to, when there are multiple first target paths, select any one path from the multiple first target paths, and use the selected one path from the first target paths as the input and output path.

[0268] In one possible implementation, the apparatus further includes: a creation module configured to create a plurality of blocks of a path device; wherein each block of the path device is provided with a preset path, and each block has the same number of preset paths; a repeated search module configured to repeatedly perform a search operation on a first path set of a target block until the number of repeated executions equals the total number of preset paths, so as to determine a first path set, and performing the search operation on the first path set of the target block, including: obtaining an optimal identifier of the target block, and determining an identifier of a pending path targeted by a current search operation; when the identifier of the pending path is different from the optimal identifier of the target block, determining an identifier of the pending path targeted by a next search operation; when the identifier of the pending path is the same as the optimal identifier of the target block, determining the pending path as the first path set; the target block is any one of the plurality of blocks.

[0269] In one possible implementation, the repeated search module includes: a valid path determination unit, which is used to determine whether the pending path targeted by the current search operation is a valid path; and a search unit, which is used to determine the identifier of the pending path targeted by the current search operation if the pending path targeted by the current search operation is a valid path.

[0270] In a possible implementation, the apparatus further includes: a first adding module configured to add the pending path targeted by the current search operation to the second path set when the identifier of the pending path is different from the optimal identifier of the target block.

[0271] In one possible implementation, the above-mentioned device also includes: a second adding module, which is used to add the pending path targeted by the current search operation to the third path set of the target block if the pending path targeted by the current search operation is an invalid path; wherein the third path set is a set constructed by invalid paths.

[0272] In one possible implementation, the apparatus further includes: a target set determination module configured to traverse each of the plurality of blocks and determine a target path set for the block where the second target path is located; wherein the target path set is one of the first path set and the second path set, and the second target path is a path where a fault occurs; and a third adding module configured to remove the second target path from the target path set and add the second target path to the third path set corresponding to the block.

[0273] In one possible implementation, the apparatus further includes: a unique identifier acquisition module configured to acquire a unique identifier for the second target path; a third target path determination module configured to, when there are multiple path devices, traverse each of the multiple path devices and determine a third target path from each path device; wherein the third target path is a path having a unique identifier; and a fourth adding module configured to determine, for the target path device, a target path set to which the third target path of the target path device belongs, remove the third target path from the target path set to which the third target path belongs, and add the third target path to the third path set; wherein the target path device is any one of the multiple path devices.

[0274] In one possible implementation, the identifier acquisition module is configured to acquire an identifier of the fourth target path when the fourth target path exists in the third path set; wherein the fourth target path is a valid path in the third path set; the fifth adding module is configured to add the fourth target path to the first path set when the identifier of the fourth target path is the same as the optimal identifier of the target block; and the sixth adding module is configured to add the fourth target path to the second path set when the identifier of the fourth target path is different from the optimal identifier of the target block.

[0275] In a possible implementation, the apparatus further includes: a deletion module configured to obtain a link failure flag corresponding to the fourth target path, and delete the link failure flag corresponding to the fourth target path; wherein the link failure flag indicates that a fault exists in the link where the fourth target path is located.

[0276] In one possible implementation, the second selection module includes: a first selection unit, configured to select any one path from a plurality of second target paths when the number of second target paths is greater than a quantity threshold, and use the any one path selected from the second target paths as an input / output path; and a second selection unit, configured to use the second target path as an input / output path when the number of second target paths is not greater than the quantity threshold.

[0277] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0278] The path selection device in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0279] An embodiment of the present invention further provides a computer device having the above-mentioned path selection device.

[0280] See also Figure 6 , Figure 6 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0281] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0282] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.

[0283] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0284] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0285] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The bus connection is taken as an example.

[0286] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device. Examples include a touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, etc. The output device 40 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibration motors). Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, monitors, and plasma displays. In some optional embodiments, the display device may be a touch screen.

[0287] The computer device further includes a communication interface for the computer device to communicate with other devices or a communication network.

[0288] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0289] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.

[0290] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A path selection method, characterized in that: The method comprises: Obtaining a block address, and determining a target block corresponding to the block address from a plurality of blocks according to the block address; wherein the target block stores a plurality of path sets; Creating multiple blocks of path devices; wherein each block of the path device is provided with a preset path, and each block has the same number of preset paths; Repeating the search operation of the first path set for the target block until the number of repetitions is equal to the total number of preset paths to determine the first path set, and performing the search operation of the first path set for the target block, including: Obtain the optimal identifier of the target block and determine the identifier of the pending path targeted by the current search operation; When the identifier of the pending path is different from the optimal identifier of the target block, determining the identifier of the pending path for the next search operation; When the identifier of the pending path is the same as the optimal identifier of the target block, the pending path is determined as the first path set; the target block is any one of the multiple blocks; When a first available path exists in the first path set in the target block, traverse the first available paths in the first path set, and determine a first target path with a minimum performance indicator from the first available paths; wherein the first path set is a path set with the highest priority in the target block, and the performance indicator indicates a transmission efficiency corresponding to the path; According to the first target path, an input and output path is selected.

2. The path selection method according to claim 1, wherein: The target block further stores a second path set, wherein the priority of the second path set is lower than the priority of the first path set; And the method further comprises: When the first available path does not exist in the first path set, traversing the second available paths in the second path set, and determining a second target path from the second available paths; wherein the second target path is the path with the smallest performance indicator among the second available paths; According to the second target path, an input and output path is selected.

3. The path selection method according to claim 1, wherein: The determining of the first target path with the minimum performance indicator from the first available paths includes: determining a performance indicator of an initial path among the first available paths; A first target path is determined from the first available paths according to the performance indicator of the initial path; wherein the initial path is the path with the smallest flag bit among the first available paths.

4. The path selection method according to claim 3, wherein: The determining a first target path from the first available paths according to the performance indicator of the initial path includes: Determine performance indicators of other paths in the first available path except the initial path respectively; When there is a first path to be screened among the other paths, a set to be screened is constructed based on the first path to be screened; wherein the first path to be screened is a path whose performance index is smaller than the performance index of the initial path; A second path to be screened having the smallest performance indicator is determined from the first paths to be screened, and the second path to be screened is determined as the first target path.

5. The path selection method according to claim 4, characterized in that: The method further comprises: When the first path to be screened does not exist in the other paths and a third path to be screened exists, the third path to be screened and the initial path are determined as the first target path; wherein the third path to be screened is a path whose performance index is equal to that of the initial path.

6. The path selection method according to claim 4, characterized in that: The method further comprises: When all other paths are fourth paths to be screened, the initial path is determined as the first target path; wherein the fourth path to be screened is a path whose performance index is greater than the performance index of the initial path.

7. The path selection method according to any one of claims 1 to 6, characterized in that: The selecting of the input and output paths according to the first target path includes: When there are multiple first target paths, any one path is selected from the multiple first target paths, and the selected one path from the first target paths is used as an input and output path.

8. The path selection method according to claim 1, wherein: Determining the identifier of the pending path targeted by the current search operation includes: Determine whether the pending path targeted by the current search operation is a valid path; If the pending path targeted by the current search operation is a valid path, an identifier of the pending path targeted by the current search operation is determined.

9. The path selection method according to claim 2, wherein: The method further comprises: When the identifier of the pending path is different from the optimal identifier of the target block, the pending path targeted by the current search operation is added to the second path set.

10. The path selection method according to claim 8, wherein: The method further comprises: If the pending path targeted by the current search operation is an invalid path, the pending path targeted by the current search operation is added to a third path set of the target block; wherein the third path set is a set constructed by invalid paths.

11. The path selection method according to claim 10, characterized in that: The method further comprises: Traversing each of the plurality of blocks to determine a target path set of the block where a second target path is located; wherein the target path set is one of the first path set and the second path set, and the second target path is a path where a fault occurs; The second target path is removed from the target path set, and the second target path is added to a third path set corresponding to the block.

12. The path selection method according to claim 11, characterized in that: The method further comprises: Obtaining a unique identifier for the second target path; When there are multiple path devices, traverse each of the multiple path devices and determine a third target path from each path device respectively; wherein the third target path is the path with the unique identifier; For a target path device, determining a target path set to which a third target path of the target path device belongs, removing the third target path from the target path set to which the third target path belongs, and adding the third target path to a third path set; wherein the target path device is any one of the plurality of path devices.

13. The path selection method according to claim 11, wherein: The method further comprises: When a fourth target path exists in the third path set, obtaining an identifier of the fourth target path; wherein the fourth target path is a valid path in the third path set; When the identifier of the fourth target path is the same as the optimal identifier of the target block, adding the fourth target path to the first path set; When the identifier of the fourth target path is different from the optimal identifier of the target block, the fourth target path is added to the second path set.

14. The path selection method according to claim 13, wherein: The method further comprises: A link failure flag corresponding to the fourth target path is obtained, and the link failure flag corresponding to the fourth target path is deleted; wherein the link failure flag indicates that a fault exists in the link where the fourth target path is located.

15. The path selection method according to claim 2, wherein: The selecting of the input and output paths according to the second target path includes: When the number of the second target paths is greater than a number threshold, selecting any one path from the plurality of second target paths, and using the selected one path from the second target paths as an input and output path; When the number of the second target paths is not greater than a number threshold, the second target paths are used as input and output paths.

16. A path selection device, characterized in that: The path selection device includes: an acquisition module, configured to acquire a block address and determine a target block corresponding to the block address from a plurality of blocks according to the block address; wherein the target block stores a plurality of path sets; A creation module is configured to create multiple blocks of a path device; wherein each block of the path device is provided with a preset path, and each block has the same number of preset paths; a repeated search module is configured to repeatedly perform a search operation on a first path set of a target block until the number of repeated executions equals the total number of preset paths, so as to determine a first path set, and perform the search operation on the first path set of the target block, including: obtaining an optimal identifier of the target block, and determining an identifier of a pending path targeted by a current search operation; when the identifier of the pending path is different from the optimal identifier of the target block, determining an identifier of the pending path targeted by a next search operation; when the identifier of the pending path is the same as the optimal identifier of the target block, determining the pending path as the first path set; the target block is any one of the multiple blocks; a traversal determination module, configured to, when a first available path exists in a first path set in the target block, traverse the first available paths in the first path set, and determine a first target path having a minimum performance indicator from the first available paths; wherein the first path set is a path set with the highest priority in the target block, and the performance indicator indicates a transmission efficiency corresponding to the path; The first selection module is used to select an input and output path according to the first target path.

17. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the path selection method according to any one of claims 1 to 15 by executing the computer instructions.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the path selection method according to any one of claims 1 to 15.

19. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the path selection method according to any one of claims 1 to 15.