Path selection method and device, equipment and storage medium
Through the multi-dimensional path health evaluation model and dynamic weight adjustment, the problem of single path evaluation and lagging failure response in the existing technology is solved, flexible and efficient path selection and traffic allocation are achieved, and the stability and performance of the system are improved.
Patent Information
- Application Number
- CN202510491233.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-25
AI Technical Summary
The existing multipath software path selection method relies on a single performance indicator, resulting in incomplete path evaluation, rigid routing strategies, inability to dynamically adjust, and lagging fault responses, affecting system performance and stability.
By introducing multiple evaluation dimensions, the path health evaluation model is built, the path status is monitored in real time, the evaluation weight is dynamically adjusted, and the traffic allocation ratio is generated based on the path health, so as to achieve flexible and efficient path selection and traffic allocation.
It improves the accuracy of path selection and system stability, reduces fault response time, optimizes traffic allocation, and improves the system's load balancing and fault detection capabilities.
Smart Images

Figure CN120378365A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of path selection, and particularly to a path selection method, apparatus, device, and storage medium. Background Art
[0002] With the acceleration of the enterprise informatization process, the scale of data centers and distributed systems has been continuously expanding, posing higher requirements for the efficiency and reliability of data transmission and storage. Based on this, multipath software has begun to be widely used in storage systems. It can send IO requests through multiple paths, and each path corresponds to a path device (such as a disk) in the host. The multipath software can automatically aggregate these path devices to form a multipath device for path management, load balancing, and fault switching and recovery, thereby increasing the throughput of data transmission and the reliability of the system. However, although multipath software has played an important role in improving system throughput and fault tolerance, it has also posed challenges to path selection and management methods.
[0003] The current path selection methods of multipath software mainly rely on some static algorithms, such as the round-robin algorithm, failover algorithm, loadbalance algorithm, and minimum queue depth algorithm, etc. Although these methods can ensure system load balancing and fault recovery to a certain extent, they also have significant disadvantages. First, path state evaluation is usually based on a single performance metric (such as latency, error count, or queue depth), which cannot comprehensively reflect the health status of the path and may lead to the inability to effectively identify the best path in some cases, thus affecting the overall performance. Second, the existing path selection algorithms are mostly statically set and cannot dynamically adjust the routing strategy according to the real-time path health status, resulting in insufficient flexibility in path selection and the inability to optimize the IO processing speed. Finally, path fault response is lagged, and fault switching usually relies on post-event detection. After a path problem occurs, switching will only be carried out, which may lead to a long period of service interruption, especially having a greater impact in scenarios with high throughput and low latency requirements. Summary of the Invention
[0004] This application provides a path selection method that can monitor the path health status in real time, comprehensively consider multiple performance metrics, and adjust the evaluation weight in a timely manner when a path mutation occurs, so as to achieve more efficient and flexible path selection and traffic allocation, and at least solve the problems of single path evaluation, rigid routing strategy, and lagged fault response in the related art.
[0005] This application provides a path selection method, including:
[0006] Based on a preset evaluation index dimension, obtain the operation data of multiple paths at the first moment to obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter;
[0007] Construct a first path health evaluation model according to the evaluation index dimension and the first evaluation weight;
[0008] Obtain the operation data of the multiple paths at the second moment to obtain a second evaluation parameter;
[0009] Judge whether data mutation occurs in the multiple paths according to the difference between the second evaluation parameter and the first evaluation parameter;
[0010] In response, update the first evaluation weight to form a second evaluation weight, construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and evaluate the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively;
[0011] In response to no, evaluate the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively;
[0012] Generate a traffic allocation ratio according to the path health of the multiple paths, and allocate read and write traffic according to the traffic ratio corresponding to the multiple paths.
[0013] This application also provides a path selection device, including:
[0014] A first parameter and weight generation module, configured to obtain the operation data of multiple paths at the first moment based on a preset evaluation index dimension, obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter;
[0015] A first model establishment module, configured to construct a first path health evaluation model according to the evaluation index dimension and the first evaluation weight;
[0016] A second parameter generation module, configured to obtain the operation data of the multiple paths at the second moment to obtain a second evaluation parameter;
[0017] A data mutation judgment module, configured to judge whether data mutation occurs in the multiple paths according to the difference between the second evaluation parameter and the first evaluation parameter;
[0018] The second model establishment and evaluation module is used to respond to the update of the first evaluation weight to form a second evaluation weight, construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and evaluate the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively;
[0019] The first evaluation module is used to evaluate the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively;
[0020] The traffic allocation module is used to generate a traffic allocation ratio according to the path health of the multiple paths and allocate read and write traffic according to the traffic ratio corresponding to the multiple paths.
[0021] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above path selection methods when executing the computer program.
[0022] This application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above path selection methods are implemented.
[0023] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of any of the above path selection methods are implemented.
[0024] Through this application, due to the introduction of multiple evaluation dimensions and the construction of a path health evaluation model, it is possible to obtain path operation data in real time to calculate the path health, so as to comprehensively and accurately evaluate the path status; at the same time, by judging whether there is a data mutation before and after the path, the weight is updated, so as to improve the accuracy and applicability of the path health evaluation model and the accuracy of path selection; moreover, according to the path health, a traffic allocation ratio is generated and the traffic is allocated correspondingly, which can improve the rationality of traffic allocation, enhance the stability of the system, and is conducive to achieving the load balance of the path; in addition, the path health calculated can reflect the path status in real time, which is conducive to realizing subsequent rapid and timely fault detection and path isolation; therefore, the problems of single path evaluation, rigid routing strategy and lagging fault response in the related technology can be solved, and flexible and efficient path selection and traffic allocation can be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0026] Figure 1 Schematic diagram of the application environment of a path selection method provided by an embodiment of the present application;
[0027] Figure 2 Flowchart of a path selection method provided by an embodiment of the present application;
[0028] Figure 3 Flowchart of a path selection step provided by an embodiment of the present application;
[0029] Figure 4 Block diagram of the structure of a path selection device provided by an embodiment of the present application;
[0030] Figure 5 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0031] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0032] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0033] To enable those skilled in the art of the present technology to better understand the solution of the present application, the following will further describe the present application in detail in conjunction with the accompanying drawings and specific implementation manners.
[0034] A path selection method provided by the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 101 communicates with the server 102 through a wireless network, and the server 102 is connected to a multi-path device 103. The server 101 receives read / write traffic from the terminal 101, calculates the path health of multiple paths in the current multi-path device 103 based on the path selection method provided by this application, and distributes the read / write traffic to multiple paths in the multi-path device 103 proportionally. Among them, the terminal 101 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server 102 can be implemented by an independent server or a server cluster composed of multiple servers. The multi-path device 103 can be a disk array, a network attached (NAS) storage device, a multi-path I / O controller, and each storage unit in the multi-path device 103 corresponds to a read / write path.
[0035] As Figure 2 shown, an embodiment of this application provides a path selection method, which is applied to Figure 1 the server side 104 in the application environment shown, and includes the following steps:
[0036] Step 201: Based on a preset evaluation index dimension, obtain the operation data of multiple paths at the first moment to obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter;
[0037] Step 202: Construct a first path health evaluation model according to the evaluation index dimension and the first evaluation weight;
[0038] Step 203: Obtain the operation data of multiple paths at the second moment to obtain a second evaluation parameter;
[0039] Step 204: Judge whether data mutation occurs in the multiple paths according to the difference between the second evaluation parameter and the first evaluation parameter;
[0040] Step 205: In response to yes, update the first evaluation weight to form a second evaluation weight, construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and evaluate the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively;
[0041] Step 206: In response to no, evaluate the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively;
[0042] Step 207: Generate a traffic distribution ratio according to the path health of multiple paths, and distribute read / write traffic according to the traffic ratio corresponding to multiple paths.
[0043] Specifically, a path selection method provided in this embodiment can construct a path health evaluation model by introducing multiple evaluation dimensions, and can obtain path operation data in real time to calculate the path health, so as to comprehensively and accurately evaluate the path status. At the same time, by judging whether data mutation occurs before and after the path, the weight is updated, thereby improving the accuracy and applicability of the path health evaluation model and the accuracy of path selection. And, according to the path health, a traffic allocation ratio is generated and traffic is allocated correspondingly, which can improve the rationality of traffic allocation, enhance the stability of the system, and is conducive to realizing the load balancing of the path. In addition, the path health calculated can reflect the path status in real time, which is conducive to realizing subsequent fast and timely fault detection and path isolation, solving the problems of single path evaluation, rigid routing strategy and lagging fault response in the related art, and realizing flexible and efficient path selection and traffic allocation.
[0044] In one embodiment, based on a preset evaluation index dimension, the operation data of multiple paths at the first moment is obtained to obtain a first evaluation parameter, including:
[0045] The set evaluation index dimension includes the average read and write delay, the read and write correct rate, the path queue depth ratio, and the main total adapter temperature;
[0046] Based on a preset sample collection window, the operation data of multiple paths at the first moment is extracted to obtain the read and write request processing duration, the read and write request queue length, the number of processed read and write requests, the number of unprocessed read and write requests, and the first main total adapter temperature of multiple paths;
[0047] According to the read and write request processing duration at the first moment, the average value is calculated to obtain the first average read and write delay;
[0048] Analyze the number of processed read and write requests at the first moment to obtain the number of successes, and calculate the ratio of the number of successes to the number of processed read and write requests to obtain the first read and write correct rate;
[0049] Calculate the ratio of the number of unprocessed write requests to the read and write request queue length at the first moment to obtain the first path queue depth ratio;
[0050] Group the first average read and write delay, the first read and write correct rate, the first path queue depth ratio, and the first main total adapter temperature according to multiple paths to obtain the first evaluation parameter.
[0051] Specifically, in this embodiment, by introducing multi-dimensional evaluation indexes, the operation conditions of each path are comprehensively and accurately reflected, avoiding misjudgment problems caused by relying only on a single performance index, ensuring that path selection decisions are based on comprehensive and detailed evaluation parameters, thereby improving the accuracy and reliability of path selection, and maximizing the avoidance of performance bottlenecks or system failures caused by improper path selection.
[0052] In one embodiment, generating a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter includes:
[0053] Based on the minimum-maximum normalization method, normalize the first evaluation parameter to obtain a normalized first evaluation parameter;
[0054] According to the normalized first evaluation parameter, calculate the standard deviations of the first read / write average latency, the first read / write correct rate, the first path queue depth, and the first main total adapter temperature respectively to obtain the first evaluation parameter standard deviation;
[0055] According to the first evaluation parameter standard deviation, obtain the first evaluation weight under the evaluation index dimension, where the obtaining of the first evaluation weight under the evaluation index dimension is based on the following formula:
[0056]
[0057] where W j represents the first evaluation weight under the j-th evaluation index dimension, and σ j represents the first evaluation parameter standard deviation under the j-th evaluation index dimension, represents the sum of the first evaluation parameter standards under all evaluation index dimensions.
[0058] Specifically, in this embodiment, the evaluation parameter is standardized by the minimum-maximum normalization method. This method eliminates the deviation caused by different dimensions between different evaluation indexes, thereby enhancing the comparability of each index; combined with the calculation of the standard deviation, it can dynamically measure the amplitude of the path performance fluctuation, ensure the scientificity and accuracy of the evaluation weight, effectively improve the accuracy of the path health evaluation, and thus optimize the decision-making quality of path selection, providing more accurate data support for traffic allocation and fault recovery.
[0059] In one embodiment, in response to this, update the first evaluation weight to form a second evaluation weight, and construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, including:
[0060] Based on the evaluation index dimension, analyze the operation data of multiple paths at the second moment to obtain a second evaluation parameter, where the second evaluation parameter includes the second read / write average latency, the second read / write correct rate, the second path queue depth, and the second main total adapter temperature;
[0061] According to the second evaluation parameter and the first evaluation parameter, calculate the evaluation parameter difference under the evaluation index dimension respectively, and use the evaluation parameter difference as the evaluation parameter mutation amplitude;
[0062] Obtain the path mutation amplitude of the path according to the mutation amplitude of the evaluation parameter;
[0063] In response to the path mutation amplitude being less than the first mutation threshold, it is determined that no data mutation has occurred on the path, and the first evaluation weight is not updated;
[0064] In response to the path mutation amplitude being greater than the first mutation threshold, it is determined that a data mutation has occurred on the path, and the corresponding second evaluation weight is determined according to the path mutation amplitude;
[0065] Construct a second path health evaluation model according to the second evaluation weight and in combination with the evaluation index dimension;
[0066] Determining the corresponding second evaluation weight according to the path mutation amplitude includes:
[0067] In response to the path mutation amplitude being greater than the first mutation threshold and less than the second mutation threshold, mark the path and increase the mutation cumulative count;
[0068] Obtain the mutation amplitude of the evaluation parameter of the path, determine the mutation evaluation parameter, and in combination with the mutation cumulative count, correct the first evaluation weight under the evaluation index dimension corresponding to the mutation evaluation parameter to generate a corrected weight;
[0069] In response to the path mutation amplitude being greater than the second mutation threshold, discard the first evaluation weight, recalculate the evaluation weight under the evaluation index dimension based on the second evaluation parameter, and obtain a reconstructed weight;
[0070] Select the corrected weight or the reconstructed weight as the second evaluation weight.
[0071] Specifically, in this embodiment, by calculating the change amplitude of the path evaluation parameter, the performance mutation of the path can be identified in real time, and the evaluation weight can be dynamically adjusted, which not only improves the response speed to path emergencies, but also effectively avoids service interruptions caused by lagging fault switching in traditional path selection methods; in addition, by updating the evaluation weight in real time, the best path can be selected more accurately, ensuring the efficient operation of the system, and quickly switching when the path has problems, reducing performance loss.
[0072] It should be noted that in a preferred embodiment, according to the difference between the second evaluation parameter and the first evaluation parameter, it is determined whether data mutation has occurred in multiple paths, including:
[0073] Compared with the first moment, at the second moment, calculate the mutation amplitude of the evaluation parameter to obtain the mutation amplitude of the read-write average delay, the mutation amplitude of the read-write correct rate, the mutation amplitude of the path queue depth, and the mutation amplitude of the main total adapter temperature, where the time interval between the first moment and the second moment is preferably 1-2 minutes;
[0074] The path mutation amplitude is calculated by the following formula:
[0075]
[0076] where Δd is the mutation amplitude of the read / write average delay, Δa is the mutation amplitude of the read / write correct rate, Δt is the mutation amplitude of the main total adapter temperature, and Δq is the mutation amplitude of the path queue depth ratio;
[0077] According to the path mutation amplitude, the corresponding second evaluation weight is determined, including:
[0078] In response to the path mutation amplitude being greater than the first mutation threshold and less than the second mutation threshold, preferably, 20 < mutation ≤ 60, the path is marked and the mutation accumulation count is increased.
[0079] In one embodiment, modifying the first evaluation weight in the evaluation index dimension corresponding to the mutation evaluation parameter to generate a modified weight includes:
[0080] In response to the mutation accumulation count being less than the path mutation upper limit, according to the mutation amplitude of the evaluation parameter of the path and the parameter mutation count corresponding to the evaluation index dimension, the weight correction factors corresponding to the evaluation index dimension are respectively generated, and the first evaluation weight is corrected by the weight correction factors.
[0081] In one embodiment, correcting the first evaluation weight by the weight correction factor further includes:
[0082] According to the mutation amplitude of the evaluation parameter of the path and the parameter mutation count corresponding to the evaluation index dimension, the weight correction factors corresponding to the evaluation index dimension are respectively generated through the weight correction factor formula, where the weight correction factor is:
[0083]
[0084] where μ j is the weight correction factor under the j-th evaluation index dimension, α j is the reference weight correction factor under the j-th evaluation index dimension, preferably 1, β j is the growth adjustment factor under the j-th evaluation index dimension for controlling the growth of the weight correction factor, preferably 0.1 - 0.5, γ j is the growth constant under the j-th evaluation index dimension for controlling the rate of exponential growth, preferably 0.05 - 0.2, C j is the parameter mutation count under the j-th evaluation index dimension, δ j is the mutation amplitude adjustment factor of the j-th evaluation index, preferably 0.05 - 0.1, ΔP jis the mutation amplitude of the evaluation parameter under the j-th evaluation index dimension;
[0085] According to the weight correction factor, the first evaluation weight is corrected through the following formula to obtain the corrected weight:
[0086]
[0087] wherein, is the corrected weight under the j-th evaluation index dimension, and W j is the first evaluation weight under the j-th evaluation index dimension.
[0088] It should be noted that the cumulative number of mutations is the sum of the parameter mutation times under all evaluation index dimensions in a path, and there is an overall upper limit, that is, the path mutation upper limit, preferably 3-5; the value of the weight correction factor corresponding to the first evaluation weight under any evaluation index dimension is also set with a correction deviation upper limit to avoid excessive correction of the weight, preferably not exceeding 0.5; if either the path mutation upper limit or the correction deviation upper limit reaches or the overall mutation amplitude of the path is greater than the second mutation threshold, the correction of the first evaluation weight is abandoned, and the second evaluation parameter is used as the input, and the above calculation steps of the first evaluation weight are repeated to obtain the reconstructed weight as the second evaluation weight.
[0089] Specifically, in this embodiment, based on the mutation amplitude and the number of mutations, the first evaluation weights under different evaluation index dimensions can be corrected dynamically, quickly, and efficiently in a targeted manner, improving the efficiency of subsequent path health calculation for multiple paths, and also improving the accuracy and reliability of the calculated path health. Especially when facing a complex network cluster with a large number of paths, it can greatly save the time and resources required for repeated weight calculation and improve the efficiency and accuracy of path selection.
[0090] In one embodiment, generating the weight correction factors corresponding to the evaluation index dimensions respectively further includes:
[0091] According to the characteristics of the evaluation index dimensions, several control factors in the weight correction factor formula are respectively adjusted to generate amplitude-sensitive correction formulas or number-sensitive correction formulas corresponding to different evaluation index dimensions, where the several control factors at least include one of the following: growth adjustment factor, growth constant, mutation amplitude adjustment factor;
[0092] Through the amplitude-sensitive correction formula or the number-sensitive formula, the weight correction factor of the first evaluation weight under the corresponding evaluation index dimension is calculated to obtain the corresponding corrected weight;
[0093] Optionally, the average read / write latency directly affects the system response speed and user experience, with relatively obvious changes and a large number of mutations. Therefore, it is necessary to pay more attention to data mutations with a large mutation amplitude and adaptively adjust the formula of the weight correction factor to be amplitude-sensitive. Among them, the growth adjustment factor of the average read / write latency is preferably 0.1, the growth constant is preferably 0.15, and the mutation amplitude adjustment factor is preferably 0.08;
[0094] The read / write accuracy rate is related to the stability and data accuracy of the system. However, the fluctuation amplitude is usually not too large, and the number of mutations needs to be more concerned. Frequent fluctuations in the accuracy rate may mean potential system errors. Therefore, the formula of the weight correction factor is adaptively adjusted to be sensitive to the number of times. Among them, the growth adjustment factor of the read / write accuracy rate is preferably 0.2, the growth constant is preferably 0.1, and the mutation amplitude adjustment factor is preferably 0.05;
[0095] The proportion of the path queue depth usually changes relatively slowly, reflecting the load situation in the system. Its impact on performance is mainly reflected in network congestion and response time. The system does not need to make too drastic a reaction to the fluctuations in the queue depth. Frequent changes in the proportion of the queue depth may indicate uneven or blocked path loads. Therefore, it is necessary to pay more attention to the number of mutations and adjust the formula of the weight correction factor to be sensitive to the number of times. Among them, the growth adjustment factor of the proportion of the path queue depth is preferably 0.4, the growth constant is preferably 0.05, and the mutation amplitude adjustment factor is preferably 0.02;
[0096] The temperature of the main general adapter changes relatively frequently, and a large change in temperature will directly affect the performance and stability of the hardware. Therefore, it is necessary to pay more attention to the mutation amplitude and adjust the formula of the weight correction factor to be amplitude-sensitive. Among them, the growth adjustment factor of the temperature of the main general adapter is preferably 0.3, the growth constant is preferably 0.05, and the mutation amplitude adjustment factor is preferably 0.01;
[0097] Specifically, by adjusting the formula of the weight correction factor according to the focus of the evaluation index dimension, the correction of the first evaluation weight under different evaluation index dimensions can be made more accurate, ensuring that the system can make a sensitive and appropriate response according to the characteristics of each evaluation index dimension, avoiding overcorrection, so that the subsequent generated path health degree can more conform to the state of the path itself.
[0098] In one embodiment, in response to no, the path health degrees of the multiple paths are respectively evaluated through the first path health degree evaluation model and the second evaluation parameter, including:
[0099] If there is no data mutation in the multiple paths, based on the first path health degree evaluation model, obtain the second evaluation parameter of the multiple paths, and calculate the path health degrees of the multiple paths through the following formula:
[0100] H i = W D *(1 - D i ) + W A *A i + W T *(1 - T i ) + W Q *(1 - Q i )
[0101] Among them, H i represents the path health of the i-th path, D i represents the second read / write average latency of the i-th path, A i represents the second read / write correct rate of the i-th path, T i represents the second main total adapter temperature of the i-th path, Q i represents the second path queue depth ratio of the i-th path, W D is the first evaluation weight under the read / write average latency, W A is the first evaluation weight under the read / write correct rate, W T is the first evaluation weight under the main total adapter temperature, W Q is the first evaluation weight under the path queue depth ratio;
[0102] Evaluating the path health of the multiple paths through the second path health evaluation model and the second evaluation parameters respectively includes:
[0103] In response to data mutation occurring in a path among the multiple paths, based on the second path health evaluation model, obtain the second evaluation parameters of the multiple paths, and calculate the path health of the multiple paths through the following formula:
[0104] H i = W' D *(1 - D i ) + W' A *A i + W' T *(1 - T i ) + W' Q *(1 - Q i )
[0105] Among them, W' D is the second evaluation weight under the read / write average latency, W' A is the second evaluation weight under the read / write correct rate, W' T is the second evaluation weight under the main total adapter temperature, W' Q is the second evaluation weight under the path queue depth ratio.
[0106] Specifically, in this embodiment, by dynamically adjusting the path health assessment model, the path health status is flexibly evaluated based on real-time operation data and path mutation amplitude. Compared with the traditional static assessment model, it can be adjusted according to the real-time changes of path performance, ensuring that the path selection decision is based on the latest path health status, improving the accuracy of path selection, maximizing the system performance and reliability, and effectively avoiding performance degradation caused by lagging path selection.
[0107] In one embodiment, as Figure 3 shown, generating a traffic allocation ratio according to the path health of multiple paths and allocating read / write traffic according to the traffic ratios corresponding to the multiple paths includes:
[0108] Step 301, obtaining the highest path health based on the path health of multiple paths;
[0109] Step 302, in response to the highest path health being greater than or equal to the first health threshold, allocating all read / write traffic to the first read / write path corresponding to the highest path health;
[0110] Step 303, in response to the highest path health being less than the first health threshold, selecting several paths with path health greater than or equal to the second health threshold from the multiple paths as several second read / write paths, generating a traffic allocation ratio corresponding to the second read / write paths according to the ratio of the path health of the second read / write paths to the sum of the path health of the several second read / write paths, and sequentially allocating the read / write traffic to the several second read / write paths according to the traffic allocation ratio.
[0111] Optionally, the first health threshold is 0.7 and the second health threshold is 0.2.
[0112] Optionally, generating a traffic allocation ratio corresponding to the second read / write paths includes:
[0113] Calculating the traffic allocation ratio corresponding to the second read / write paths through the following formula:
[0114]
[0115] where σ i is the traffic allocation ratio of the i-th second read / write path, is the path health of the i-th second read / write path, is the sum of the path health of the several second read / write paths, and n is the number of paths greater than or equal to the second health threshold, that is, the number of second read / write paths.
[0116] Specifically, in this embodiment, the traffic distribution ratio is adjusted in real time according to the path health to ensure that the traffic is preferentially distributed to the path with high health, thereby optimizing the resource utilization of the system; at the same time, when there is a path with sufficiently high path health, all read and write traffic is allocated to the path until the next path health evaluation cycle, and when the system only has a few paths with average path health, the read and write traffic is processed together through multiple paths. The adaptive selection of the two can quickly and efficiently process read and write requests while ensuring the stability of the system, thereby accelerating the system response rate; in addition, by setting the health threshold, the system can dynamically switch traffic when the path health is low, avoiding the overload problem of low-health paths, thereby improving the system throughput, while reducing the risks caused by path failures or performance degradation, and enhancing the overall stability and reliability of the system.
[0117] In one embodiment, the method further comprises:
[0118] Periodically obtain the operation data of multiple paths and update the path health of multiple paths;
[0119] Based on the updated path health, update the first read / write path, or update several second read / write paths and corresponding traffic distribution ratios;
[0120] In response to the presence of a risk path whose path health is less than a second health threshold, isolating the risk path;
[0121] Through the path detection thread, the risk path is continuously detected several times. In response to the feedback results of the continuous detection being normal, the path health of the risk path is recalculated. If the path health of the risk path is greater than or equal to the second health threshold, the risk path is released from isolation.
[0122] Specifically, this embodiment periodically updates the health of the path and dynamically adjusts the path selection. This method ensures that the path selection decision is based on the latest system status, avoiding performance problems caused by outdated path health status. At the same time, for paths with low health, the system can quickly identify and isolate them, and ensure the accuracy of the path status through continuous detection. Once the path returns to normal, the system can automatically release the isolation and put it back into use, thereby effectively improving the fault tolerance and reliability of the system, and significantly enhancing the system's dynamic adaptability and fault recovery capabilities.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0124] An embodiment of the present application further provides a path selection device, as Figure 4 shown, including: a first parameter and weight generation module, a first model establishment module, a second parameter generation module, a data mutation judgment module, a second model establishment and evaluation module, a first evaluation module, and a traffic allocation module, where
[0125] The first parameter and weight generation module is configured to obtain the operation data of multiple paths at the first moment based on a preset evaluation index dimension, obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter;
[0126] The first model establishment module is configured to construct a first path health evaluation model according to the evaluation index dimension and the first evaluation weight;
[0127] The second parameter generation module is configured to obtain the operation data of the multiple paths at the second moment to obtain a second evaluation parameter;
[0128] The data mutation judgment module is configured to judge whether data mutation occurs in the multiple paths according to the difference between the second evaluation parameter and the first evaluation parameter;
[0129] The second model establishment and evaluation module is configured to respond to update the first evaluation weight to form a second evaluation weight, construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and evaluate the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively;
[0130] The first evaluation module is configured to evaluate the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively;
[0131] The traffic allocation module is configured to generate a traffic allocation ratio according to the path health of the multiple paths, and allocate read and write traffic according to the traffic ratio corresponding to the multiple paths.
[0132] The first parameter and weight generation module is further configured to set the evaluation metric dimensions including read-write average latency, read-write correct rate, path queue depth ratio, and main total adapter temperature; based on a preset sample collection window, extract the operation data of multiple paths at the first moment, and obtain the read-write request processing duration, read-write request queue length, number of processed read-write requests, number of unprocessed read-write requests, and first main total adapter temperature of multiple paths; calculate the average value according to the read-write request processing duration at the first moment to obtain the first read-write average latency; parse the number of processed read-write requests at the first moment to obtain the number of successes, and calculate the ratio of the number of successes to the number of processed read-write requests to obtain the first read-write correct rate; calculate the ratio of the number of unprocessed multi-write requests to the read-write request queue length at the first moment to obtain the first path queue depth ratio; group the first read-write average latency, the first read-write correct rate, the first path queue depth ratio, and the first main total adapter temperature corresponding to multiple paths to obtain the first evaluation parameter.
[0133] The first parameter and weight generation module is further configured to normalize the first evaluation parameter based on the minimum-maximum normalization method to obtain the normalized first evaluation parameter; calculate the standard deviations of the first read-write average latency, the first read-write correct rate, the first path queue depth, and the first main total adapter temperature respectively according to the normalized first evaluation parameter to obtain the first evaluation parameter standard deviation; obtain the first evaluation weight under the evaluation metric dimension according to the first evaluation parameter standard deviation.
[0134] The second parameter generation module is further configured to parse the operation data of multiple paths at the second moment based on the evaluation metric dimension to obtain the second evaluation parameter, and the second evaluation parameter includes the second read-write average latency, the second read-write correct rate, the second path queue depth, and the second main total adapter temperature.
[0135] The second model building module is further configured to calculate, according to the second evaluation parameter and the first evaluation parameter, the difference of the evaluation parameters under the evaluation index dimension respectively, and use the difference of the evaluation parameters as the mutation amplitude of the evaluation parameters. The mutation amplitude of the evaluation parameters includes: the mutation amplitude of the average read / write delay, the mutation amplitude of the read / write correct rate, the mutation amplitude of the path queue depth, and the mutation amplitude of the main total adapter temperature; obtain the path mutation amplitude of the path according to the mutation amplitude of the evaluation parameters; in response to the path mutation amplitude being less than the first mutation threshold, determine that no data mutation occurs in the path and do not update the first evaluation weight; in response to the path mutation amplitude being greater than the first mutation threshold, determine that data mutation occurs in the path, and determine the corresponding second evaluation weight according to the path mutation amplitude; construct a second path health evaluation model according to the second evaluation weight and in combination with the evaluation index dimension; determine the corresponding second evaluation weight according to the path mutation amplitude, including: in response to the path mutation amplitude being greater than the first mutation threshold and less than the second mutation threshold, mark the path and increase the mutation cumulative count; obtain the mutation amplitude of the evaluation parameters of the path, determine the mutation evaluation parameters, and in combination with the mutation cumulative count, correct the first evaluation weight under the evaluation index dimension corresponding to the mutation evaluation parameters to generate a corrected weight; in response to the path mutation amplitude being greater than the second mutation threshold, discard the first evaluation weight, recalculate the evaluation weight under the evaluation index dimension based on the second evaluation parameter to obtain a reconstructed weight; select the corrected weight or the reconstructed weight as the second evaluation weight.
[0136] The first evaluation module is further configured to, in response to no data mutation occurring in any of the multiple paths, obtain the second evaluation parameters of the multiple paths based on the first path health evaluation model, and calculate the path health of the multiple paths.
[0137] The second model building and evaluation is further configured to, in response to data mutation occurring in any of the multiple paths, obtain the second evaluation parameters of the multiple paths based on the second path health evaluation model, and calculate the path health of the multiple paths.
[0138] The traffic allocation module is further configured to obtain the highest path health based on the path health of the multiple paths; in response to the highest path health being greater than or equal to the first health threshold, allocate all the read / write traffic to the first read / write path corresponding to the highest path health; in response to the highest path health being less than the first health threshold, select several paths with path health greater than or equal to the second health threshold from the multiple paths as several second read / write paths, generate a traffic allocation ratio corresponding to the second read / write path according to the ratio of the path health of the second read / write path to the sum of the path health of the several second read / write paths, and allocate the read / write traffic to the several second read / write paths in sequence according to the traffic allocation ratio.
[0139] The traffic distribution module is also used to periodically obtain the operation data of multiple paths and update the path health of multiple paths; based on the updated path health, update the first read-write path, or update several second read-write paths and the corresponding traffic distribution ratio; in response to the existence of a risk path whose path health is less than a second health threshold, isolate the risk path; through the path detection thread, perform several consecutive detections on the risk path, and in response to the feedback results of the continuous detection being normal, recalculate the path health of the risk path, and if the path health of the risk path is greater than or equal to the second health threshold, the risk path is released from isolation.
[0140] The description of the features in the embodiment corresponding to the path selection device can refer to the relevant description of the embodiment corresponding to the path selection method, which will not be repeated here.
[0141] like Figure 5 As shown, an embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned path selection method embodiments.
[0142] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above-mentioned path selection method embodiments when running.
[0143] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0144] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above-mentioned path selection method embodiments are implemented.
[0145] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned path selection method embodiments are implemented.
[0146] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0147] The above has introduced in detail a path selection method, device, equipment, and storage medium provided by this application. Specific examples have been used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A path selection method, characterized in that, Including: Based on a preset evaluation index dimension, obtain the operation data of multiple paths at a first moment, obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter; Construct a first path health evaluation model according to the evaluation index dimension and the first evaluation weight; Obtain the operation data of the multiple paths at a second moment, and obtain a second evaluation parameter; Judge whether data mutation occurs in the multiple paths according to the difference between the second evaluation parameter and the first evaluation parameter; In response, update the first evaluation weight to form a second evaluation weight, construct a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and evaluate the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively; In response to no, evaluate the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively; Generate a traffic allocation ratio according to the path health of the multiple paths, and allocate read and write traffic according to the traffic ratio corresponding to the multiple paths.
2. The path selection method according to claim 1, wherein The obtaining the operation data of multiple paths at a first moment and obtaining a first evaluation parameter based on a preset evaluation index dimension includes: Set that the evaluation index dimension includes at least one of the following: read-write average delay, read-write correct rate, path queue depth ratio, main total adapter temperature; Based on a preset sample collection window, extract the operation data of multiple paths at the first moment, and obtain the read-write request processing duration, read-write request queue length, number of processed read-write requests, number of unprocessed read-write requests, and first main total adapter temperature of the multiple paths; Calculate the average value according to the read-write request processing duration at the first moment to obtain a first read-write average delay; Parse the number of processed read-write requests at the first moment to obtain the number of successes, and calculate the ratio of the number of successes to the number of processed read-write requests to obtain a first read-write correct rate; Calculate the ratio of the number of unprocessed write requests to the read-write request queue length at the first moment to obtain a first path queue depth ratio; Group the first read-write average delay, the first read-write correct rate, the first path queue depth ratio, and the first main total adapter temperature according to the multiple paths to obtain the first evaluation parameter.
3. A path selection method according to claim 1, wherein The updating the first evaluation weight to form a second evaluation weight and constructing a second path health evaluation model according to the second evaluation weight and the evaluation index dimension in response includes: Based on the evaluation index dimension, parse the operation data of the multiple paths at the second moment to obtain the second evaluation parameter; According to the second evaluation parameter and the first evaluation parameter, calculate the evaluation parameter difference under the evaluation index dimension respectively, and use the evaluation parameter difference as the evaluation parameter mutation amplitude; Obtain the path mutation amplitude of the path according to the evaluation parameter mutation amplitude; In response to the path mutation amplitude being less than the first mutation threshold, it is determined that no data mutation has occurred in the path, and the first evaluation weight is not updated; In response to the path mutation amplitude being greater than the first mutation threshold, it is determined that a data mutation has occurred in the path, and a corresponding second evaluation weight is determined according to the path mutation amplitude; According to the second evaluation weight and in combination with the evaluation index dimension, the second path health evaluation model is constructed; The determining the corresponding second evaluation weight according to the path mutation amplitude includes: In response to the path mutation amplitude being greater than the first mutation threshold and less than the second mutation threshold, the path is marked and the mutation cumulative count is increased; Obtain the evaluation parameter mutation amplitude of the path, determine the mutation evaluation parameter, and in combination with the mutation cumulative count, correct the first evaluation weight under the evaluation index dimension corresponding to the mutation evaluation parameter to generate a corrected weight; In response to the path mutation amplitude being greater than the second mutation threshold, discard the first evaluation weight, and recalculate the evaluation weight under the evaluation index dimension based on the second evaluation parameter to obtain a reconstructed weight; Select the corrected weight or the reconstructed weight as the second evaluation weight.
4. A path selection method according to claim 3, characterized in that, The correcting the first evaluation weight under the evaluation index dimension corresponding to the mutation evaluation parameter to generate a corrected weight includes: In response to the mutation cumulative count being less than the path mutation upper limit, weight correction factors corresponding to the evaluation index dimension are respectively generated according to the evaluation parameter mutation amplitude of the path and the parameter mutation count corresponding to the evaluation index dimension, and the first evaluation weight is corrected by the weight correction factor.
5. A path selection method according to claim 3, characterized in that The evaluating the path health of the multiple paths through the first path health evaluation model and the second evaluation parameter respectively in response to no includes: In response to no path in the multiple paths having a data mutation, based on the first path health evaluation model, obtain the second evaluation parameter of the multiple paths, and calculate the path health of the multiple paths through the following formula: H i = W D *(1 - D i ) + W A * A i + W T *(1 - T i ) + W Q *(1 - Q i ) Among them, H i represents the path health of the i-th path, D i represents the second read / write average latency of the i-th path, A i represents the second read / write correct rate of the i-th path, T i represents the second main total adapter temperature of the i-th path, Q i represents the proportion of the second path queue depth of the i-th path, W D is the first evaluation weight under the read / write average latency, W A is the first evaluation weight under the read / write correct rate, W T is the first evaluation weight under the main total adapter temperature, W Q is the first evaluation weight under the path queue depth proportion; The evaluating the path health of the multiple paths through the second path health evaluation model and the second evaluation parameter respectively includes: In response to there being a path in the multiple paths having a data mutation, based on the second path health evaluation model, obtain the second evaluation parameter of the multiple paths, and calculate the path health of the multiple paths through the following formula: H i = W′ D *(1 - D i ) + W′ A *A i + W′ T *(1 - T i ) + W′ Q *(1 - Q i ) Among them, W' D is the second evaluation weight under the read-write average latency, W' A is the second evaluation weight under the read-write correct rate, W' T is the second evaluation weight under the main total adapter temperature, W' Q is the second evaluation weight under the path queue depth ratio.
6. A path selection method according to claim 1, characterized in that The generating a traffic allocation ratio according to the path health of the multiple paths and allocating read / write traffic according to the traffic ratio corresponding to the multiple paths includes: Based on the path health of the multiple paths, obtain the highest path health; In response to the highest path health being greater than or equal to the first health threshold, allocate all the read / write traffic to the first read / write path corresponding to the highest path health; In response to the highest path health being less than the first health threshold, several paths whose path health is greater than or equal to the second health threshold are selected from the multiple paths as several second read-write paths, and according to the ratio of the path health of the second read-write path to the sum of the path healths of the several second read-write paths, a traffic distribution ratio corresponding to the second read-write path is generated, and according to the traffic distribution ratio, the read-write traffic is distributed to the several second read-write paths in turn.
7. A path selection method according to claim 6, wherein The method further comprises: Periodically acquiring operation data of the plurality of paths and updating path health of the plurality of paths; Based on the updated path health, updating the first read / write path, or updating the plurality of second read / write paths and corresponding traffic allocation ratios; In response to the existence of a risk path whose path health is less than the second health threshold, isolating the risk path; The risk path is continuously detected several times through the path detection thread. In response to the feedback results of the continuous detection being normal, the path health of the risk path is recalculated. If the path health of the risk path is greater than or equal to the second health threshold, the risk path is released from isolation.
8. A path selection device, characterized in that, include: A first parameter and weight generation module, configured to obtain, based on a preset evaluation index dimension, operation data of a plurality of paths at a first moment, obtain a first evaluation parameter, and generate a first evaluation weight corresponding to the evaluation index dimension according to the first evaluation parameter; A first model building module, used for building a first path health evaluation model according to the evaluation indicator dimension and the first evaluation weight; A second parameter generating module, used for acquiring the operation data of the plurality of paths at a second moment to obtain a second evaluation parameter; a data mutation judgment module, used for judging whether data mutation occurs in the plurality of paths according to a difference between the second evaluation parameter and the first evaluation parameter; A second model building and evaluation module is used for responding to the updating of the first evaluation weight to form a second evaluation weight, constructing a second path health evaluation model according to the second evaluation weight and the evaluation index dimension, and respectively evaluating the path health of the plurality of paths through the second path health evaluation model and the second evaluation parameter; A first evaluation module, configured to respectively evaluate the path health of the plurality of paths using the first path health evaluation model and the second evaluation parameter; The traffic distribution module is used to generate a traffic distribution ratio according to the path health of the multiple paths, and distribute the read and write traffic according to the traffic ratio corresponding to the multiple paths.
9. An electronic device, characterized in that, include: Memory for storing computer programs; A processor, configured to implement the steps of the path selection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the path selection method according to any one of claims 1 to 7.