Client access path dynamic selection method, device and medium
By constructing a multi-dimensional scoring model and dynamically adjusting the weights of quality indicators, the problem of inaccurate multi-path selection in NAS devices has been solved, achieving accuracy and reliability in path selection. This makes it suitable for NAS devices used in enterprise offices and home storage.
Patent Information
- Application Number
- CN202611504757.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies in NAS devices cannot dynamically adjust the importance of quality indicators according to actual application scenarios in multi-path routing, resulting in a mismatch between path selection results and business needs; they neglect cost and security assessments and lack quantitative assessments of the availability of point-to-point access paths, leading to inaccurate selections and low reliability.
By constructing a standardized scoring model covering three dimensions—performance, cost, and security—and combining it with network address translation type to determine the penetration success rate of point-to-point access paths, the weights of quality indicators are dynamically adjusted, and the TURN relay service is used to improve connection success rate, thus achieving comprehensive evaluation and selection of multiple paths.
It improves the accuracy and reliability of client access path selection, ensures that path selection meets business needs, reduces connection latency, and enhances security.
Smart Images

Figure CN123145199A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network technology, and in particular to a method, apparatus and medium for dynamic selection of client access path. Background Technology
[0002] With the widespread adoption of NAS (Network Attached Storage) devices in enterprise offices and home storage, users' demand for remote access to NAS data across networks is increasing. Modern NAS devices typically have multiple network access paths, and clients face the challenge of choosing the optimal path from these options when initiating NAS access. Summary of the Invention
[0003] In view of the above, this application provides a method, apparatus and medium for dynamic selection of client access path, which can improve the accuracy and reliability of client access path selection.
[0004] The first aspect of this application provides a method for dynamically selecting a client access path, comprising: determining multiple candidate network access paths between a client to be accessed and a network-attached storage device, wherein the multiple candidate network access paths include a point-to-point access path and / or other paths; evaluating each candidate network access path according to preset quality indicators to obtain quality evaluation data for the candidate network access paths, wherein the quality evaluation data includes first quality evaluation data corresponding to the point-to-point access path and second quality evaluation data corresponding to other paths; when the multiple candidate network access paths include a point-to-point access path, obtaining a first network address translation type (NAT) of the client and a second NAT of the network-attached storage device, and determining the penetration success rate of the point-to-point access path based on the first NAT and the second NAT; calculating the final quality evaluation data of the point-to-point access path based on the penetration success rate and the first quality evaluation data; determining the final network access path from the multiple candidate network access paths based on the final quality evaluation data and the second quality evaluation data; or, when the multiple candidate network access paths do not include a point-to-point access path, determining the final network access path from the multiple candidate network access paths based on the second quality evaluation data corresponding to other paths.
[0005] The technical solution provided in this application has at least the following advantages: After determining multiple candidate network access paths between the client to be accessed and the network-attached storage device, each candidate network access path is evaluated according to preset quality indicators to obtain quality evaluation data for each candidate network access path. This allows for a comprehensive evaluation of the candidate network access paths based on the quality evaluation data. For cases where multiple candidate network access paths do not include point-to-point access paths, the final network access path can be directly selected based on the second quality evaluation data. For cases where multiple candidate network access paths include point-to-point access paths, since the establishment of point-to-point access path connections highly depends on the success rate of network address translation (NAT) traversal, and the success of NAT traversal depends on the combination of NAT types of the communicating parties, by obtaining the first NAT type of the client and the second NAT type of the network-attached storage device, the NAT traversal success rate of the point-to-point access path can be determined based on the first and second NAT types. By calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data of the point-to-point access path, that is, by using the penetration success rate as an influencing factor in the calculation of the final quality assessment data, the availability of the point-to-point access path is accurately assessed, thereby improving the reliability of the final quality assessment data. This, in turn, improves the accuracy and reliability of the final network access path selected based on the final quality assessment data and the second quality assessment data.
[0006] In one possible implementation, the quality indicators include at least: effective bandwidth, latency consistency, path stability, economic cost, and security level. By employing the aforementioned techniques, a standardized scoring model covering five indicators across three dimensions—performance (effective bandwidth, latency consistency, path stability), cost (economic cost), and security (security level)—is constructed. This model overcomes the limitations of existing technologies that rely solely on basic network performance indicators, making the selection of client access paths more reasonable in terms of both security and economy, and further improving the accuracy and reliability of client access path selection.
[0007] In one possible implementation, the client's network address translation (NAT) types include N types, and the network address translation (NAT) types of the network-attached storage device include M types, where N and M are both integers greater than 1. Before determining the penetration success rate of the point-to-point access path based on the first NAT type and the second NAT type, the method further includes: constructing a penetration success rate matrix table, wherein one of the header row and header column of the penetration success rate matrix table includes N types of client NAT types, and the other includes M types of network-attached storage device NAT types, and the cells of the penetration success rate matrix table represent preset penetration success rates; determining the penetration success rate of the point-to-point access path based on the first NAT type and the second NAT type includes: determining the target cell corresponding to the first NAT type and the second NAT type in the penetration success rate matrix table, where the penetration success rate is the target preset penetration success rate corresponding to the target cell. By employing the aforementioned technical means, the success rate of point-to-point access path penetration can be improved from a qualitative binary judgment of "available / unavailable" to a precise probability quantification score. This allows for accurate differentiation of the penetration difficulty of clients and network-attached storage devices under different combinations of network address translation types, avoiding blindly selecting or abandoning point-to-point access paths and further improving the reliability of client access path selection.
[0008] In one possible implementation, when the final network access path is a point-to-point access path, the method further includes: detecting whether the client and the network-attached storage device have established point-to-point communication, and determining, based on the detection result, the historical traversal success rate of the point-to-point access path when the client is of the first network address translation type and the network-attached storage device is of the second network address translation type; correcting the target preset traversal success rate based on the historical traversal success rate, and updating the target preset traversal success rate to the corrected target preset traversal success rate. By employing the above technical means, the target preset traversal success rate can be dynamically corrected based on the historical traversal success rate of the point-to-point access path, thereby improving the accuracy of the target preset traversal success rate, and consequently improving the accuracy of the final network access path selected based on the target preset traversal success rate.
[0009] In one possible implementation, before calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data, the method further includes: detecting whether the penetration success rate is less than a preset penetration probability threshold; if the penetration success rate is detected to be less than the preset penetration probability threshold, detecting whether the client and the network-attached storage device can establish a connection through the TURN relay service; if the connection can be established through the TURN relay service, calculating the equivalent connectivity probability of the TURN relay service based on the penetration success rate and a preset relay service connectivity factor, wherein the relay service connectivity factor is a constant greater than 0 and less than 1; and calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data, including: calculating the final quality assessment data based on the equivalent connectivity probability and the first quality assessment data. By employing the aforementioned technical means, even when the penetration success rate is low (i.e., the failure rate of point-to-point connections between the client and the network-attached storage device is high) and the client and the network-attached storage device can establish a connection through the TURN relay service, the data stream can be forwarded through the TURN relay service. This improves the success rate of establishing a connection between the client and the network-attached storage device, and further enhances the accuracy and reliability of the client's access path selection.
[0010] In one possible implementation, the quality indicators include multiple metrics. Before evaluating each candidate network access path according to the preset quality indicators, the method further includes: responding to a data transmission request and determining the client's data transmission scenario information based on the data transmission request; determining the weight corresponding to each quality indicator based on the data transmission scenario information; evaluating each candidate network access path according to the preset quality indicators to obtain quality evaluation data for the candidate network access path, including: for each candidate network access path, evaluating the candidate network access path according to each quality indicator to obtain sub-quality evaluation data for the candidate network access path under each quality indicator; and calculating the quality evaluation data based on the sub-quality evaluation data and the corresponding weights.
[0011] In one possible implementation, determining the client's data transmission scenario information based on the data transmission request includes: determining the data transmission scenario information based on the multi-dimensional characteristics of the data transmission request, wherein the multi-dimensional characteristics include at least one of the following: transmission protocol type, transmission data type, data volume, and read / write access mode; the data transmission scenario information is used to indicate the client's data transmission scenario, which may be a large file transmission scenario, a streaming media playback scenario, a real-time collaborative synchronization scenario, or a sensitive data transmission scenario.
[0012] In one possible implementation, there are P different types of original network access paths between the client and the network-attached storage device, where P is an integer greater than 1; determining multiple candidate network access paths between the client to be accessed and the network-attached storage device includes: performing reachability detection on each type of original network access path; and determining multiple candidate network access paths among the P types of original network access paths based on the detection results of the reachability detection.
[0013] A second aspect of this application also provides a client access path selection device, applied in a network attached storage (NAS) device, comprising: a first determining module, an evaluation module, a first path selection module, and a second path selection module; the first determining module is used to determine multiple candidate network access paths between the client to be accessed and the network attached storage device, wherein the multiple candidate network access paths include point-to-point access paths and / or other paths; the evaluation module is used to evaluate each candidate network access path according to preset quality indicators to obtain quality evaluation data of the candidate network access paths, wherein the quality evaluation data includes first quality evaluation data corresponding to the point-to-point access path and second quality evaluation data corresponding to the other paths; the first path selection module is used to select when... When multiple candidate network access paths include the point-to-point access path, the following steps are taken: First, the client's first network address translation type (NAT) and the network-attached storage device's second NAT. The success rate of the point-to-point access path is determined based on the first and second NATs. The final quality assessment data for the point-to-point access path is calculated based on the success rate and the first quality assessment data. The final network access path is then determined from among the multiple candidate network access paths based on the final and second quality assessment data. Alternatively, the second path selection module is used to determine the final network access path from among the multiple candidate network access paths based on the second quality assessment data corresponding to other paths when multiple candidate network access paths do not include the point-to-point access path.
[0014] A third aspect of this application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the client access path dynamic selection method of the first aspect.
[0015] The fourth aspect of this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the client access path dynamic selection method of the first aspect.
[0016] The fifth aspect of this application also provides a computer program product, including a computer program that, when executed by a processor, implements the client access path dynamic selection method of the first aspect.
[0017] Furthermore, the technical effects brought about by the second to fifth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description
[0018] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0019] Figure 1 This is a schematic diagram of a client accessing a network-attached storage device according to one embodiment of this application.
[0020] Figure 2 This is a schematic diagram of the implementation environment of the client access path dynamic selection system provided in one embodiment of this application.
[0021] Figure 3 This is a flowchart of one step of the dynamic selection method for client access path provided in one embodiment of this application.
[0022] Figure 4 This is another flowchart of the client access path dynamic selection method provided in one embodiment of this application.
[0023] Figure 5 This is another flowchart of the client access path dynamic selection method provided in one embodiment of this application.
[0024] Figure 6 This is a schematic diagram of the structure of a client access path dynamic selection device provided in one embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the functional modules of an electronic device provided in one embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0027] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, words such as "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary," "or," and "for example" is intended to present the relevant concepts in a concrete manner.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" means one or more. "More than one" means two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. It should be understood that the order of steps shown in the flowcharts herein can be changed, and some can be omitted.
[0029] To facilitate understanding of the embodiments of this application, the technical terms involved in this application will first be introduced: Network Attached Storage (NAS) devices provide centralized data storage, backup, sharing, and management services to home or business users via network connection, essentially acting as a private "home cloud" or "enterprise cloud" data center.
[0030] Network Address Translation (NAT) technology refers to the technique used in private networks that utilize NAT devices to establish a connection between the external internet and hosts on the internal local area network (LAN). Since most LAN devices do not have public IP addresses, external networks cannot directly access LAN services. NAT traversal bypasses this restriction through specific technical means, allowing external users to access devices or services within the LAN.
[0031] Network Address Translation (NAT) types: There are four types of NAT in P2P paths: Full Cone, Restricted Cone, Port Restricted Cone, and Symmetric NAT.
[0032] Full Cone NAT: Once an internal network address and port are mapped to an external network address and port, any external host can communicate with the internal host through that mapped address. This is the most P2P-friendly NAT type, with the highest success rate for traversal. Restricted Cone NAT: Only allows previously communicated external IP addresses to access the internal host, but does not restrict ports. It is more secure than Full Cone NAT and still relatively easy to achieve P2P traversal. Port Restricted Cone NAT: Requires that the external host's IP and port must be previously communicated with, making the restrictions stricter and the traversal slightly more difficult, but still supporting most P2P applications. Symmetric NAT: Each time communication occurs with a different external IP:Port, a different external port is assigned. The mapping relationship is bound to a four-tuple (source IP, source port, destination IP, destination port). It offers the highest security but is the most difficult to traverse; two Symmetric NAT devices typically cannot directly traverse each other.
[0033] STUN (Session Traversal Utilities for NAT) protocol: used to help clients behind NAT discover their public IP address and port, and determine the type of NAT they are in, thereby assisting two devices behind NAT to establish a UDP communication connection.
[0034] TURN relay service: This is a network protocol used to achieve real-time communication. Its full name is Traversal Using Relays around NAT. Its main function is to relay audio, video or data streams through a relay server on the public Internet when a direct P2P connection fails, so as to ensure that the two communicating parties can establish a connection.
[0035] like Figure 1As shown, NAS devices typically have multiple network access paths, including: LAN (Local Area Network) addresses for high-speed direct access within a local area network; WAN (Wide Area Network) addresses for remote direct access via a public IP address; PROXY addresses for relay access through a proxy server provided by the NAS manufacturer or a third party; and P2P (Peer-to-Peer) addresses for establishing a direct end-to-end connection using NAT traversal technology. When a client initiates access to the NAS, it faces the challenge of choosing the optimal path from these four options.
[0036] In existing technologies, multi-path routing schemes mainly suffer from the following problems: The routing strategy is out of sync with application scenarios: User access to NAS devices covers a variety of service types, such as large file backup and download, video and audio streaming, real-time collaborative synchronization of document databases, and sensitive data transmission. Different service types have significantly different priorities regarding network path quality—video streaming is sensitive to low latency and low jitter, large file transfers are sensitive to high bandwidth and stability, and sensitive data transmissions have the highest security requirements. However, existing solutions generally use fixed evaluation weights, applying the same routing strategy to all service types. This fails to dynamically adjust the importance of various quality indicators based on actual application scenarios, resulting in a mismatch between path selection results and service requirements, and preventing the achievement of global optimization.
[0037] The current approach to path evaluation relies on a single dimension: existing solutions primarily assess path quality based on fundamental network performance metrics such as latency, bandwidth, and packet loss rate. However, in NAS multi-path access scenarios, factors influencing the actual user experience extend far beyond network performance. These include crucial dimensions such as economic costs (e.g., WAN path traffic fees, PROXY path subscription fees) and security risks (e.g., PROXY path man-in-the-middle attack risks, unencrypted path data leakage risks). Existing technologies neglect cost and security assessments, resulting in blind spots in routing results regarding both economic efficiency and security.
[0038] The lack of quantitative methods for assessing the availability of point-to-point access paths: Point-to-point access paths are valuable for remote NAS access due to their advantages such as eliminating the need for relay servers and low transmission costs. However, the establishment of point-to-point connections is highly dependent on the success rate of NAT traversal, which in turn depends on the combination of NAT types of the communicating parties. For example, the success rate is close to 100% when both parties are using Full Cone NAT, while the success rate is extremely low when both parties are using Symmetric NAT. Existing solutions lack quantitative assessment methods for the probability of successful NAT traversal, treating point-to-point access paths as a binary state of "available" or "unavailable." This fails to accurately reflect the actual availability probability of point-to-point access paths in routing decisions, leading to either blind prioritization (fallback after traversal failure, increasing connection latency) or conservative abandonment (wasting potentially usable low-cost direct connection channels).
[0039] In view of the above, embodiments of this application provide a method, apparatus, device, medium, and program product for dynamic selection of client access paths, which can improve the accuracy and reliability of client access path selection.
[0040] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the implementation environment of the client access path dynamic selection system provided in the embodiments of this application.
[0041] Those skilled in the art will understand that Figure 2 The schematic diagram of the implementation environment of the client access path dynamic selection system shown is merely an example. The implementation environment described in this application embodiment is for the purpose of more clearly illustrating the technical solution of this application embodiment and does not constitute a limitation on the technical solution provided by this application embodiment. As those skilled in the art will know, with the emergence of new business scenarios, the technical solution provided by this application embodiment is also applicable to similar technical problems.
[0042] exist Figure 2 In this application, the client access path dynamic selection system provided in the embodiments may include a client 110 and a network auxiliary storage device 120. In some embodiments, the client access path dynamic selection system of this application may also include a server 130. The client access path dynamic selection device provided in the embodiments of this application may be integrated in the client 110, the network auxiliary storage device 120 or the server 130. The following embodiments will be described with the client access path dynamic selection device integrated in the network auxiliary storage device 120.
[0043] Server 130 can communicate with client 110 and network auxiliary storage device 120. For example, server 130 and client 110, and server 130 and network auxiliary storage device 120 can be connected by wired communication links or wireless communication links, etc. This application embodiment does not limit this.
[0044] It is understood that server 130 can be a standalone server, or a server network or server cluster. For example, server 130 described in the embodiments of this application includes, but is not limited to, computers, network hosts, single network servers, multiple sets of network servers, or cloud servers composed of multiple servers. Among them, cloud servers are composed of a large number of computers or network servers based on cloud computing.
[0045] Client 110 can receive NAS data transfer requests from users or other devices and send the NAS data transfer requests to network auxiliary storage device 120. Network auxiliary storage device 120 determines multiple candidate network access paths between client 110 and network auxiliary storage device 120 to execute the client access path dynamic selection method implemented in this embodiment, and determines the final network access path between client 110 and network auxiliary storage device 120 from multiple candidate network access paths.
[0046] The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0047] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating the steps of an embodiment of the dynamic client access path selection method of this application. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. This dynamic client access path selection method is preferably applicable to... Figure 2 The network-attached storage device 120 shown, but not limited thereto, can also be used in the client 110 or the server 130. This application embodiment does not limit this.
[0048] The specific process of this embodiment is as follows: Figure 3 As shown, it includes the following steps: Step 301: Determine multiple candidate network access paths between the client to be connected and the network-attached storage device, wherein the multiple candidate network access paths include point-to-point access paths and / or other paths.
[0049] In some embodiments, there are P different types of original network access paths between the client and the network-attached storage device, where P is an integer greater than 1; determining multiple candidate network access paths between the client to be accessed and the network-attached storage device includes: performing reachability detection on each type of original network access path, wherein different types of original network access paths correspond to different reachability detection methods; determining multiple candidate network access paths among the P types of original network access paths based on the detection results of the reachability detection; the determined candidate network access paths are divided into two types: (1) the candidate network access paths contain only point-to-point paths or contain both point-to-point paths and other paths, and (2) the candidate network access paths contain only other paths and do not contain point-to-point paths.
[0050] Please refer to this again. Figure 1 There are four original network access paths between the client and the network-attached storage device. The client can simultaneously or sequentially perform reachability detection on the four original network access paths and filter out unreachable paths.
[0051] Specifically, for LAN paths, the client probes the reachability of network-attached storage devices within the local area network using ARP requests or the mDNS protocol; for WAN paths, the client initiates a probe to the public IP address and port of the network-attached storage device using TCP SYN packets, and determines whether the WAN path is reachable based on the probe results; for PROXY paths, the client establishes a connection with the proxy server through an HTTPS handshake, verifies the availability of the proxy channel, and thus determines whether the PROXY path is reachable; for P2P paths, the client uses the STUN / ICE protocol to detect the NAT type of both the local end and the network-attached storage device, and probes or determines the P2P path as a candidate for network access based on the detection results.
[0052] Step 302: Evaluate each candidate network access path according to the preset quality indicators to obtain the quality evaluation data of the candidate network access path.
[0053] In some embodiments, the quality metrics include at least: effective bandwidth, latency consistency, path stability, economic cost, and security level.
[0054] In some embodiments, the weights corresponding to each quality metric can be preset, and the quality assessment data can be obtained by multiplying the sub-quality assessment data of the candidate network access path under each quality metric with the weights.
[0055] In some embodiments, the quality assessment data may be the normalized total score of the candidate network access path or the actual total score of the candidate network access path. This embodiment does not specifically limit the data type of the quality assessment data.
[0056] To facilitate understanding, the following example uses the normalized total score of the candidate network access path as the quality assessment data to illustrate how the quality assessment data of the candidate network access path is obtained in this embodiment: Assume the preset weight for effective bandwidth is 0.4, the preset weight for latency consistency is 0.1, the preset weight for path stability is 0.25, the preset weight for economic cost is 0.2, and the preset weight for security level is 0.05.
[0057] (1) Calculate the sub-quality assessment data corresponding to the effective bandwidth when the quality index is: i.e., the effective bandwidth score: The client sends a test data block of a preset size (e.g., 256KB) to the network-attached storage device to measure the actual transmission rate, which is then normalized using the following formula: Effective bandwidth score = min(measured bandwidth / target bandwidth, 1.0), where the target bandwidth is a preset bandwidth threshold.
[0058] (2) Calculate the sub-quality assessment data corresponding to the quality index of delayed consistency, i.e., the delayed consistency score: During the process of the client sending a test data block of a preset size to the network-attached storage device, RTT sampling is performed continuously a preset number of times (e.g., 10 times), and the coefficient of variation (CV) of the RTT is calculated. The CV is the ratio of the standard deviation to the mean, used to measure the relative dispersion of the data. In RTT sampling, CV reflects the stability of network latency fluctuations. The latency consistency score is calculated as 1 - min(measured CV / preset CV, 1). It can be understood that the latency consistency score reflects the stability of latency; the smaller the measured CV, the higher the score.
[0059] (3) Calculate the sub-quality assessment data corresponding to the quality index of path stability, i.e., the path stability score: The path stability score is calculated based on the path continuity reachability within a sliding time window (e.g., the most recent 5 minutes). For example, assuming that within 5 minutes, there are 100 LAN path reachability probes between the client and the network-attached storage device, and 98 of the probes show that the LAN path is reachable, then the LAN path stability score is 98 / 100 = 0.98.
[0060] It is worth noting that when performing the initial path stability score, since there is no historical data, the initial value for the path stability score is set according to the path type, such as LAN path = 0.95, WAN path = 0.80, PROXY path = 0.85, and P2P path = 0.70. It is understood that this embodiment does not impose a specific limitation on the value of the initial score; it can be set according to actual needs.
[0061] (4) Calculate the sub-quality assessment data corresponding to the quality index of economic cost, i.e., the economic cost score: The unit data transmission cost is determined by looking up a table based on the path type and then normalized: Economic cost score = 1 - min(unit cost / cost budget, 1), where the unit cost of LAN and P2P paths is 0, the unit cost of WAN paths is calculated based on traffic tariffs, and the unit cost of PROXY paths is amortized based on subscription fees.
[0062] (5) Calculate the sub-quality assessment data corresponding to the safety level when the quality index is: i.e., the safety level score: Please refer to Table 1. Based on the combination of path type and encryption status, a security score is determined through a predefined mapping table.
[0063]
[0064] Table 1 As shown in Table 1, different connection methods can lead to different security scores for the same path. Taking a LAN path as an example, if the client and the network-attached storage device are directly connected within the same subnet, the security score for the LAN path is 0.95; if the client and the network-attached storage device are connected across subnets, the security score for the LAN path is 0.85. It is understood that the security score values in Table 1 are only illustrative examples; in practical applications, different security score values can be set according to actual needs.
[0065] Assuming that the effective bandwidth score calculated in step (2) is 0.9, the delay consistency score is 0.8, the path stability score is 0.95, the economic cost score is 1, and the security level score is 0.85, then the quality assessment data of the candidate network access path is 0.9×0.4+0.8×0.1+0.95×0.25+1×0.2+0.85×0.05=0.92.
[0066] In some embodiments, since the determined candidate network access paths are divided into two types: (1) the candidate network access paths contain only point-to-point paths or both point-to-point paths and other paths, and (2) the candidate network access paths contain only other paths and do not contain point-to-point paths; therefore, there are two different path dynamic selection methods when determining the final access path from the candidate network access paths; when the candidate network access path is type (1), the path dynamic selection method in steps 303 to 305 is executed, and when the candidate network access path is type (2), the path dynamic selection method in step 306 is executed.
[0067] Step 303: When multiple candidate network access paths include point-to-point access paths, obtain the first network address translation type of the client and the second network address translation type of the network-attached storage device, and determine the penetration success rate of the point-to-point access path based on the first network address translation type and the second network address translation type.
[0068] In some embodiments, when the candidate network access path contains only a point-to-point path or contains both point-to-point paths and other paths, it is necessary to first determine the network address translation type of the client and the network-attached storage device.
[0069] In some embodiments, the network address translation type of the client includes N types, and the network address translation type of the network-attached storage device includes M types, where N and M are both integers greater than 1.
[0070] Specifically, the types of network address translation (NAT) for clients are the same as those for network-attached storage devices, including full cone NAT, address-restricted cone NAT, port-restricted cone NAT, and symmetric NAT.
[0071] In some embodiments, the STUN protocol can be used to identify the NAT type of the client and the network-attached storage device respectively, thereby obtaining the first network address translation type and the second network address translation type.
[0072] In some embodiments, before determining the penetration success rate of the peer-to-peer access path based on the first network address translation type and the second network address translation type, the method further includes: constructing a penetration success rate matrix table, wherein one of the header row and header column of the penetration success rate matrix table includes N types of network address translation types for clients, and the other includes M types of network address translation types for network auxiliary storage devices, and the cells of the penetration success rate matrix table are preset penetration success rates; determining the penetration success rate of the peer-to-peer access path based on the first network address translation type and the second network address translation type includes: determining the target cell corresponding to the first network address translation type and the second network address translation type in the penetration success rate matrix table, and the penetration success rate is the target preset penetration success rate corresponding to the target cell. By adopting the above technical means, the penetration success rate of the peer-to-peer access path can be improved from a qualitative binary judgment of "available / unavailable" to a precise probability quantification score, thereby accurately distinguishing the penetration difficulty of clients and network auxiliary storage devices under different combinations of network address translation types, avoiding blindly selecting or abandoning peer-to-peer access paths, and further improving the reliability of client access path selection.
[0073] To facilitate understanding, the following example uses the header row as the network address translation type of the network-attached storage device and the header column as the network address translation type of the client, combined with Table 2, to specifically explain how this embodiment determines the penetration success rate of the point-to-point access path:
[0074] Table 2 Table 2 is a network address translation (NAT) type traversal success rate matrix. After determining the client's first NAT type and the network-attached storage device's second NAT type, the traversal success rate can be determined by looking up the table.
[0075] In some embodiments, the penetration success rate matrix table is stored in the server 130. After the server 130 determines the first network address translation type and the second network address translation type, it retrieves the penetration success rate matrix table to find the penetration success rate that matches the first network address translation type and the second network address translation type.
[0076] Step 304: Calculate the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data.
[0077] In some embodiments, taking the first quality assessment data as the normalized total score of the point-to-point access path as an example, the penetration success rate and the normalized total score are multiplied to obtain the final quality assessment data, which is the total score obtained by multiplying the penetration success rate and the normalized total score.
[0078] In some embodiments, if the P2P path has not yet been established and the first quality assessment data corresponding to the P2P path cannot be calculated based on the previous quality assessment data calculation method, then a preset baseline quality value is used as the first quality assessment data corresponding to the P2P path. The preset baseline quality value can be 0.70, or it can be set according to the actual situation.
[0079] Step 305: Determine the final network access path from multiple candidate network access paths based on the final quality assessment data and the second quality assessment data.
[0080] In some embodiments, taking the case where both the final quality assessment data and the second quality assessment data are normalized total scores, the candidate network access path with the largest normalized total score is taken as the final network access path.
[0081] It is worth noting that, for each point-to-point access path, this embodiment also detects whether the client has successfully established point-to-point communication with the network auxiliary storage device through the point-to-point access path. The detection result is used to record whether the traversal attempt of each point-to-point access path fails or succeeds. Based on the detection result, the historical traversal success rate of the point-to-point access path is determined when the client is of the first network address translation type and the network auxiliary storage device is of the second network address translation type. The target preset traversal success rate is corrected based on the historical traversal success rate and updated to the corrected target preset traversal success rate.
[0082] Specifically, each time a client communicates with a network-attached storage device via a point-to-point access path, the server 130 records whether the communication connection was successfully established. Successful establishment indicates a successful point-to-point access path traversal attempt; otherwise, it indicates a traversal failure. The server dynamically adjusts the target preset traversal success rate in the traversal success rate matrix. This method improves the accuracy of the target preset traversal success rate, thereby improving the accuracy of the final network access path selected based on the target preset traversal success rate.
[0083] To facilitate understanding, the following examples, referring to Table 2, provide specific illustrations of how this embodiment achieves dynamic correction of the target preset penetration success rate: Assuming the client's first network address translation type is port-restricted cone and the network-attached storage device's second network address translation type is address-restricted cone, then by referring to Table 2, the corresponding target preset penetration success rate can be obtained as 0.80 in the fourth row and third column of Table 2.
[0084] Assuming the client and the network-attached storage device successfully establish peer-to-peer communication, and considering that the client uses port-restricted cone NAT and the network-attached storage device uses address-restricted cone NAT, the client and the network-attached storage device established a total of 99 peer-to-peer communications, with 89 successful. Therefore, the historical penetration success rate of the peer-to-peer access path is 0.90%.
[0085] The target preset penetration success rate is dynamically corrected according to the following formula: Corrected target preset penetration success rate = α × original target preset penetration success rate + (1-α) × historical success rate, where α is a preset smoothing coefficient. The size of α can be set according to actual needs, and this embodiment does not make specific limitations on it.
[0086] Assuming α is 0.7, the corrected target preset penetration success rate = 0.7 × 0.80 + 0.3 × 0.90 = 0.83. Therefore, the 0.80 in the fourth row and third column of Table 2 is corrected to 0.83.
[0087] Step 306: When multiple candidate network access paths do not include point-to-point access paths, determine the final network access path from among the multiple candidate network access paths based on the second quality assessment data corresponding to other paths.
[0088] In some embodiments, if the candidate network access path contains only other paths and does not contain point-to-point paths, then the candidate network access path with the largest second quality assessment data is taken as the final network access path.
[0089] As can be seen from the steps of this embodiment above, the core algorithm of this embodiment is based on a rule engine and weighted summation lookup table calculation, without relying on machine learning training or complex network topology analysis, and can be lightweightly integrated into the NAS client SDK. The collection methods of each indicator are all based on mature network protocols (STUN, ARP, mDNS, TCP SYN, HTTPS), requiring no additional infrastructure support. The core algorithm can complete prototype development in a short period of time, making it suitable for running on resource-constrained client devices.
[0090] Compared with related technologies, the embodiments of this application have at least the following advantages: After determining multiple candidate network access paths between the client to be accessed and the network-attached storage device, each candidate network access path is evaluated according to preset quality indicators to obtain quality evaluation data for each candidate network access path, thereby enabling a comprehensive evaluation of the candidate network access paths based on the quality evaluation data. For cases where multiple candidate network access paths do not include point-to-point access paths, the final network access path can be directly selected based on the second quality evaluation data. For cases where multiple candidate network access paths include point-to-point access paths, since the establishment of point-to-point access path connections highly depends on the success rate of network address translation (NAT) traversal, and the success of NAT traversal depends on the combination of NAT types of the communicating parties, by obtaining the first NAT type of the client and the second NAT type of the network-attached storage device, the NAT traversal success rate of the point-to-point access path can be determined based on the first and second NAT types. By calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data of the point-to-point access path, that is, by using the penetration success rate as an influencing factor in the calculation of the final quality assessment data, the availability of the point-to-point access path is accurately assessed, thereby improving the reliability of the final quality assessment data. This, in turn, improves the accuracy and reliability of the final network access path selected based on the final quality assessment data and the second quality assessment data.
[0091] Please refer to Figure 4 , Figure 4This is a flowchart illustrating the steps of an embodiment of the dynamic client access path selection method of this application. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. This dynamic client access path selection method is preferably applicable to... Figure 2 The network-attached storage device 120 shown, but not limited thereto, can also be used in the client 110 or the server 130. This application embodiment does not limit this.
[0092] This embodiment is a further improvement on the aforementioned embodiment. The main improvement lies in the following: In this embodiment, when the candidate network access path contains only point-to-point paths or contains both point-to-point paths and other paths, and the penetration success rate is less than a preset penetration probability threshold, and the client and the network auxiliary storage device can establish a connection through the TURN relay service, the equivalent connectivity probability of the TURN relay service is calculated. Based on the equivalent connectivity probability and the first quality assessment data, the final quality assessment data is calculated. Through the technical solution of this embodiment, even when the penetration success rate is low (i.e., the failure rate of point-to-point connections between the client and the network auxiliary storage device is high), and the client and the network auxiliary storage device can establish a connection through the TURN relay service, the data stream is forwarded through the TURN relay service, thereby improving the success rate of establishing a connection between the client and the network auxiliary storage device, and further improving the accuracy and reliability of the client's access path selection. The specific process of this embodiment is as follows: Figure 4 As shown, it includes the following steps: Step 401: Determine multiple candidate network access paths between the client to be connected and the network-attached storage device, wherein the multiple candidate network access paths include at least a point-to-point access path.
[0093] Step 402: Evaluate each candidate network access path according to the preset quality indicators to obtain the quality evaluation data of the candidate network access path.
[0094] Step 403: Obtain the first network address translation type of the client and the second network address translation type of the network-attached storage device.
[0095] Step 404: Determine the traversal success rate of the point-to-point access path based on the first network address translation type and the second network address translation type.
[0096] Step 405: Check if the penetration success rate is less than the preset penetration probability threshold. If the penetration success rate is less than the preset penetration probability threshold, proceed to step 406; otherwise, proceed to step 409.
[0097] In some embodiments, the size of the preset penetration probability threshold is not specifically limited and can be set according to actual needs. For example, the size of the preset penetration probability threshold can be set to 0.2, 0.3, etc.
[0098] Step 406: Check whether the client and the network-attached storage device can establish a connection through the TURN relay service. If a connection can be established through the TURN relay service, proceed to step 407; otherwise, proceed to step 409.
[0099] In some embodiments, the WebRTC Trickle ICE test page can be used to check whether a relay-type ICE candidate address is generated, thereby detecting whether the client and the network-attached storage device can establish a connection through the TURN relay service. It is understood that this embodiment does not specifically limit the detection method for whether the client and the network-attached storage device can establish a connection through the TURN relay service; different detection methods can be selected according to actual needs.
[0100] Step 407: Calculate the equivalent connectivity probability of the TURN relay service based on the penetration success rate and the preset relay service connection factor.
[0101] Specifically, the relay service connectivity factor is a constant greater than 0 and less than 1. In some embodiments, the size of the relay service connectivity factor is not specifically limited and can be set according to actual needs.
[0102] In some embodiments, the equivalent connectivity probability is calculated according to the following formula: Equivalent connectivity probability = Penetration success rate + (1 - Penetration success rate) × Relay service connection factor.
[0103] For example, assuming the relay service connectivity factor is 0.85, the preset penetration probability threshold is 0.3, and the penetration success rate is 0.2, then the equivalent connectivity probability = 0.2 + (1 - 0.2) × 0.85 = 0.88.
[0104] Step 408: Calculate the final quality assessment data based on the equivalent connectivity probability and the first quality assessment data.
[0105] In some embodiments, taking the first quality assessment data as the normalized total score of the point-to-point access path as an example, the final quality assessment data can be obtained by multiplying the equivalent connectivity probability and the normalized total score. The final quality assessment data is the total score obtained by multiplying the equivalent connectivity probability and the normalized total score.
[0106] Step 409: Calculate the final quality assessment data based on the penetration success rate and the first quality assessment data.
[0107] Step 410: Determine the final network access path from multiple candidate network access paths based on the final quality assessment data and the second quality assessment data.
[0108] Steps 401 to 404, 409 and 410 in this embodiment are similar to steps 301 to 305 in the previous embodiment. To avoid repetition, they will not be described again here.
[0109] Compared with related technologies, the embodiments of this application have at least the following advantages: After determining multiple candidate network access paths between the client to be accessed and the network-attached storage device, each candidate network access path is evaluated according to preset quality indicators to obtain quality evaluation data for each candidate network access path, thereby enabling a comprehensive evaluation of the candidate network access paths based on the quality evaluation data. Since the establishment of a point-to-point access path connection highly depends on the success rate of network address translation (NAT) traversal, and the success of NAT traversal depends on the combination of NAT types of both communicating parties, by obtaining the first NAT type of the client and the second NAT type of the network-attached storage device, the NAT traversal success rate of the point-to-point access path can be determined based on the first and second NAT types. By calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data of the point-to-point access path, that is, by using the penetration success rate as an influencing factor in the calculation of the final quality assessment data, the availability of the point-to-point access path is accurately assessed, thereby improving the reliability of the final quality assessment data. This, in turn, improves the accuracy and reliability of the final network access path selected based on the final quality assessment data and the second quality assessment data.
[0110] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating the steps of an embodiment of the dynamic client access path selection method of this application. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. This dynamic client access path selection method is preferably applicable to... Figure 2 The network-attached storage device 120 shown, but not limited thereto, can also be used in the client 110 or the server 130. This application embodiment does not limit this.
[0111] This embodiment is a further improvement upon the aforementioned embodiment. The main improvement lies in the following: In this embodiment, the data transmission scenario information of the client is determined based on the client's data transmission request, and the weight corresponding to each quality indicator is determined based on the data transmission scenario information. When calculating the quality assessment data of candidate network access paths, sub-quality assessment data of the candidate network access paths under each quality indicator is obtained, and then the quality assessment data is calculated based on the sub-quality assessment data and the corresponding weights. By adopting the above technical solution, different configuration weights are used for different data transmission scenarios, thereby realizing a differentiated routing strategy. This ensures that the routing results match business requirements, avoids non-optimal routing caused by a one-size-fits-all fixed weight, and further improves the accuracy and reliability of client access path selection.
[0112] The specific process of this embodiment is as follows: Figure 5 As shown, it includes the following steps: Step 501: Respond to the client's data transmission request and determine the client's data transmission scenario information based on the data transmission request.
[0113] In some embodiments, the server 130 is provided with a scene recognizer, which automatically identifies data transmission scene information, i.e. application scene category, based on the multidimensional features of the current data transmission request.
[0114] Specifically, the multidimensional features include: transmission protocol type: obtained by parsing the data transmission request header, such as HTTP(S), SMB / CIFS, WebDAV, FTP, etc.; data type: determined by file extension or MIME type, such as .mp4 (video), .docx (document), .db (database), etc.; data volume: obtained by request body size or Content-Length field, distinguishing between small files (<1MB) and large files (>100MB); access mode: determined by read / write ratio and concurrency, distinguishing between streaming read, random read / write, and batch synchronization modes.
[0115] Based on the combined analysis of the above multi-dimensional features, server 130 classifies data transmission tasks into the following four application scenario categories: Scenario A - Large file transfer (backup / download): Large data volume, high requirements for bandwidth and stability; Scenario B - Streaming media playback (video / audio streaming): Streaming reading mode, sensitive to latency and jitter; Scenario C - Real-time collaborative synchronization (document editing / database synchronization): Random read / write mode, with the highest latency requirements; Scenario D - Sensitive data transmission (encrypted documents / private files): Sensitive attributes are marked according to data type, with the highest security requirements.
[0116] Step 502: Determine the weight of each quality indicator based on the data transmission scenario information.
[0117] In some embodiments, server 130 stores weight templates for various application scenarios. After determining the data transmission scenario information, the corresponding weight template can be determined, thereby obtaining the weight corresponding to each quality indicator.
[0118] To facilitate understanding, the following explanation, in conjunction with Table 3, details how the weight corresponding to each quality indicator is determined in this embodiment:
[0119] Table 3 Please refer to Table 3. The title column of Table 3 is the scenario category, and the title column is the type of quality indicator. After the server 130 determines the data transmission scenario information (i.e. scenario category), the server 130 can find the weight corresponding to each quality indicator by looking up Table 3.
[0120] It is worth noting that by setting quality indicators including effective bandwidth, latency consistency, path stability, economic cost, and security level, a standardized scoring model with five indicators across three dimensions—coverage performance (effective bandwidth, latency consistency, path stability), cost (economic cost), and security (security level)—was constructed. This model breaks through the limitations of existing technologies that rely solely on basic network performance indicators, making the selection of client access paths more reasonable in terms of security and economy, and further improving the accuracy and reliability of client access path selection.
[0121] It should also be noted that in practical applications, client users can also manually select the data transmission scenario category and manually set the weight corresponding to each quality indicator. This embodiment does not impose specific limitations on this.
[0122] Step 503: Determine multiple candidate network access paths between the client to be connected and the network-attached storage device, wherein the multiple candidate network access paths include point-to-point access paths and / or other paths.
[0123] Step 504: For each candidate network access path, evaluate the candidate network access path according to each quality index to obtain the sub-quality evaluation data of the candidate network access path under each quality index.
[0124] Step 505: Calculate the quality assessment data of the candidate network access path based on the sub-quality assessment data and the corresponding weights.
[0125] Step 506: When multiple candidate network access paths include point-to-point access paths, obtain the first network address translation type of the client and the second network address translation type of the network-attached storage device, and determine the penetration success rate of the point-to-point access path based on the first network address translation type and the second network address translation type.
[0126] Step 507: Calculate the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data.
[0127] Step 508: Determine the final network access path from multiple candidate network access paths based on the final quality assessment data and the second quality assessment data.
[0128] Step 509: When multiple candidate network access paths do not include point-to-point access paths, determine the final network access path from among the multiple candidate network access paths based on the second quality assessment data corresponding to other paths.
[0129] In some embodiments, after the client and the network-attached storage device establish a connection through the final network access path, the server 130 performs a lightweight re-evaluation at a default 30-second interval: only updating the two online metrics of latency consistency and path stability in real time; when the overall score drops by more than a preset threshold (e.g., 20%) compared to the initial score, a full re-evaluation is triggered (steps 505 to 509 are re-executed); if a network access path with a higher score exists after the full re-evaluation, the current connection is disconnected and the new network access path is switched.
[0130] Compared with related technologies, the embodiments of this application have at least the following advantages: After determining multiple candidate network access paths between the client to be accessed and the network-attached storage device, each candidate network access path is evaluated according to preset quality indicators to obtain quality evaluation data for each candidate network access path, thereby enabling a comprehensive evaluation of the candidate network access paths based on the quality evaluation data. Since the establishment of a point-to-point access path connection highly depends on the success rate of network address translation (NAT) traversal, and the success of NAT traversal depends on the combination of NAT types of both communicating parties, by obtaining the first NAT type of the client and the second NAT type of the network-attached storage device, the NAT traversal success rate of the point-to-point access path can be determined based on the first and second NAT types. By calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data of the point-to-point access path, that is, by using the penetration success rate as an influencing factor in the calculation of the final quality assessment data, the availability of the point-to-point access path is accurately assessed, thereby improving the reliability of the final quality assessment data. This, in turn, improves the accuracy and reliability of the final network access path selected based on the final quality assessment data and the second quality assessment data.
[0131] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.
[0132] Based on the same idea as the dynamic client access path selection method in the above embodiments, this application also provides a dynamic client access path selection device, which can be used to execute the above dynamic client access path selection method. For ease of explanation, the structural diagram of the embodiment of the dynamic client access path selection device only shows the parts related to the embodiments of this application. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0133] like Figure 6 As shown, the client access path dynamic selection device 60 includes a first determination module 601, an evaluation module 602, a first path selection module 603, and a second path selection module 604. In some embodiments, the above modules can be programmable software instructions stored in memory and executable by a processor. It is understood that in other embodiments, the above modules can also be program instructions or firmware embedded in the processor.
[0134] The first determining module 601 is used to determine multiple candidate network access paths between the client to be accessed and the network-attached storage device, wherein the multiple candidate network access paths include a point-to-point access path and / or other paths; The evaluation module 602 is used to evaluate each candidate network access path according to preset quality indicators to obtain quality evaluation data of the candidate network access path. The quality evaluation data includes first quality evaluation data corresponding to the point-to-point access path and second quality evaluation data corresponding to other paths. The first path selection module 603 is used to, when multiple candidate network access paths include a point-to-point access path, obtain the first network address translation type of the client and the second network address translation type of the network-attached storage device; determine the penetration success rate of the point-to-point access path based on the first network address translation type and the second network address translation type; calculate the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data; and determine the final network access path among multiple candidate network access paths based on the final quality assessment data and the second quality assessment data. The second path selection module 604 is used to determine the final network access path from among the multiple candidate network access paths based on the second quality assessment data corresponding to other paths when multiple candidate network access paths do not include a point-to-point access path.
[0135] It is not difficult to see that this embodiment is a system embodiment corresponding to the method embodiment, and this embodiment can be implemented in conjunction with the method embodiment. The relevant technical details mentioned in the method embodiment are still valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the method embodiment.
[0136] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units are absent in this embodiment.
[0137] Another aspect of this application embodiment also provides an electronic device, such as... Figure 7 As shown, it includes: at least one processor 701; and a memory 702 communicatively connected to at least one processor 701; wherein the memory 702 stores instructions executable by at least one processor 701, the instructions being executed by at least one processor 701 to enable at least one processor 701 to execute the client access path dynamic selection method described in any of the above method embodiments.
[0138] The memory 702 and processor 701 are connected via a bus, which can include any number of interconnecting buses and bridges. The bus connects various circuits of one or more processors 701 and memory 702 together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 701 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 701.
[0139] Processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 702 can be used to store data used by processor 701 during operation.
[0140] Another aspect of this application provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the above-described method embodiments.
[0141] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0142] In addition, embodiments of this application relate to a computer program product, including a computer program that, when executed by a processor, implements the above-described method embodiments.
[0143] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0144] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A method for dynamically selecting a client access path, characterized in that, When applied to network-attached storage (NAS) devices, the method includes: Determine multiple candidate network access paths between the client to be connected and the network-attached storage device, wherein the multiple candidate network access paths include point-to-point access paths and / or other paths; Each candidate network access path is evaluated according to a preset quality index to obtain quality evaluation data for the candidate network access path. The quality evaluation data includes first quality evaluation data corresponding to the point-to-point access path and second quality evaluation data corresponding to the other paths. When multiple candidate network access paths include the peer-to-peer access path, the first network address translation type (NAT) of the client and the second NAT of the network-attached storage device are obtained. The penetration success rate of the peer-to-peer access path is determined based on the first NAT and the second NAT. The final quality assessment data of the peer-to-peer access path is calculated based on the penetration success rate and the first quality assessment data. Finally, the final network access path is determined from the multiple candidate network access paths based on the final quality assessment data and the second quality assessment data. Alternatively... When none of the candidate network access paths include the peer-to-peer access path, the final network access path is determined from the candidate network access paths based on the second quality assessment data corresponding to the other paths.
2. The client access path dynamic selection method according to claim 1, characterized in that, The quality indicators include at least: effective bandwidth, latency consistency, path stability, economic cost, and security level.
3. The client access path dynamic selection method according to claim 1, characterized in that, The client's network address translation type includes N types, and the network address translation type of the network auxiliary storage device includes M types, where N and M are both integers greater than 1; Before determining the traversal success rate of the point-to-point access path based on the first network address translation type and the second network address translation type, the method further includes: Construct a penetration success rate matrix table, wherein one of the header row and header column of the penetration success rate matrix table includes N types of network address translation for the client, and the other includes M types of network address translation for the network auxiliary storage device, and the cell of the penetration success rate matrix table is a preset penetration success rate; Determining the traversal success rate of the point-to-point access path based on the first network address translation type and the second network address translation type includes: In the penetration success rate matrix table, a target cell corresponding to the first network address translation type and the second network address translation type is determined, and the penetration success rate is the target preset penetration success rate corresponding to the target cell.
4. The client access path dynamic selection method according to claim 3, characterized in that, When the final network access path is the point-to-point access path, the method further includes: Detect whether the client and the network-attached storage device have established peer-to-peer communication, and determine the historical traversal success rate of the peer-to-peer access path based on the detection result, when the client is of the first network address translation type and the network-attached storage device is of the second network address translation type; The target preset penetration success rate is corrected based on the historical penetration success rate, and the target preset penetration success rate is updated to the corrected target preset penetration success rate.
5. The client access path dynamic selection method according to claim 1, characterized in that, Before calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data, the method further includes: Detect whether the penetration success rate is less than a preset penetration probability threshold; If the penetration success rate is detected to be less than the preset penetration probability threshold, it is detected whether the client and the network-attached storage device can establish a connection through the TURN relay service. If a connection can be established through the TURN relay service, the equivalent connectivity probability of the TURN relay service is calculated based on the penetration success rate and the preset relay service connectivity factor, wherein the relay service connectivity factor is a constant greater than 0 and less than 1. The step of calculating the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data includes: The final quality assessment data is calculated based on the equivalent connectivity probability and the first quality assessment data.
6. The client access path dynamic selection method according to claim 1, characterized in that, The quality indicators include multiple metrics; before evaluating each candidate network access path according to the preset quality indicators, the following is also included: Responding to the data transmission request from the client, the system determines the data transmission scenario information of the client based on the data transmission request; The weight corresponding to each quality indicator is determined based on the data transmission scenario information. The step of evaluating each candidate network access path according to preset quality indicators to obtain quality evaluation data for the candidate network access paths includes: For each candidate network access path, the candidate network access path is evaluated according to each of the quality indicators to obtain the sub-quality evaluation data of the candidate network access path under each of the quality indicators; The quality assessment data is calculated based on the sub-quality assessment data and the corresponding weights.
7. The client access path dynamic selection method according to claim 6, characterized in that, Determining the data transmission scenario information of the client based on the data transmission request includes: The data transmission scenario information is determined based on the multidimensional features of the data transmission request, wherein the multidimensional features include at least one of transmission protocol type, transmission data type, data volume, and read / write access mode; the data transmission scenario information is used to indicate the data transmission scenario of the client, and the data transmission scenario is a large file transmission scenario, a streaming media playback scenario, a real-time collaborative synchronization scenario, or a sensitive data transmission scenario.
8. The client access path dynamic selection method according to claim 1, characterized in that, The client and the network-attached storage device include P different types of original network access paths, where P is an integer greater than 1; The determination of multiple candidate network access paths between the client to be accessed and the network-attached storage device includes: Perform reachability detection for each original network access path; Based on the reachability detection results, multiple candidate network access paths are determined from the P types of original network access paths.
9. A client access path dynamic selection device, characterized in that, The device, used in network attached storage (NAS) devices, includes: a first determination module, an evaluation module, a first path selection module, and a second path selection module; The first determining module is used to determine multiple candidate network access paths between the client to be accessed and the network-attached storage device, wherein the multiple candidate network access paths include point-to-point access paths and / or other paths; The evaluation module is used to evaluate each of the candidate network access paths according to preset quality indicators to obtain quality evaluation data of the candidate network access paths. The quality evaluation data includes first quality evaluation data corresponding to the point-to-point access path and second quality evaluation data corresponding to the other paths. The first path selection module is configured to, when multiple candidate network access paths include the point-to-point access path, obtain the first network address translation type of the client and the second network address translation type of the network-attached storage device; determine the penetration success rate of the point-to-point access path based on the first network address translation type and the second network address translation type; calculate the final quality assessment data of the point-to-point access path based on the penetration success rate and the first quality assessment data; and determine the final network access path from the multiple candidate network access paths based on the final quality assessment data and the second quality assessment data; or, The second path selection module is used to determine the final network access path from among the multiple candidate network access paths based on the second quality assessment data corresponding to the other paths when the multiple candidate network access paths do not include the point-to-point access path.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the client access path dynamic selection method as described in any one of claims 1 to 8.
