Path isolation method, electronic equipment, storage medium and product
By obtaining the first time-consuming of multiple paths and isolating paths with large deviations under preset conditions, the problem of paths with poor link quality but no read and write failures or timeouts in the prior art is solved, and the protection of disk performance is achieved.
Patent Information
- Application Number
- CN202510521840.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The prior art cannot effectively isolate paths with poor link quality but no read and write failures or timeouts, resulting in an impact on disk performance.
By obtaining the first time of the multiple paths, the target path is determined, and if the number of deviations of the target path exceeds the threshold value within the preset time window, the path is isolated.
Effective isolation of paths with poor link quality but no read and write timeouts or read and write failures is achieved, avoiding the negative impact of these paths on disk performance.
Smart Images

Figure CN120045142A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and in particular, to a path isolation method, an electronic device, a storage medium, and a product. Background Art
[0002] In related path isolation solutions, in the face of network congestion or poor link quality, paths with read / write timeouts or read / write failures are usually isolated. Although this method can effectively handle obvious fault situations, it cannot effectively isolate paths with poor link quality but without read / write failures or timeouts, thereby affecting disk performance. Summary of the Invention
[0003] This application provides a path isolation method, an electronic device, a storage medium, and a product to at least solve the problem in related technologies that effective isolation cannot be achieved for paths with poor link quality but without read / write failures or timeouts, thereby affecting disk performance.
[0004] This application provides a path isolation method, including: Obtaining a first time consumption of each path among multiple paths, where the first time consumption is used to indicate the read / write response time consumption of the path; Determining a target path among the multiple paths based on the first time consumption of each path among the multiple paths; Isolating the target path in response to the number of first deviation times corresponding to the target path within a first preset time window being greater than a preset deviation number.
[0005] This application further provides a path isolation device, including: An obtaining unit, configured to obtain a first time consumption of each path among multiple paths, where the first time consumption is used to indicate the read / write response time consumption of the path; A determining unit, configured to determine a target path among the multiple paths based on the first time consumption of each path among the multiple paths; An isolating unit, configured to isolate the target path in response to the number of first deviation times corresponding to the target path within a first preset time window being greater than a preset deviation number.
[0006] This application further provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above path isolation methods when executing the computer program.
[0007] This application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above path isolation methods.
[0008] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above path isolation methods when executed by a processor.
[0009] Through the present application, by obtaining the first time consumption of each path among multiple paths, where the first time consumption is used to indicate the read / write response time consumption of the path; based on the first time consumption of each path among the multiple paths, determining the target path among the multiple paths; in response to the number of first deviation times corresponding to the target path being greater than the preset deviation times within the first preset time window, isolating the target path, the technical problem in the related solutions that the path with poor link quality cannot be isolated is solved, and the technical effect of isolating the path with poor link quality but without read / write timeout or read / write failure and avoiding the impact of the path with poor quality on disk performance is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0011] Figure 1 It is a schematic flowchart of a path isolation method provided by an embodiment of the present application; Figure 2 It is a schematic flowchart of a path isolation method provided by an embodiment of the present application; Figure 3 It is a schematic flowchart of a path recovery method provided by an embodiment of the present application; Figure 4 It is a schematic structural diagram of a path isolation device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the 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.
[0013] It should be noted that in the description of this application, the terms "include", "comprise" or any other variants 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 this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0014] The storage multi-path technology is a technology that improves the high availability, performance and load balancing of data transmission by providing multiple physical paths between servers and storage devices in a Storage Area Network (SAN) environment. Among them, the storage area network refers to a separate data storage network formed by connecting several storage servers through a specific interconnection method. On the one hand, by providing multiple paths, the risk of storage inaccessibility caused by a single-path failure is reduced, ensuring the continuity of critical business applications. On the other hand, the load balancing function can make full use of the bandwidth of all available paths, avoiding the performance bottleneck of a single path. The storage multi-path technology is widely used in storage environments that require high availability and high performance, such as bank core transaction systems, Enterprise Resource Planning (ERP) systems, data warehouses, and video stream storage.
[0015] Traditional multi-path software usually isolates paths according to the number of path failures within a period of time in the case of network congestion and poor link quality. When routing input / output (IO) in multi-path distribution, it preferentially selects non-isolated paths to undertake IO, and only selects isolated paths to undertake IO when there are no available paths. Here, IO is used for data transfer operations such as data reading, writing, and other storage interactions.
[0016] In some cases with poor link quality, in some cases, the IO on the path will time out or fail, and in some cases, it will not time out or fail. Therefore, the traditional method cannot isolate paths with poor link quality but without IO timeout or IO failure, resulting in an impact on disk performance.
[0017] To solve the problems existing in related solutions, an embodiment of the present application provides a path isolation method, including: obtaining the first latency of each path among multiple paths, where the first latency is used to indicate the read / write response latency of the path; determining the target path among the multiple paths based on the first latency of each path among the multiple paths; in response to the number of first deviation times corresponding to the target path being greater than the preset deviation times within the first preset time window, isolating the target path, which solves the technical problem in related solutions that the path with poor link quality cannot be isolated, and achieves the technical effect of isolating the path with poor link quality but without read / write timeout or read / write failure, and avoiding the impact of the path with poor quality on disk performance.
[0018] A path isolation method provided by an embodiment of the present disclosure. This method can be executed by the IO completion routine interface module in a multi-path drive device. The path isolation method provided by the embodiment of the present disclosure can be applied to fields such as SAN, ERP systems, data centers, and cloud computing services.
[0019] To enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] Figure 1 It is a schematic flowchart of a path isolation method provided by an embodiment of the present disclosure.
[0021] As Figure 1 shown, the method includes the following steps: Step 101, obtaining the first latency of each path among multiple paths, where the first latency is used to indicate the read / write response latency of the path; In some embodiments, multiple paths generally refer to multiple physical connections or logical paths existing between a server and a multi-path drive device. Specifically, these paths can be composed of different hardware components, network interfaces, or protocols to provide redundancy and load balancing functions, ensuring high availability and performance optimization.
[0022] In some embodiments, the read / write response latency refers to the time required from initiating a read or write request to the completion of the request and receiving the response. If the read / write response latency of a certain path is significantly higher than that of other paths, even if there is no obvious failure or timeout, it may indicate that there are potential problems with this path, such as network congestion and poor link quality.
[0023] In some embodiments, in order to more accurately reflect the performance of a path, methods such as exponentially weighted moving average (EWMA) latency can be used to smooth the read and write response latency, so as to obtain more stable performance metrics, that is, the first latency. The first latency is the exponentially weighted moving average latency, which is used to smooth and analyze time series data and is applicable to performance metrics for dynamic monitoring such as IO operation response time. It can more sensitively reflect the latest change trend by assigning higher weights to recent data, while retaining the influence of certain historical data.
[0024] In some embodiments, the first latency of each path among multiple paths can be obtained based on the completion latency, weight, etc. of the IO.
[0025] Step 102, determine the target path among multiple paths based on the first latency of each path among multiple paths; In some embodiments, based on the first latency of each path among multiple paths, it is determined whether the exponentially weighted moving average latency of one path is much greater than that of other paths. If there is a situation where one path is much greater than the exponentially weighted moving average latency among other paths, find the path that is greater than the average value of multiple paths and the deviation is greater than a preset value, and use the path that is greater than the average value of multiple paths and the deviation is greater than a preset value as the target path.
[0026] In some embodiments, the target path refers to a path with poor link quality that needs to be isolated.
[0027] In some embodiments, the number of target paths can be zero, one, or multiple, and no limitation is applied thereto. Among them, when the number of target paths is zero, it means that there is no path among multiple paths that is greater than the average value of multiple paths and the deviation is greater than a preset value, that is, there is no path with poor link quality. Therefore, there is no need to perform subsequent steps for path isolation. If the number of target paths is one or more, it means that there are paths with poor link quality among multiple paths, and further isolation is required to reduce the impact on the performance of the system disk.
[0028] In some embodiments, by calculating and comparing the exponentially weighted moving average latency of each path, paths with deteriorating performance can be dynamically detected and isolated to avoid their impact on the performance of the overall system.
[0029] Step 103, isolate the target path in response to the number of first deviation times corresponding to the target path within the first preset time window being greater than the preset deviation times.
[0030] In some embodiments, the first preset time window refers to a preset time window for counting the performance deviation of the target path, such as 60 seconds.
[0031] In some embodiments, the first deviation count refers to a high deviation count. The high deviation count refers to the number of times that, for the current path within a period of time, the deviation is greater than the average value of multiple paths and greater than a preset value.
[0032] In some embodiments, the paths in a multi-path drive device where the first deviation count corresponding to the target path within the first preset time window is greater than the preset deviation count refer to the paths with poor link quality but without read / write timeouts or read / write failures.
[0033] In some embodiments, by responding to the first deviation count corresponding to the target path within the first preset time window being greater than the preset deviation count and isolating the target path, it is possible to isolate the paths with poor link quality but without read / write timeouts or read / write failures among multiple paths, thereby avoiding the impact of poor-quality paths on disk performance.
[0034] Through the present application, by obtaining the first elapsed time of each path among multiple paths, where the first elapsed time is used to indicate the read / write response elapsed time of the path; based on the first elapsed time of each path among multiple paths, determining the target path among multiple paths; and responding to the first deviation count corresponding to the target path within the first preset time window being greater than the preset deviation count and isolating the target path, the technical problem in the related solutions of being unable to isolate paths with poor link quality is solved, and the technical effect of isolating paths with poor link quality but without read / write timeouts or read / write failures and avoiding the impact of poor-quality paths on disk performance is achieved.
[0035] In some embodiments, obtaining the first elapsed time of each path among multiple paths includes: Obtaining the second elapsed time and the third elapsed time of each path among multiple paths; In some embodiments, the second elapsed time refers to the elapsed time for the current IO completion of the path, and specifically, the second elapsed time of the path can be determined by the time stamp when the IO response is received and the time stamp when the IO request is initiated.
[0036] In some embodiments, the third elapsed time refers to the exponentially weighted moving average elapsed time recorded last time, where the first-recorded exponentially weighted moving average elapsed time is determined by the first IO completion elapsed time.
[0037] Based on the second elapsed time, determining the weight corresponding to the second elapsed time; In some embodiments, the weight corresponding to the second elapsed time can be determined based on time window division and weight assignment.
[0038] In some embodiments, if it is determined that the value of the smoothing factor is , and its value range is between 0 and 1, 1 second can be divided into 1000 time windows, that is, each time window is 1 ms, and corresponding weight values are set within each 1-ms time window. The weight values are arranged from small to large as , according to the position where the IO completion time falls into 1000 time windows, select the corresponding weight value. For example, when the second time consumption is 900 ms, the weight value corresponding to the second time consumption is . Further, in this application, the size and number of the foregoing time windows are not limited. For example, 1 second can also be divided into 100 time windows, or 2 seconds can be divided into 100 time windows.
[0039] Based on the second time consumption, the weight, and the third time consumption, determine the first time consumption of each path among the multiple paths.
[0040] In some embodiments, the mathematical expression for determining the first time consumption of each path among the multiple paths is as follows: ; where, refers to the first time consumption, that is, the current exponentially weighted moving average time consumption, refers to the weight value corresponding to the second time consumption, that is, the weight value corresponding to the current IO completion time falling into the nth time window, refers to the third time consumption, that is, the previous exponentially weighted moving average time consumption, refers to the second time consumption, that is, the current IO completion time, where, can be determined by ; can be determined by ; can be determined by the first IO completion time.
[0041] In some embodiments, based on the second time consumption, determining the weight corresponding to the second time consumption includes: Based on the second time consumption, determine the time window corresponding to the second time consumption, and the time window is obtained by dividing the second preset time window; In some embodiments, if the second time consumption is not greater than the maximum value of the time window, directly determine the time window corresponding to the second time consumption according to the second time consumption. If the second time consumption is greater than the maximum value of the time window, determine the maximum value of the time window as the time window corresponding to the second time consumption.
[0042] In some embodiments, with the value of the foregoing smoothing factor being , whose value range is between 0 and 1, 1 second can be divided into 1000 time windows, that is, each time window is 1 ms, and corresponding weight values are set within each 1 - ms time window. The weight values are arranged from small to large as , according to the position where the IO completion time falls into 1000 time windows, select the corresponding weight value. For example, when the second time consumption (the current IO completion time) is 900 ms, the time window corresponding to the second time consumption is 900 ms. If the second time consumption (the current IO completion time) is 1200 ms, the time window corresponding to the second time consumption is 1 second.
[0043] Based on the time window corresponding to the second time consumption, determine the weight corresponding to the second time consumption from the mapping relationship between the time window and the weight.
[0044] In some embodiments, the mapping relationship between the time window and the weight can be in the form of a mapping relationship table or in the form of a mapping relationship array.
[0045] In some embodiments, as described above, when the second time consumption is 900 ms, the time window corresponding to the second time consumption is 900 ms, and the weight corresponding to the second time consumption is , if the second time consumption is 1200 ms, the time window corresponding to the second time consumption is 1 second, and the weight corresponding to the second time consumption is .
[0046] In some embodiments, determining the target path among multiple paths based on the first time consumption of each path among multiple paths includes: Based on the first time consumption of each path among multiple paths, determine the average time consumption of the multiple paths; In some embodiments, the average time consumption of multiple paths can be obtained by adding up the first time consumption of each path among multiple paths and taking the average.
[0047] Based on the first time consumption of each path among multiple paths and the average time consumption of the multiple paths, determine the first path among the multiple paths; In some embodiments, compare the first time consumption of each path among multiple paths with the average time consumption of the multiple paths respectively, obtain the set of paths whose first time consumption among multiple paths is greater than the average time consumption of the multiple paths, and determine these paths as the first path. The first path is the path whose first time consumption is greater than the average time consumption.
[0048] In some embodiments, by comparing the exponentially weighted moving average time consumption of different paths, paths with poor performance can be discovered and isolated in a timely manner, thereby protecting the stability and performance of the entire system.
[0049] In response to the difference between the first time consumption of the first path and the average time consumption of the multiple paths being greater than a preset threshold value, determine the first path as the target path among the multiple paths.
[0050] In some embodiments, the preset threshold value refers to a preset value used to measure the large deviation of the path time consumption. The present application does not limit the specific value of the preset threshold value.
[0051] In some embodiments, the target path is the path among multiple paths whose first time consumption is greater than the average value and whose deviation from the average time consumption is the largest.
[0052] In some embodiments, there may be one or more target paths.
[0053] In some embodiments, by responding that the difference between the first time consumption of the first path and the average time consumption of multiple paths is greater than a preset threshold, the range of paths with poor link quality can be further narrowed.
[0054] In some embodiments, in response to the number of first deviations corresponding to the target path within the first preset time window being greater than the preset number of deviations, before isolating the target path, the path isolation method further includes: Obtaining the number of first deviations corresponding to the target path within the first preset time, where the number of first deviations is used to indicate the number of times that the first time consumption of the target path is higher than the first time consumption of other paths among multiple paths; In some embodiments, other paths refer to the paths among multiple paths except the target path.
[0055] In some embodiments, after each IO operation is completed, the first time consumption of the target path and other paths is compared. If the first time consumption of the target path is higher than the first time consumption of other paths, the number of first deviations, that is, the number of high deviations, is increased.
[0056] If the number of first deviations corresponding to the target path within the first preset time is the first preset value, update the number of first deviations corresponding to the target path and obtain the first timestamp corresponding to the target path, where the first timestamp is the timestamp when the target path first deviates.
[0057] In some embodiments, the first preset value refers to the number of first deviations corresponding to the target path within the first preset time. The first preset value is usually zero, indicating that there is no situation where the first time consumption of the target path is much greater than the first time consumption of other paths within the first preset time.
[0058] In some embodiments, if the number of first deviations corresponding to the target path within the first preset time is zero, increment the number of times the target path deviates and obtain the timestamp corresponding to the first time the target path has a high deviation relative to other paths, to obtain the first timestamp.
[0059] In some embodiments, after obtaining the number of first deviations corresponding to the target path within the first preset time, the path isolation method further includes: If the number of first deviations corresponding to the target path within the first preset time is not the first preset value, determine the first time difference based on the current timestamp and the first timestamp; In some embodiments, the first preset value is zero. If the first deviation count corresponding to the target path within the first preset time is not the first preset value, it indicates that within the first preset time, there is a situation where the first time consumption of the target path is much greater than that of other paths. At this time, the first deviation count is a positive integer, representing the number of times that the first time consumption of the target path is much greater than that of other paths within the first preset time.
[0060] In some embodiments, the first time difference is used to measure the duration of high deviation of the target path relative to other paths.
[0061] If the first time difference is greater than the preset time window value, reset the first deviation count corresponding to the target path to the first preset value and obtain the second timestamp corresponding to the target path. In some embodiments, the preset time window value refers to a preset time window value used to determine the path quality.
[0062] In some embodiments, that the first time difference is greater than the preset time window value indicates that the time of high deviation has exceeded the preset time window, and it is necessary to re-accumulate the first deviation count corresponding to the target path.
[0063] In some embodiments, the second timestamp corresponding to the target path refers to the timestamp when, after re-accumulating the first deviation count corresponding to the target path, the first time consumption of the target path is much greater than that of other paths for the first time.
[0064] If the first time difference is not greater than the preset time window value, update the first deviation count corresponding to the target path.
[0065] In some embodiments, that the first time difference is not greater than the preset time window value indicates that it is still within the preset time window. Therefore, it is only necessary to continue incrementing the high deviation count between the target path and other paths.
[0066] In some embodiments, in response to the first deviation count corresponding to the target path within the first preset time window being greater than the preset deviation count, isolating the target path includes: In response to the first deviation count corresponding to the target path within the first preset time window being greater than the preset deviation count, obtain the number of second paths among multiple paths, where the second paths are available paths. In response to the number of second paths not being the first preset value, isolate the target path.
[0067] In some embodiments, the preset deviation count is a threshold used to determine whether there are significant performance problems with the target path.
[0068] In some embodiments, when the number of first deviations corresponding to the target path within the first preset time window is greater than the preset number of deviations, it indicates that the link quality of the target path is poor, and it is necessary to further determine whether to isolate the target path in combination with the number of available paths.
[0069] In some embodiments, an available path refers to a path with a status of "available" in the current system, specifically a path that is currently in a normal working state and can reliably transmit data.
[0070] In some embodiments, the first preset value is zero, and when the number of second paths is not zero, that is, when there are available paths, the target path is isolated.
[0071] In some embodiments, if the number of second paths is zero, it means that the system does not have enough backup paths. In this case, directly isolating the target path may cause the system to completely lose connection, thereby affecting data transmission between the server and the multipath drive device.
[0072] In some embodiments, isolating the target path means setting the target path to an unavailable state to prevent it from continuing to participate in data transmission between the server and the multipath drive device.
[0073] In some embodiments, in response to the number of second paths not being the first preset value, after isolating the target path, the path isolation method further includes: Determining the starting freeze time of the target path and sending the isolation status of the target path to the target user in a preset manner.
[0074] In some embodiments, the starting freeze time is used to indicate the start time when the target path is marked as unavailable or in an isolated state. This time stamp can both prevent repeated operations within a short period and provide a basis for the recovery of the isolated path.
[0075] In some embodiments, the preset manner may include sending message reminders such as emails or text messages, or it may be in the form of instant messaging tool notifications, system log records, or visual dashboard updates. Specifically, the isolation status, starting freeze time, and other information of the target path are sent to the target user via email; a short notification message is sent to the target user's mobile phone via text message; the status of the target path is updated on the system's monitoring or management dashboard to visually display its isolation status, starting freeze time, and other information to the user.
[0076] In some embodiments, after determining the starting freeze time of the target path and sending the isolation status of the target path to the target user in a preset manner, the path isolation method further includes: Obtaining the abnormal time window ratio corresponding to the target path; In some embodiments, the abnormal time window ratio refers to the proportion of the time during which the target path is in an abnormal state within a certain time window.
[0077] In some embodiments, whether to extend the freezing time of the target path can be determined according to the size of the abnormal time window ratio.
[0078] In response to the abnormal time window ratio corresponding to the target path being greater than the preset time window ratio, refresh the freezing time of the target path and reset the abnormal time window ratio corresponding to the target path; In response to the abnormal time window ratio corresponding to the target path being not greater than the preset time window ratio, obtain the number of available paths of the device corresponding to the target path.
[0079] In some embodiments, the preset time window ratio refers to a preset threshold used to determine whether to extend the freezing time of the target path.
[0080] In some embodiments, the abnormal time window ratio corresponding to the target path being greater than the preset time window ratio indicates that the link quality of the target path is still very poor. In the case of having other available paths, it is necessary to continue freezing the target path.
[0081] In some embodiments, refreshing the freezing time of the target path means updating the starting freezing time of the target path to the current time and restarting the calculation of the freezing period, thereby extending the isolation time of the target path and avoiding fluctuations in disk performance caused by its premature recovery; resetting the abnormal time window ratio corresponding to the target path means resetting the abnormal time window ratio of the target path to 0 and restarting the statistics of a new abnormal time window to ensure that subsequent monitoring is based on the latest time window data and avoid the influence of accumulated old data on decision-making.
[0082] In some embodiments, the abnormal time window ratio corresponding to the target path being not greater than the preset time window ratio indicates that although there are some problems with the performance of the target path during the current time period, it is not serious enough to significantly affect the system performance or stability. In other words, the abnormal situation of the target path is still within an acceptable range, and there is no need to immediately isolate the target path.
[0083] In some embodiments, the number of available paths of the device corresponding to the target path refers to the number of paths with the status of "available" among the multipath drive devices associated with the target path, to ensure that there are sufficient backup paths to take over the tasks of the target path and provide a basis for whether to resume the target path subsequently.
[0084] In some embodiments, obtaining the abnormal time window ratio corresponding to the target path includes: Obtain the first freezing time of the target path, where the first freezing time is used to indicate the time during which the target path is in an isolated state; In some embodiments, the first freezing time of the target path may be determined according to the current time and the aforementioned starting freezing time.
[0085] In response to the first freezing time of the target path being not greater than the preset freezing time, acquiring a fourth time consumption of the target path; In some embodiments, the preset freezing time refers to a preset freezing time of the target path.
[0086] In some embodiments, if the first freezing time of the target path is not greater than the preset freezing time, it means that the target path is still in a frozen state.
[0087] In some embodiments, the fourth time consumption of the target path refers to obtaining the IO completion time consumption by detecting the IO, and further determining the exponential moving average time consumption of the target path based on the IO completion time consumption.
[0088] In some embodiments, an isolation path recovery thread may be started and the paths meeting the isolation recovery conditions may be automatically recovered through periodic detection.
[0089] Based on the fourth time consumption of the target path, the abnormal time window ratio corresponding to the target path is determined.
[0090] In some embodiments, based on the fourth time consumption of the target path, determining the abnormal time window ratio corresponding to the target path includes: Based on the fourth time consumption of the target path, determine the number of abnormal time windows in which the fourth time consumption of the target path meets the preset condition within the third preset time window; In some embodiments, the abnormal time window may be a continuous time window in the third preset time window, or a discontinuous time window in the third preset time window. The third preset time window is a preset time window. The third preset time window may be 300ms.
[0091] In some embodiments, the preset condition refers to a time window in which the exponential moving average time consumed by the target path is much greater than the exponential moving average time consumed by other paths.
[0092] Based on the number of abnormal time windows and the total number of time windows included in the third preset time window, a ratio of abnormal time windows corresponding to the target path is determined.
[0093] In some embodiments, the abnormal time window ratio quantifies the degree of abnormality of the target path within the time window.
[0094] In some embodiments, in response to the abnormal time window ratio corresponding to the target path being not greater than the preset time window ratio, after obtaining the number of available paths of the device corresponding to the target path, the path isolation method further includes: In response to the number of available paths being a first preset value, releasing isolation of the target path; In some embodiments, a first preset value of zero indicates that the number of available paths of the multipath drive device associated with the target path is zero. In this case, there are no available paths that need to release the isolation of the target path to enable data transmission between the server and the multipath drive device.
[0095] In response to the number of available paths not being the first preset value, refresh the freeze time of the target path and reset the abnormal time window ratio corresponding to the target path.
[0096] In some embodiments, the number of available paths of the multipath drive device associated with the target path is not zero. Other available paths are preferentially used to enable data transmission between the server and the multipath drive device. Therefore, the target path can continue to be isolated.
[0097] In some embodiments, the steps of refreshing the freeze time of the target path and resetting the abnormal time window ratio corresponding to the target path are the same as those in the foregoing embodiments and will not be elaborated here.
[0098] In some embodiments, by determining whether to continue isolating the target path based on the number of available paths, the fault tolerance and high availability of the multipath drive device can be improved. If a certain path is isolated, the system needs to ensure that the remaining available paths can undertake the task of data transmission to avoid service interruption due to insufficient paths.
[0099] In some embodiments, as Figure 2 shown Figure 2Schematic flowchart of a path isolation method provided by an embodiment of this application. Path X is the target path. Specifically, step 201: Calculate the time taken for the current path X to complete an I / O operation; step 202: Obtain the exponentially weighted moving average coefficient weight value based on the I / O completion time; step 203: Calculate the current exponentially weighted moving average I / O time cur_resp_avg based on the last exponentially weighted moving average I / O time last_resp_avg of path X, the current I / O completion time, and the weight value; step 204: Obtain the exponentially weighted moving average I / O times of other available paths; step 205: Determine whether the exponentially weighted moving average time of path X is much greater than the exponentially weighted moving average times of other paths; if there is a situation where the exponentially weighted moving average time of path X is much greater than that of other paths, jump to step 206; otherwise, end. The specific determination method is as follows: (a) Calculate the average value of the exponentially weighted moving average times of all available paths; (b) Traverse the paths to find the path that is greater than the average value and has the largest deviation from the average value; (c) If path X is the path that is greater than the average value and has the largest deviation from the average value, determine whether the difference between the exponentially weighted moving average time of path X and the average value of all paths is greater than a set threshold value; step 206: Determine whether the number of high deviation times of the exponentially weighted moving average time between path X and other paths is 0; if the number of high deviation occurrences is 0, jump to step 207, otherwise jump to step 209; step 207: Increment the number of high deviation times path_high_resp_count of the exponentially weighted moving average time between path X and other paths; step 208: Record the starting time value path_high_resp_start of the high response time deviation; step 209: Determine whether the difference between the current time and path_high_resp_start is greater than the set time window value; if it is greater than the set time window value, jump to step 210, otherwise jump to step 212; step 210: Set the number of high deviation times path_high_resp_count of the exponentially weighted moving average time between path X and other paths to 0; step 211: Record the starting time value path_high_resp_start of the high response time deviation; step 212: Increment the number of high deviation times path_high_resp_count of the exponentially weighted moving average time between path X and other paths; step 213: Determine whether path_high_resp_count is greater than the set threshold value of the number of high deviation times; if it is greater than the set threshold value of the number of high deviation times, jump to step 214, otherwise end; step 214: Determine whether there are any available paths; if there are other available paths, jump to step 215, otherwise end; step 215: Set the path status to the isolation status, set the starting freeze time, send a message such as an email or text message to remind the user, and then end.
[0100] In some embodiments, as Figure 3 shownFigure 3 It is a schematic flowchart of a path recovery method provided by an embodiment of the present application. Step 301: Determine whether path X is in an isolated state; if it is in an isolated state, jump to step 302, otherwise end; Step 302: Determine whether path X has exceeded the set freeze time threshold currently; if it has exceeded the set freeze time threshold, jump to step 304, otherwise jump to step 303; Step 303: Send a probe IO and calculate the exponentially weighted moving average IO latency of path X; calculate the time window high_resp_percentage in which path X is much greater than the exponentially weighted moving average latency of other paths within the distributed time window; Step 304: Determine whether high_resp_percentage exceeds the set performance threshold; if it exceeds the set performance threshold, jump to step 306, otherwise jump to step 305; Step 305: Determine whether the number of available paths of the multipath device to which path X belongs is greater than 0; if the number of available paths is greater than 0, jump to step 306, otherwise jump to step 307; Step 306: Refresh the freeze time of path X and reset high_resp_percentage; Step 307: Remove the isolation of path X.
[0101] Through the present application, by obtaining the first latency of each path among multiple paths, the first latency is used to indicate the read / write response latency of the path; based on the first latency of each path among multiple paths, determine the target path among multiple paths; in response to the number of first deviation times corresponding to the target path being greater than the preset deviation times within the first preset time window, isolate the target path, which solves the technical problem in the related solutions that the path with poor link quality cannot be isolated, and achieves the technical effect of isolating the path with poor link quality but without read / write timeout or read / write failure, and avoiding the impact of the path with poor quality on disk performance.
[0102] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0103] An embodiment of the present application also provides a path isolation device 400. Figure 4 It is a schematic structural diagram of a path isolation device provided by an embodiment of the present disclosure, as Figure 4 shown, including: An acquisition unit 401, configured to acquire the first latency of each path among multiple paths, and the first latency is used to indicate the read / write response latency of the path; A determination unit 402, configured to determine the target path among multiple paths based on the first latency of each path among multiple paths; An isolation unit 403, configured to isolate a target path in response to that the number of first deviations corresponding to the target path within a first preset time window is greater than a preset number of deviations.
[0104] Through this application, by obtaining the first time consumption of each path among multiple paths, where the first time consumption is used to indicate the read / write response time consumption of the path; based on the first time consumption of each path among multiple paths, determining the target path among multiple paths; and in response to that the number of first deviations corresponding to the target path within a first preset time window is greater than a preset number of deviations, isolating the target path, the technical problem in the related solutions that a path with poor link quality cannot be isolated is solved, and the technical effect of isolating a path with poor link quality but without read / write timeout or read / write failure and avoiding the impact of the path with poor quality on disk performance is achieved.
[0105] Further, in a possible implementation manner of the embodiments of the present disclosure, the obtaining unit 401 is configured to: Obtain the second time consumption and the third time consumption of each path among multiple paths; Determine the weight corresponding to the second time consumption based on the second time consumption; Determine the first time consumption of each path among multiple paths based on the second time consumption, the weight, and the third time consumption.
[0106] Further, in a possible implementation manner of the embodiments of the present disclosure, the obtaining unit 401 is configured to: Determine the time window corresponding to the second time consumption based on the second time consumption, where the time window is obtained by dividing a second preset time window; Determine the weight corresponding to the second time consumption from the mapping relationship between the time window and the weight based on the time window corresponding to the second time consumption.
[0107] Further, in a possible implementation manner of the embodiments of the present disclosure, the determining unit 402 is configured to: Determine the average time consumption of multiple paths based on the first time consumption of each path among multiple paths; Determine the first path among multiple paths based on the first time consumption of each path among multiple paths and the average time consumption of multiple paths; In response to that the difference between the first time consumption of the first path and the average time consumption of multiple paths is greater than a preset threshold, determine the first path as the target path among multiple paths.
[0108] Further, in a possible implementation manner of the embodiments of the present disclosure, the path isolation device 400 further includes a first updating unit, and the first updating unit is configured to: Obtain the number of first deviations corresponding to the target path within a first preset time, where the number of first deviations is used to indicate the number of times that the first time consumption of the target path is higher than the first time consumption of other paths among multiple paths; If the number of first deviations corresponding to the target path within the first preset time is the first preset value, update the number of first deviations corresponding to the target path and obtain the first timestamp corresponding to the target path, where the first timestamp is the timestamp when the target path first deviates.
[0109] Further, in a possible implementation manner of the embodiment of the present disclosure, the path isolation device 400 further includes a second update unit, and the second update unit is configured to: If the number of first deviations corresponding to the target path within the first preset time is not the first preset value, determine a first time difference based on the current timestamp and the first timestamp; If the first time difference is greater than the preset time window value, reset the number of first deviations corresponding to the target path to the first preset value and obtain the second timestamp corresponding to the target path; If the first time difference is not greater than the preset time window value, update the number of first deviations corresponding to the target path.
[0110] Further, in a possible implementation manner of the embodiment of the present disclosure, the isolation unit 403 is configured to: In response to the number of first deviations corresponding to the target path being greater than the preset deviation number within the first preset time window, obtain the number of second paths among multiple paths, where the second path is an available path; In response to the number of second paths not being the first preset value, isolate the target path.
[0111] Further, in a possible implementation manner of the embodiment of the present disclosure, the path isolation device 400 further includes a sending unit, and the sending unit is configured to: Determine the starting freezing time of the target path and send the isolation state of the target path to the target user in a preset manner.
[0112] Further, in a possible implementation manner of the embodiment of the present disclosure, the path isolation device 400 further includes a path number acquisition unit, and the path number acquisition unit is configured to: Obtain the abnormal time window ratio corresponding to the target path; In response to the abnormal time window ratio corresponding to the target path being greater than the preset time window ratio, refresh the freezing time of the target path and reset the abnormal time window ratio corresponding to the target path; In response to the abnormal time window ratio corresponding to the target path not being greater than the preset time window ratio, obtain the number of available paths of the device corresponding to the target path.
[0113] Further, in a possible implementation manner of the embodiment of the present disclosure, the path number acquisition unit is further configured to: Obtain the first freezing time of the target path, where the first freezing time is used to indicate the time when the target path is in an isolated state; In response to the first freezing time of the target path being not greater than the preset freezing time, acquiring a fourth time consumption of the target path; Based on the fourth time consumption of the target path, the abnormal time window ratio corresponding to the target path is determined.
[0114] Furthermore, in a possible implementation of the embodiment of the present disclosure, the path quantity acquisition unit is further configured to: Based on the fourth time consumption of the target path, determine the number of abnormal time windows in which the fourth time consumption of the target path meets the preset condition within the third preset time window; Based on the number of abnormal time windows and the total number of time windows included in the third preset time window, a ratio of abnormal time windows corresponding to the target path is determined.
[0115] Furthermore, in a possible implementation of the embodiment of the present disclosure, the path isolation device 400 further includes a refresh unit, and the refresh unit is used to: In response to the number of available paths being a first preset value, releasing isolation of the target path; In response to the number of available paths not being equal to the first preset value, refreshing the freezing time of the target path and resetting the abnormal time window ratio corresponding to the target path.
[0116] The description of the features in the embodiment corresponding to the path isolation device can refer to the relevant description of the embodiment corresponding to the path isolation method, and will not be repeated here.
[0117] 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 isolation method embodiments.
[0118] 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 of the above-mentioned path isolation method embodiments when running.
[0119] 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.
[0120] 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 isolation method embodiments are implemented.
[0121] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps in any of the above-described path isolation method embodiments.
[0122] Those skilled in the art can 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 the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their 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 the present application.
[0123] The above has introduced in detail a path isolation method, an electronic device, a storage medium, and a product provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A path isolation method, characterized in that: include: Obtaining a first time consumption of each path among the multiple paths, where the first time consumption is used to indicate a read and write response time consumption of the path; Determining a target path among the multiple paths based on a first time consumption of each path among the multiple paths; In response to a first deviation number corresponding to the target path within a first preset time window being greater than a preset deviation number, the target path is isolated.
2. The path isolation method according to claim 1, characterized in that: The obtaining of the first time consumption of each path in the plurality of paths comprises: Get the second time and the third time of each of the multiple paths; Based on the second time consumption, determining a weight corresponding to the second time consumption; A first time consumption of each of the plurality of paths is determined based on the second time consumption, the weight, and the third time consumption.
3. The path isolation method according to claim 2, characterized in that: The determining, based on the second time consumption, a weight corresponding to the second time consumption includes: Based on the second time consumption, determine a time window corresponding to the second time consumption, where the time window is obtained by dividing the second preset time window; Based on the time window corresponding to the second time consumption, a weight corresponding to the second time consumption is determined from a mapping relationship between the time window and the weight.
4. The path isolation method according to claim 1, characterized in that: The determining, based on the first time consumption of each path in the multiple paths, a target path in the multiple paths comprises: Determining an average time consumption of the plurality of paths based on a first time consumption of each path in the plurality of paths; Determining a first path among the multiple paths based on a first time consumption of each path among the multiple paths and an average time consumption of the multiple paths; In response to a difference between a first time consumption of the first path and an average time consumption of the multiple paths being greater than a preset threshold, the first path is determined to be a target path among the multiple paths.
5. The path isolation method according to claim 1, characterized in that: In response to the first deviation number corresponding to the target path within the first preset time window being greater than the preset deviation number, before isolating the target path, the method further comprises: Obtaining a first deviation number corresponding to the target path within a first preset time, where the first deviation number is used to indicate the number of times that a first time consumption of the target path is higher than a first time consumption of other paths among the multiple paths; If the first deviation number corresponding to the target path within the first preset time is a first preset value, the first deviation number corresponding to the target path is updated and a first timestamp corresponding to the target path is obtained, where the first timestamp is the timestamp of the first deviation of the target path.
6. The path isolation method according to claim 5, characterized in that: After obtaining the first deviation number corresponding to the target path within the first preset time, the method further includes: If the first deviation number corresponding to the target path within the first preset time is not a first preset value, determining a first time difference based on the current timestamp and the first timestamp; If the first time difference is greater than a preset time window value, resetting the first deviation number corresponding to the target path to a first preset value and obtaining a second timestamp corresponding to the target path; If the first time difference is not greater than a preset time window value, the first deviation number corresponding to the target path is updated.
7. The path isolation method according to claim 1, characterized in that: In response to the first deviation number corresponding to the target path within the first preset time window being greater than the preset deviation number, isolating the target path includes: In response to the first deviation number corresponding to the target path within the first preset time window being greater than the preset deviation number, obtaining the number of second paths in the multiple paths, the second paths being available paths; In response to the number of the second paths not being a first preset value, isolating the target path.
8. The path isolation method according to claim 7, characterized in that: After isolating the target path in response to the number of the second paths not being the first preset value, the method further comprises: The starting freezing time of the target path is determined and the isolation status of the target path is sent to the target user in a preset manner.
9. The path isolation method according to claim 8, characterized in that: After determining the starting freezing time of the target path and sending the isolation status of the target path to the target user in a preset manner, the method further includes: Obtaining the abnormal time window ratio corresponding to the target path; In response to the abnormal time window ratio corresponding to the target path being greater than the preset time window ratio, refreshing the freezing time of the target path and resetting the abnormal time window ratio corresponding to the target path; In response to the abnormal time window ratio corresponding to the target path being not greater than the preset time window ratio, the number of available paths of the device corresponding to the target path is acquired.
10. The path isolation method according to claim 9, characterized in that: The step of obtaining the abnormal time window ratio corresponding to the target path includes: Acquire a first freezing time of the target path, where the first freezing time is used to indicate a time during which the target path is in an isolated state; In response to the first freezing time of the target path being not greater than the preset freezing time, acquiring a fourth time consumption of the target path; Based on the fourth time consumption of the target path, an abnormal time window ratio corresponding to the target path is determined.
11. The path isolation method according to claim 10, characterized in that: The determining, based on the fourth time consumption of the target path, the abnormal time window ratio corresponding to the target path includes: Based on the fourth time consumption of the target path, determining the number of abnormal time windows in which the fourth time consumption of the target path meets a preset condition within the third preset time window; Based on the number of abnormal time windows and the total number of time windows included in the third preset time window, a ratio of abnormal time windows corresponding to the target path is determined.
12. The path isolation method according to claim 9, characterized in that: After acquiring the number of available paths of the device corresponding to the target path in response to the abnormal time window ratio corresponding to the target path being not greater than the preset time window ratio, the method further includes: In response to the number of available paths being a first preset value, releasing isolation of the target path; In response to the number of available paths not being equal to a first preset value, refreshing the freezing time of the target path and resetting the abnormal time window ratio corresponding to the target path.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the path isolation method as claimed in any one of claims 1 to 12 when executing the computer program.
14. 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 isolation method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the path isolation method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Equipment connection stability evaluation method and device, computer equipment and storage medium
CN115333970A
Read-write link control method and device, and medium
CN116820822A
Path fault isolation processing method and device for multi-path software
CN117221090A
Link processing method, system, equipment and medium
CN118093236A
Abnormal communication link processing method, device and system and nonvolatile storage medium
CN118264537A
Cited By
Path management method and device, medium and program product
CN120416103A
Path group updating method and device
CN122489014A
Path group updating method and apparatus
CN122489014B