Network communication path selection method based on delay and bandwidth relay comparison operator
Through the network communication path selection method based on the delay and bandwidth relay comparison operator, the problem of poor network connection quality in the prior art is solved, and network connections with lower latency and higher bandwidth are realized, thereby improving the network usage experience.
Patent Information
- Application Number
- CN202411670751.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The existing network communication path selection methods have the problem of poor network connection quality, especially inadequate performance in terms of latency and bandwidth.
Using a network communication path selection method based on the delay and bandwidth relay comparison operator, the candidate communication path list, delay list and bandwidth list are obtained by inputting the IP addresses of multiple public network relay servers, and the candidate communication path list is obtained based on the delay or bandwidth priority. Requirements, establish an optimal communication path list.
It improves the quality of network connections, reduces latency and bandwidth bottlenecks, meets the network usage needs in different scenarios, and improves the service quality of remote connections and audio and video calls.
Smart Images

Figure CN119155233B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a network communication path selection method based on a delay and bandwidth relay comparison operator. Background Art
[0002] Large and multinational companies usually have branches in different regions, and the data of the branches is usually encrypted and transmitted through the Internet. In order to meet the viewing experience of users in different regions, video and live broadcast platforms usually set up content distribution servers in different regions to increase the speed at which users obtain video resources. For ordinary people who need to work in different places, being able to quickly connect to a private computer behind a router is an important part of improving the office experience. Therefore, choosing a network path with the lowest possible latency and the highest possible transmission bandwidth for two hosts on the Internet is an important step to achieve all this.
[0003] Currently, there are three main methods for two hosts to establish a network connection: the first is the traditional point-to-point connection, which is usually used for Internet company websites and other services that need to be provided directly to the Internet. At least one host is required to have an IP address accessible to the public network. The two connected parties establish a direct connection through their respective IP addresses. The delay of this connection is only related to the operator's network, and the transmission bandwidth is the maximum bandwidth that the two hosts can occupy. It does not require the assistance of other network resources, but at least one party has a public IP to achieve it. Therefore, the implementation difficulty is relatively high; the second is to use cone NAT to establish a connection, which is usually used for services such as audio-visual platforms that distribute content in large quantities and quickly, and services such as WeChat voice calls that have certain requirements on network quality. Both connected parties are located behind the router and do not have a directly connectable public IP, but one of the NAT types is IP restricted cone or above or both parties are port restricted Cone type and above. At this time, the two parties can establish a direct connection through the NAT forwarding function of the router. The delay and bandwidth of this connection are the same as the first type of solution, and it is the solution with the lowest cost at the civilian level, but it requires at least one party's router to support cone NAT and the router is not a network performance bottleneck; the third type is to use a relay host to forward data packets, which is usually used for remote access tools such as Sunflower and ToDesk and other services that only guarantee connectivity. This method is generally used as a backup alternative when the first two methods are unavailable. Both hosts are connected to a third-party host that can be directly connected at the same time, and all data packets are forwarded through this third-party host. This solution is relatively easy to implement, but the connection delay and transmission bandwidth depend not only on the operator network and the maximum bandwidth of the two hosts, but also on the performance of the third-party host and its operator network delay and maximum bandwidth. Therefore, the network connection quality is relatively poor. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of poor network connection quality in the existing network communication path selection method, and propose a network communication path selection method based on delay and bandwidth relay comparison operator.
[0005] The specific process of the network communication path selection method based on the delay and bandwidth relay comparison operator is as follows:
[0006] S1, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList, and use MoonIPAddressList to obtain a candidate communication path list AbleMoonTraceRouteList, a candidate communication path delay list AbleMoonTraceRouteLatencyList, and a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList;
[0007] S2, using AbleMoonTraceRouteList and AbleMoonTraceRouteLatencyList to establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, the input of GetTraceRouteListForLatency is the target IP address IPAddressForLatency of the delay priority communication path to be acquired, and the output is the fastest communication path list from the local machine to IPAddressForLatency;
[0008] S3, using AbleMoonTraceRouteList and AbleMoonTraceRouteBandwidthList to establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, the input of GetTraceRouteListForBandwidth is the target IP address IPAddressForBandwidth of the bandwidth priority communication path to be acquired, and the output is a communication path list with the highest available bandwidth from the local machine to IPAddressForBandwidth;
[0009] S4, input the connection address ConnecToIP, use GetTraceRouteListForLatency and GetTraceRouteListForBandwidth to obtain the final communication path TraceRoute.
[0010] Furthermore, the input in S1 includes multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList, and MoonIPAddressList is used to obtain a candidate communication path list AbleMoonTraceRouteList, a candidate communication path delay list AbleMoonTraceRouteLatencyList, and a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList, specifically:
[0011] S101, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList;
[0012] S102, initializing a candidate communication path list AbleMoonTraceRouteList, initializing a candidate communication path delay list AbleMoonTraceRouteLatencyList, and initializing a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList;
[0013] Perform exhaustive permutation on each element in MoonIPAddressList and temporarily store the permutation results in AbleMoonTraceRouteList;
[0014] S103, initialize list counter ListCounter=1;
[0015] S104, obtain the temporarily stored candidate communication path AbleMoonTraceRoute = read the ListCounterth element of AbleMoonTraceRouteList;
[0016] S105, initialize the element counter SetCounter=1, the delay recorder LatencyLog=0, and the bandwidth recorder BandwidthLog=-1;
[0017] S106, if SetCounter=1, go to S107, otherwise go to S114;
[0018] S107, temporarily store the first relay network address CurrentMoonIP=read the SetCounterth element of AbleMoonTraceRoute;
[0019] S108, calculate the first relay network delay CurrentMoonIPLatency = the network delay from the local machine to CurrentMoonIP;
[0020] S109, update LatencyLog=LatencyLog+CurrentMoonIPLatency;
[0021] S110, calculating and temporarily storing the first relay network upload bandwidth CurrentMoonIPUploadBandwidth; calculating and temporarily storing the first relay network download bandwidth CurrentMoonIPDownloadBandwidth;
[0022] S111, temporarily store the first relay network bandwidth CurrentMoonIPBandwidth = the smaller value of CurrentMoonIPUploadBandwidth and CurrentMoonIPDownloadBandwidth;
[0023] S112, if BandwidthLog is -1, set BandwidthLog=CurrentMoonIPBandwidth; otherwise, set BandwidthLog=the smaller value between BandwidthLog and CurrentMoonIPBandwidth;
[0024] S113, set SetCounter=SetCounter+1, and go to S106;
[0025] S114, if SetCounter is greater than the number of elements in AbleMoonTraceRoute, go to S121, otherwise go to S115;
[0026] S115, temporarily store the secondary relay network address NextMoonIP=read the SetCounterth element of AbleMoonTraceRoute;
[0027] Temporarily store the front relay network address PervMoonIP=read the SetCounter-1th element of AbleMoonTraceRoute;
[0028] S116, passing NextMoonIP to PervMoonIP;
[0029] S117, temporarily store the secondary relay network delay NextMoonIPLatency = calculate the network delay from PervMoonIP to NextMoonIP;
[0030] UpdateLatencyLog=LatencyLog+NextMoonIPLatency;
[0031] S118, calculate and temporarily store the secondary relay network upload bandwidth NextMoonIPUploadBandwidth = the maximum upload bandwidth from PervMoonIP to NextMoonIP;
[0032] Calculate and temporarily store the secondary relay network download bandwidth NextMoonIPDownloadBandwidth = the maximum download bandwidth from PervMoonIP to NextMoonIP;
[0033] S119, temporarily storing the secondary relay network bandwidth NextMoonIPBandwidth=the smaller value between NextMoonIPUploadBandwidth and NextMoonIPDownloadBandwidth;
[0034] S120, BandwidthLog=take the smaller value of BandwidthLog and NextMoonIPBandwidth, and go to S113;
[0035] S121, storing LatencyLog into AbleMoonTraceRouteLatencyList, and storing BandwidthLog into AbleMoonTraceRouteBandwidthList;
[0036] S122, let ListCounter=ListCounter+1
[0037] S123, if ListCounter is greater than the number of elements in AbleMoonTraceRouteList, go to S124, otherwise go to S104;
[0038] S124, step S1 is completed.
[0039] Furthermore, the CurrentMoonIPUploadBandwidth in S110 = the maximum upload bandwidth from the local computer to CurrentMoonIP.
[0040] Furthermore, the CurrentMoonIPDownloadBandwidth in S110 = the maximum download bandwidth from the local computer to CurrentMoonIP.
[0041] Furthermore, in S2, the delay priority communication path list acquisition operator GetTraceRouteListForLatency is established by using AbleMoonTraceRouteList and AbleMoonTraceRouteLatencyList. The input of GetTraceRouteListForLatency is the target IP address IPAddressForLatency of the delay priority communication path to be acquired, and the output is the fastest communication path list from the local machine to IPAddressForLatency, specifically:
[0042] S201, establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, and input the target address IPAddressForLatency of the delay priority communication path to be acquired;
[0043] S202, the local machine and IPAddressForLatency try to establish direct communication, if the establishment is successful, go to S204, otherwise go to S203;
[0044] S203, the local machine and IPAddressForLatency try to establish cone NAT communication, if the establishment is successful, go to S204, otherwise go to S205;
[0045] S204, temporarily storing the delay IPLatency to the target address = the network delay from the local machine to IPAddressForLatency, and then go to S205;
[0046] S205, initialize the address mapping table counter MapCounter=1;
[0047] S206, temporarily store the relay address to be tested SpeedTestIPAddress=read the MapCounterth element of MoonIPAddressList;
[0048] S207, passing SpeedTestIPAddress to IPAddressForLatency;
[0049] S208, temporarily store the speed test result SpeedTestLatenccy=calculate the network delay from IPAddressForLatency to SpeedTestIPAddress;
[0050] S209, temporarily store the addend sequence list PendingLatencyPlusList = get the position of all elements in AbleMoonTraceRouteList with SpeedTestIPAddress as the last address;
[0051] S210, temporarily save the complete communication path delay list FullMoonTraceRouteLatencyList = copy AbleMoonTraceRouteLatencyList;
[0052] S211, initialize the self-increment counter PlusCounter=1;
[0053] S212, calculate the value of the PendingLatencyPlusList[PlusCounter]th element of FullMoonTraceRouteLatencyList = FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]] + SpeedTestLatenccy;
[0054] Among them, PendingLatencyPlusList[PlusCounter] is the PlusCounter-th element in PendingLatencyPlusList; FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]] is the PendingLatencyPlusList[PlusCounter]-th element in FullMoonTraceRouteLatencyList;
[0055] S213, let PlusCounter=PlusCounter+1;
[0056] S214, if PlusCounter is greater than the number of elements in PendingLatencyPlusList, go to S215, otherwise go to S212;
[0057] S215, set MapCounter=MapCounter+1;
[0058] S216, if MapCounter is greater than the number of elements in MoonIPAddressList, go to S217, otherwise go to S206;
[0059] S217, temporarily store the fastest transit delay FatestMoonLatency = take the smallest value element in FullMoonTraceRouteLatencyList;
[0060] Temporarily store the fastest transit path sequence number FatestMoonRouteNo=the position of FatestMoonLatency in FullMoonTraceRouteLatencyList;
[0061] S218, temporarily store the fastest transit route FastestTraceRoute = take the element No.FatestMoonLatencyNo in AbleMoonTraceRouteList;
[0062] S219, let FastestTraceRoute=FastestTraceRoute+IPAddressForLatency;
[0063] S220, if IPLatency exists and IPLatency is less than FastestMoonLatency, then overwrite FastestTraceRoute=direct communication from this machine to IPAddressForLatency; otherwise, go directly to S221;
[0064] S221, output FastestTraceRoute as the result of the GetTraceRouteListForLatency operator.
[0065] Furthermore, in S3, AbleMoonTraceRouteList and AbleMoonTraceRouteBandwidthList are used to establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, the input of GetTraceRouteListForBandwidth is the target IP address IPAddressForBandwidth of the bandwidth priority communication path to be acquired, and the output is a communication path list with the highest available bandwidth from the local machine to IPAddressForBandwidth, specifically:
[0066] S301, establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, and input the target address IPAddressForBandwidth of the bandwidth priority communication path to be acquired;
[0067] S302, the local machine tries to establish direct communication with IPAddressForBandwidth, if the establishment is successful, go to S304, otherwise go to S303;
[0068] S303, the local machine and IPAddressForBandwidth try to establish cone NAT communication, if the establishment is successful, go to S304, otherwise go to S306;
[0069] S304, calculating and temporarily storing the target address upload bandwidth IPUploadBandwidth;
[0070] Calculate and temporarily store the target address download bandwidth IPDownloadBandwidth;
[0071] S305, temporarily store the target address network bandwidth IPBandwidth = take the smaller value of IPUploadBandwidth and IPDownloadBandwidth, and then go to S306;
[0072] S306, initialize the address mapping table counter HashMapCounter = 1;
[0073] S307, temporarily store the wide relay address to be tested BandTestIPAddress=read the HashMapCounterth element of MoonIPAddressList;
[0074] S308, passing BandTestIPAddress to IPAddressForBandwidth;
[0075] S309, calculate and temporarily store the maximum upload bandwidth from the relay address upload bandwidth BandTestUploadBandwidth=IPAddressForBandwidth to BandTestIPAddress;
[0076] Calculate and temporarily store the maximum download bandwidth from the relay address download bandwidth BandTestDownloadBandwidth = IPAddressForBandwidth to BandTestIPAddress;
[0077] S310, temporarily storing the relay bandwidth measurement result BandTestBandwidth = the smaller value of BandTestUploadBandwidth and BandTestDownloadBandwidth;
[0078] S311, temporary comparison sequence list PendingBandCompareList = get the position of all elements with BandTestIPAddress as the last address in AbleMoonTraceRouteList;
[0079] S312, temporarily save the complete communication path bandwidth list FullMoonTraceRouteBandwidthList=copy AbleMoonTraceRouteBandwidthList;
[0080] S313, initialize bandwidth mapping table counter KVCounter=1;
[0081] S314, calculate the value of the PendingBandCompareList[KVCounter]th element of FullMoonTraceRouteBandwidthList = the smaller value of FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] and BandTestBandwidth;
[0082] Among them, PendingBandCompareList[KVCounter] is the KVCounter-th element in PendingBandCompareList, and FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] is the PendingBandCompareList[KVCounter]-th element in FullMoonTraceRouteBandwidthList;
[0083] S315, set KVCounter=KVCounter+1;
[0084] S316, if KVCounter is greater than the number of elements in PendingBandCompareList, go to S317, otherwise go to S314;
[0085] S317, let HashMapCounter=HashMapCounter+1;
[0086] S318, if HashMapCounter is greater than the number of elements in MoonIPAddressList, go to S319, otherwise go to S307;
[0087] S319, temporarily store the best transit bandwidth WidestMoonBandwidth = take the largest value element in FullMoonTraceRouteBandwidthList;
[0088] Temporarily store the best transit path sequence number WidestMoonRouteNo=the position of WidestMoonBandwidth in FullMoonTraceRouteBandwidthList;
[0089] S320, temporarily store the best transit path WidestTraceRoute = take the WidestMoonRouteNo element in AbleMoonTraceRouteList;
[0090] S321, let WidestTraceRoute=WidestTraceRoute+IPAddressForBandwidth;
[0091] S322, if IPBandwidth exists and IPBandwidth is greater than WidestMoonBandwidth, then overwrite the direct communication from WidestTraceRoute=this machine to IPAddressForBandwidth; otherwise, go directly to S323;
[0092] S323, output WidestTraceRoute as the result of the GetTraceRouteListForBandwidth operator.
[0093] Furthermore, the IPUploadBandwidth in S304 = the maximum upload bandwidth from the local machine to IPAddressForBandwidth.
[0094] Furthermore, the IPDownloadBandwidth in S304 = the maximum download bandwidth from the local machine to IPAddressForBandwidth.
[0095] Furthermore, the input connection address ConnecToIP in S5 uses GetTraceRouteListForLatency and GetTraceRouteListForBandwidth to obtain the final communication path TraceRoute, specifically:
[0096] S401, input the connection address ConnecToIP;
[0097] The ConnecToIP contains the following fields:
[0098] IPAddress: The IP address to connect to;
[0099] Preferred: Preferred network path. Preferred can be Latency or Bandwidth. The initial default value of Preferred is Latency.
[0100] S402, initializing the communication path TraceRoute;
[0101] S403, if ConnecToIP.Preferred= Bandwidth, go to S405; otherwise, go to S404;
[0102] Where, ConnecToIP.Preferred is the Preferred field in ConnecToIP;
[0103] S404, using GetTraceRouteListForLatency to obtain TraceRoute and update TraceRoute, and then go to S406;
[0104] The input of GetTraceRouteListForLatency is ConnecToIP.IPAddress;
[0105] Wherein, ConnecToIP.IPAddress is the IPAddress field in ConnecToIP;
[0106] S405, using GetTraceRouteListForBandwidth to obtain TraceRoute and update TraceRoute, and then go to S406;
[0107] S406, output TraceRoute as the final result.
[0108] Furthermore, the input of GetTraceRouteListForBandwidth in S405 is ConnecToIP.IPAddress.
[0109] The beneficial effects of the present invention are:
[0110] The present invention provides a network communication path selection method of a delay and bandwidth relay comparison operator. An interconnection delay and bandwidth comparison operator of a relay network node is established, which can analyze the network quality of two hosts, and according to the connection requirements of the two hosts, a relay connection pool is used to ensure the connection connectivity between the hosts, while minimizing the delay of both connected parties as much as possible, and maximizing the available bandwidth as much as possible, thereby improving the network connection quality. The present invention can not only ensure that the two hosts are connected to each other without being restricted by geographical space and network resources, but also reduce delays and avoid bandwidth bottlenecks. At the same time, it can reduce costs, improve the quality of network connections, and meet network usage requirements in different scenarios. The present invention greatly improves the service quality of personal remote connections and audio and video calls, and can optimize the content distribution service quality of the audio-visual platform, and realize the use of the Internet to transmit any data including encrypted data; the present invention has high scalability and can carry any network layer-based business, meeting the needs of remote networking. BRIEF DESCRIPTION OF THE DRAWINGS
[0111] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0112] Specific implementation method 1: Figure 1 As shown, the specific process of the network communication path selection method based on the delay and bandwidth relay comparison operator in this embodiment is as follows:
[0113] S1, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList, and use MoonIPAddressList to obtain a candidate communication path list AbleMoonTraceRouteList, a candidate communication path delay list AbleMoonTraceRouteLatencyList, and a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList, specifically:
[0114] S101, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList;
[0115] S102, initializing a candidate communication path list AbleMoonTraceRouteList, initializing a candidate communication path delay list AbleMoonTraceRouteLatencyList, and initializing a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList;
[0116] Perform exhaustive permutation on each element in MoonIPAddressList and temporarily store the permutation results in AbleMoonTraceRouteList;
[0117] S103, initialize list counter ListCounter=1;
[0118] S104, obtain the temporarily stored candidate communication path AbleMoonTraceRoute = read the ListCounterth element of AbleMoonTraceRouteList;
[0119] S105, initialize the element counter SetCounter=1, the delay recorder LatencyLog=0, and the bandwidth recorder BandwidthLog=-1;
[0120] S106, if SetCounter=1, go to S107, otherwise go to S114;
[0121] S107, temporarily store the first relay network address CurrentMoonIP=read the SetCounterth element of AbleMoonTraceRoute;
[0122] S108, calculate the first relay network delay CurrentMoonIPLatency = the network delay from the local machine to CurrentMoonIP;
[0123] S109, update LatencyLog=LatencyLog+CurrentMoonIPLatency;
[0124] S110, calculate and temporarily store the first relay network upload bandwidth CurrentMoonIPUploadBandwidth = the maximum upload bandwidth from the local machine to CurrentMoonIP;
[0125] Calculate and temporarily store the first relay network download bandwidth CurrentMoonIPDownloadBandwidth = the maximum download bandwidth from the local machine to CurrentMoonIP;
[0126] S111, temporarily store the first relay network bandwidth CurrentMoonIPBandwidth = the smaller value of CurrentMoonIPUploadBandwidth and CurrentMoonIPDownloadBandwidth;
[0127] S112, if BandwidthLog is -1, set BandwidthLog=CurrentMoonIPBandwidth; otherwise, set BandwidthLog=the smaller value of BandwidthLog and CurrentMoonIPBandwidth;
[0128] S113, set SetCounter=SetCounter+1, and go to S106;
[0129] S114, if SetCounter is greater than the number of elements in AbleMoonTraceRoute, go to S121, otherwise go to S115;
[0130] S115, temporarily store the secondary relay network address NextMoonIP=read the SetCounterth element of AbleMoonTraceRoute, temporarily store the pre-relay network address PervMoonIP=read the SetCounter-1th element of AbleMoonTraceRoute;
[0131] S116, passing NextMoonIP to PervMoonIP;
[0132] S117, temporarily store the secondary relay network delay NextMoonIPLatency=calculate the network delay from PervMoonIP to NextMoonIP, and update LatencyLog=LatencyLog+NextMoonIPLatency;
[0133] S118, calculate and temporarily store the secondary relay network upload bandwidth NextMoonIPUploadBandwidth=the maximum upload bandwidth from PervMoonIP to NextMoonIP, calculate and temporarily store the secondary relay network download bandwidth NextMoonIPDownloadBandwidth=the maximum download bandwidth from PervMoonIP to NextMoonIP;
[0134] S119, temporarily storing the secondary relay network bandwidth NextMoonIPBandwidth = the smaller value of NextMoonIPUploadBandwidth and NextMoonIPDownloadBandwidth;
[0135] S120, BandwidthLog=take the smaller value of BandwidthLog and NextMoonIPBandwidth, and go to S113;
[0136] S121, storing LatencyLog into AbleMoonTraceRouteLatencyList, and storing BandwidthLog into AbleMoonTraceRouteBandwidthList;
[0137] S122, let ListCounter=ListCounter+1
[0138] S123, if ListCounter is greater than the number of elements in AbleMoonTraceRouteList, go to S124, otherwise go to S104;
[0139] S124, this step is completed.
[0140] S2, establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, input the target IP address IPAddressForLatency of the delay priority communication path to be acquired, and output the fastest communication path list from the local machine to IPAddressForLatency, specifically:
[0141] S201, establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, and input the target address IPAddressForLatency of the delay priority communication path to be acquired;
[0142] S202, the local machine and IPAddressForLatency try to establish direct communication, if the establishment is successful, go to S204, otherwise go to S203;
[0143] S203, the local machine and IPAddressForLatency try to establish cone NAT communication, if the establishment is successful, go to S204, otherwise go to S205;
[0144] S204, temporarily storing the delay IPLatency to the target address = the network delay from the local machine to IPAddressForLatency, and then go to S205;
[0145] S205, initialize the address mapping table counter MapCounter=1;
[0146] S206, temporarily store the relay address to be tested SpeedTestIPAddress=read the MapCounterth element of MoonIPAddressList;
[0147] S207, passing SpeedTestIPAddress to IPAddressForLatency;
[0148] S208, temporarily store the speed test result SpeedTestLatenccy=calculate the network delay from IPAddressForLatency to SpeedTestIPAddress;
[0149] S209, temporarily store the addend sequence list PendingLatencyPlusList = get the position of all elements in AbleMoonTraceRouteList with SpeedTestIPAddress as the last address;
[0150] S210, temporarily save the complete communication path delay list FullMoonTraceRouteLatencyList = copy AbleMoonTraceRouteLatencyList;
[0151] S211, initialize the self-increment counter PlusCounter=1;
[0152] S212, calculate the value of the PendingLatencyPlusList[PlusCounter]th element of FullMoonTraceRouteLatencyList = FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]] + SpeedTestLatenccy;
[0153] Among them, PendingLatencyPlusList[PlusCounter] is the PlusCounter-th element in PendingLatencyPlusList; FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]] is the PendingLatencyPlusList[PlusCounter]-th element in FullMoonTraceRouteLatencyList;
[0154] S213, let PlusCounter=PlusCounter+1;
[0155] S214, if PlusCounter is greater than the number of elements in PendingLatencyPlusList, go to S215, otherwise go to S212;
[0156] S215, set MapCounter=MapCounter+1;
[0157] S216, if MapCounter is greater than the number of elements in MoonIPAddressList, go to S217, otherwise go to S206;
[0158] S217, temporarily store the fastest transit delay FatestMoonLatency = take the smallest value element in FullMoonTraceRouteLatencyList;
[0159] Temporarily store the fastest transit path sequence number FatestMoonRouteNo=the position of FatestMoonLatency in FullMoonTraceRouteLatencyList;
[0160] S218, temporarily store the fastest transit route FastestTraceRoute = take the element No.FatestMoonLatencyNo in AbleMoonTraceRouteList;
[0161] S219, let FastestTraceRoute=FastestTraceRoute+IPAddressForLatency;
[0162] S220, if IPLatency exists and IPLatency is less than FastestMoonLatency, then overwrite FastestTraceRoute=direct communication from this machine to IPAddressForLatency; otherwise, go directly to S221;
[0163] S221, output FastestTraceRoute as the result of the GetTraceRouteListForLatency operator.
[0164] S3, establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, input the target IP address IPAddressForBandwidth of the bandwidth priority communication path to be acquired, and output the communication path list with the highest available bandwidth from the local machine to IPAddressForBandwidth, specifically:
[0165] S301, establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, and input the target address IPAddressForBandwidth of the bandwidth priority communication path to be acquired;
[0166] S302, the local machine tries to establish direct communication with IPAddressForBandwidth, if the establishment is successful, go to S304, otherwise go to S303;
[0167] S303, the local machine and IPAddressForBandwidth try to establish cone NAT communication, if the establishment is successful, go to S304, otherwise go to S306;
[0168] S304, calculate and temporarily store the target address upload bandwidth IPUploadBandwidth = the maximum upload bandwidth from the local machine to IPAddressForBandwidth;
[0169] Calculate and temporarily store the target address download bandwidth IPDownloadBandwidth = the maximum download bandwidth from the local machine to IPAddressForBandwidth;
[0170] S305, temporarily store the target address network bandwidth IPBandwidth = take the smaller value of IPUploadBandwidth and IPDownloadBandwidth, and then go to S306;
[0171] S306, initialize the address mapping table counter HashMapCounter = 1;
[0172] S307, temporarily store the wide relay address to be tested BandTestIPAddress=read the HashMapCounterth element of MoonIPAddressList;
[0173] S308, passing BandTestIPAddress to IPAddressForBandwidth;
[0174] S309, calculate and temporarily store the maximum upload bandwidth from the relay address upload bandwidth BandTestUploadBandwidth=IPAddressForBandwidth to BandTestIPAddress;
[0175] Calculate and temporarily store the maximum download bandwidth from the relay address download bandwidth BandTestDownloadBandwidth = IPAddressForBandwidth to BandTestIPAddress;
[0176] S310, temporarily storing the relay bandwidth measurement result BandTestBandwidth = the smaller value of BandTestUploadBandwidth and BandTestDownloadBandwidth;
[0177] S311, temporary comparison sequence list PendingBandCompareList = get the position of all elements with BandTestIPAddress as the last address in AbleMoonTraceRouteList;
[0178] S312, temporarily save the complete communication path bandwidth list FullMoonTraceRouteBandwidthList=copy AbleMoonTraceRouteBandwidthList;
[0179] S313, initialize bandwidth mapping table counter KVCounter=1;
[0180] S314, calculate the value of the PendingBandCompareList[KVCounter]th element of FullMoonTraceRouteBandwidthList = the smaller value of FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] and BandTestBandwidth;
[0181] Among them, PendingBandCompareList[KVCounter] is the KVCounter-th element in PendingBandCompareList, and FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] is the PendingBandCompareList[KVCounter]-th element in FullMoonTraceRouteBandwidthList;
[0182] S315, set KVCounter=KVCounter+1;
[0183] S316, if KVCounter is greater than the number of elements in PendingBandCompareList, go to S317, otherwise go to S314;
[0184] S317, let HashMapCounter=HashMapCounter+1;
[0185] S318, if HashMapCounter is greater than the number of elements in MoonIPAddressList, go to S319, otherwise go to S307;
[0186] S319, temporarily store the best transit bandwidth WidestMoonBandwidth = take the largest value element in FullMoonTraceRouteBandwidthList;
[0187] Temporarily store the best transit path sequence number WidestMoonRouteNo=the position of WidestMoonBandwidth in FullMoonTraceRouteBandwidthList;
[0188] S320, temporarily store the best transit path WidestTraceRoute = take the WidestMoonRouteNo element in AbleMoonTraceRouteList;
[0189] S321, let WidestTraceRoute=WidestTraceRoute+IPAddressForBandwidth;
[0190] S322, if IPBandwidth exists and IPBandwidth is greater than WidestMoonBandwidth, then overwrite the direct communication from WidestTraceRoute=this machine to IPAddressForBandwidth; otherwise, go directly to S323;
[0191] S323, output WidestTraceRoute as the result of the GetTraceRouteListForBandwidth operator.
[0192] S4, input the connection address ConnecToIP, use GetTraceRouteListForLatency and GetTraceRouteListForBandwidth to obtain the final communication path TraceRoute, specifically:
[0193] S401, input the connection address ConnecToIP;
[0194] The ConnecToIP contains the following fields:
[0195] IPAddress: The IP address to connect to;
[0196] Preferred: Preferred network path, either "Latency" or "Bandwidth". The default is "Latency";
[0197] S402, initializing the communication path TraceRoute;
[0198] S403, if ConnecToIP.Preferred= Bandwidth, go to S405; otherwise, go to S404;
[0199] Where, ConnecToIP.Preferred is the Preferred field in ConnecToIP;
[0200] S404, using GetTraceRouteListForLatency to obtain TraceRoute and update TraceRoute, and then go to S406;
[0201] The input IPAddressForLatency of GetTraceRouteListForLatency is ConnecToIP.IPAddress;
[0202] S405, using GetTraceRouteListForBandwidth to obtain TraceRoute and update TraceRoute, and then go to S406;
[0203] The input IPAddressForBandwidth of GetTraceRouteListForBandwidth is ConnecToIP.IPAddress;
[0204] S406, output TraceRoute as the final result.
[0205] Embodiment: In order to verify the beneficial effects of the present invention, experiments were carried out according to specific implementation methods, specifically:
[0206] Enter three relay server IP addresses to form a relay server address list MoonIPAddressList, whose content is:
[0207] 111.aaa.aaa.aaa
[0208] 111.bbb.bbb.bbb
[0209] 43.ccc.ccc.ccc
[0210] The network delay and maximum bandwidth between the local machine and the relay server are calculated in turn, and the results are listed as follows:
[0211] Local to 111.aaa.aaa.aaa: 131ms 10Mbps
[0212] Local machine to 111.bbb.bbb.bbb: 97ms 6Mbps
[0213] Local machine to 43.ccc.ccc.ccc: 210ms 20Mbps
[0214] 111.aaa.aaa.aaa to 111.bbb.bbb.bbb: 4ms 6Mbps
[0215] 111.aaa.aaa.aaa to 43.ccc.ccc.ccc: 211ms 10Mbps
[0216] 111.bbb.bbb.bbb to 111.aaa.aaa.aaa: 4ms 6Mbps
[0217] 111.bbb.bbb.bbb to 43.ccc.ccc.ccc: 230ms 6Mbps
[0218] 43.ccc.ccc.ccc to 111.aaa.aaa.aaa: 145ms 10Mbps
[0219] 43.ccc.ccc.ccc to 111.bbb.bbb.bbb: 131ms 6Mbps
[0220] Get the exhaustive arrangement of candidate communication path list AbleMoonTraceRouteList as follows:
[0221] 1. [111.aaa.aaa.aaa]
[0222] 2. [111.bbb.bbb.bbb]
[0223] 3. [43.ccc.ccc.ccc]
[0224] 4. [111.aaa.aaa.aaa, 111.bbb.bbb.bbb]
[0225] 5. [111.aaa.aaa.aaa, 43.ccc.ccc.ccc]
[0226] 6. [111.bbb.bbb.bbb, 111.aaa.aaa.aaa]
[0227] 7. [111.bbb.bbb.bbb, 43.ccc.ccc.ccc]
[0228] 8. [43.ccc.ccc.ccc, 111.aaa.aaa.aaa]
[0229] 9. [43.ccc.ccc.ccc, 111.bbb.bbb.bbb]
[0230] 10. [111.aaa.aaa.aaa, 111.bbb.bbb.bbb, 43.ccc.ccc.ccc]
[0231] 11. [111.aaa.aaa.aaa, 43.ccc.ccc.ccc, 111.bbb.bbb.bbb]
[0232] 12. [111.bbb.bbb.bbb, 111.aaa.aaa.aaa, 43.ccc.ccc.ccc]
[0233] 13. [111.bbb.bbb.bbb, 43.ccc.ccc.ccc, 111.aaa.aaa.aaa]
[0234] 14. [43.ccc.ccc.ccc, 111.aaa.aaa.aaa, 111.bbb.bbb.bbb]
[0235] 15. [43.ccc.ccc.ccc, 111.bbb.bbb.bbb, 111.aaa.aaa.aaa]
[0236] Calculate the candidate communication path delay list AbleMoonTraceRouteLatencyList as follows: 1. 131 2. 97 3. 210 4. 135 5. 342 6. 101 7. 327 8. 355 9.341 10.365 11,473 12,312 13,375 14,359 15,345
[0252] The candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList is calculated as follows: 1, 10 2, 6 3.20 4, 6 5, 10 6.6 7, 6 8, 10 9,6 10,6 11,6 12, 6 13,6 14,6 15,6
[0268] Next, enter the three connection addresses ConnecToIP respectively to obtain the final communication path:
[0269] (1) Enter the connection address ConnecToIP as follows:
[0270] IPAddress: 20.ddd.ddd.ddd
[0271] Preferred: Latency
[0272] The local machine can establish direct communication with IPAddress, and the delay IPLatency to the target address is calculated to be 201ms;
[0273] The delay from the relay server to the IPAddress is as follows:
[0274] From 111.aaa.aaa.aaa: 90ms;
[0275] From 111.bbb.bbb.bbb: 98ms;
[0276] From 43.ccc.ccc.ccc: 46ms;
[0277] The full communication path delay list FullMoonTraceRouteLatencyList is calculated as follows:
[0278] 1. 131+90=221
[0279] 2. 97+98=195
[0280] 3. 210+46=256
[0281] 4. 135+98=233
[0282] 5. 342+46=388
[0283] 6. 101+90=191
[0284] 7. 327+46=373
[0285] 8. 355+90=445
[0286] 9. 341+98=439
[0287] 10. 365+46=411
[0288] 11. 473+98=571
[0289] 12. 312+46=358
[0290] 13. 375+90=465
[0291] 14. 359+98=457
[0292] 15. 345+90=435
[0293] The comparison shows that the value of the sixth element of FullMoonTraceRouteLatencyList is the lowest, which is 191 and is less than IPLatency.
[0294] Finally, [111.bbb.bbb.bbb, 111.aaa.aaa.aaa, 20.ddd.ddd.ddd] is obtained as the final communication path.
[0295] (2) Enter the connection address ConnecToIP as follows:
[0296] IPAddress: 20.ddd.ddd.ddd
[0297] Preferred: Bandwidth
[0298] The local machine and IPAddress can establish direct communication, and the target address network bandwidth IPBandwidth is calculated to be 500Mbps;
[0299] The network bandwidth from the relay server to the IPAddress is as follows:
[0300] To 111.aaa.aaa.aaa: 10Mbps;
[0301] To 111.bbb.bbb.bbb: 6Mbps;
[0302] To 43.ccc.ccc.ccc: 20Mbps;
[0303] The full communication path bandwidth list FullMoonTraceRouteBandwidthList is calculated as follows: 1, 10 2, 6 3.20 4, 6 5, 10 6.6 7, 6 8, 10 9,6 10,6 11,6 12, 6 13,6 14,6 15,6
[0319] The comparison shows that the value of FullMoonTraceRouteBandwidthList is not greater than IPBandwidth;
[0320] Finally, [20.ddd.ddd.ddd] is obtained as the final communication path.
[0321] (3) Enter the connection address ConnecToIP as follows:
[0322] IPAddress: 42.eee.eee.eee
[0323] Preferred: Latency
[0324] This machine cannot establish direct communication and cone NAT communication with IPAddress;
[0325] The network bandwidth from the relay server to the IPAddress is as follows:
[0326] From 111.aaa.aaa.aaa: 95ms;
[0327] From 111.bbb.bbb.bbb: 81ms;
[0328] From 43.ccc.ccc.ccc: 234ms;
[0329] The full communication path delay list FullMoonTraceRouteLatencyList is calculated as follows:
[0330] 1. 131+95=226
[0331] 2. 97+81=178
[0332] 3. 210+234=444
[0333] 4. 135+81=216
[0334] 5. 342+234=576
[0335] 6. 101+95=196
[0336] 7. 327+234=561
[0337] 8. 355+95=450
[0338] 9. 341+81=422
[0339] 10. 365+234=599
[0340] 11. 473+81=554
[0341] 12. 312+234=546
[0342] 13. 375+95=470
[0343] 14. 359+81=440
[0344] 15. 345+95=440
[0345] The comparison shows that the second element of FullMoonTraceRouteLatencyList has the lowest value, which is 178.
[0346] Finally, [111.bbb.bbb.bbb, 42.eee.eee.eee] is the final communication path.
[0347] This implementation verifies the effectiveness of the present invention, which can effectively handle the selection and optimization of communication paths in a complex network environment and improve network usage experience.
Claims
1. A network communication path selection method based on a delay and bandwidth relay comparison operator, characterized in that The specific process of the method is: S1, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList, and use MoonIPAddressList to obtain a candidate communication path list AbleMoonTraceRouteList, a candidate communication path delay list AbleMoonTraceRouteLatencyList, and a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList; S2, using AbleMoonTraceRouteList and AbleMoonTraceRouteLatencyList to establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, the input of GetTraceRouteListForLatency is the target IP address IPAddressForLatency of the delay priority communication path to be acquired, and the output is the fastest communication path list from the local machine to IPAddressForLatency, specifically: S201, establish a delay priority communication path list acquisition operator GetTraceRouteListForLatency, and input the target address IPAddressForLatency of the delay priority communication path to be acquired; S202, the local machine and IPAddressForLatency try to establish direct communication, if the establishment is successful, go to S204, otherwise go to S203; S203, the local machine and IPAddressForLatency try to establish cone NAT communication, if the establishment is successful, go to S204, otherwise go to S205; S204, temporarily storing the delay IPLatency to the target address = the network delay from the local machine to IPAddressForLatency, and then go to S205; S205, initializing the address mapping table counter MapCounter=1; S206, temporarily storing the relay address to be tested SpeedTestIPAddress=reading the MapCounterth element of MoonIPAddressList; S207, passing SpeedTestIPAddress to IPAddressForLatency; S208, temporarily storing the speed test result SpeedTestLatenccy=calculating the network delay from IPAddressForLatency to SpeedTestIPAddress; S209, temporarily store the addend sequence list PendingLatencyPlusList = get the position of all elements in AbleMoonTraceRouteList with SpeedTestIPAddress as the last address; S210, temporarily storing the complete communication path delay list FullMoonTraceRouteLatencyList = copying AbleMoonTraceRouteLatencyList; S211, initialize the self-increment counter PlusCounter=1; S212, calculate the value of the PendingLatencyPlusList[PlusCounter]th element of FullMoonTraceRouteLatencyList=FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]]+SpeedTestLatenccy; Among them, PendingLatencyPlusList[PlusCounter] is the PlusCounter-th element in PendingLatencyPlusList; FullMoonTraceRouteLatencyList[PendingLatencyPlusList[PlusCounter]] is the PendingLatencyPlusList[PlusCounter]-th element in FullMoonTraceRouteLatencyList; S213, let PlusCounter=PlusCounter+1; S214, if PlusCounter is greater than the number of elements in PendingLatencyPlusList, go to S215, otherwise go to S212; S215, set MapCounter=MapCounter+1; S216, if MapCounter is greater than the number of elements in MoonIPAddressList, go to S217, otherwise go to S206; S217, temporarily store the fastest transit delay FatestMoonLatency = take the smallest value element in FullMoonTraceRouteLatencyList; Temporarily store the fastest transit path sequence number FatestMoonRouteNo = the position of FatestMoonLatency in FullMoonTraceRouteLatencyList; S218, temporarily storing the fastest transit route FastestTraceRoute = taking the element No.FatestMoonLatencyNo in AbleMoonTraceRouteList; S219, let FastestTraceRoute=FastestTraceRoute+IPAddressForLatency; S220, if IPLatency exists and IPLatency is less than FastestMoonLatency, then overwrite FastestTraceRoute = direct communication from this machine to IPAddressForLatency; otherwise, go directly to S221; S221, output FastestTraceRoute as the result of GetTraceRouteListForLatency operator; S3, using AbleMoonTraceRouteList and AbleMoonTraceRouteBandwidthList to establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, the input of GetTraceRouteListForBandwidth is the target IP address IPAddressForBandwidth of the bandwidth priority communication path to be acquired, and the output is the communication path list with the highest available bandwidth from the local machine to IPAddressForBandwidth, specifically: S301, establish a bandwidth priority communication path list acquisition operator GetTraceRouteListForBandwidth, and input the target address IPAddressForBandwidth of the bandwidth priority communication path to be acquired; S302, the local machine tries to establish direct communication with IPAddressForBandwidth, if the establishment is successful, go to S304, otherwise go to S303; S303, the local machine and IPAddressForBandwidth try to establish cone NAT communication, if the establishment is successful, go to S304, otherwise go to S306; S304, calculating and temporarily storing the target address upload bandwidth IPUploadBandwidth; Calculate and temporarily store the target address download bandwidth IPDownloadBandwidth; S305, temporarily store the target address network bandwidth IPBandwidth = take the smaller value of IPUploadBandwidth and IPDownloadBandwidth, and then go to S306; S306, initialize the address map counter HashMapCounter = 1; S307, temporarily storing the wide relay address to be tested BandTestIPAddress=reading the HashMapCounterth element of MoonIPAddressList; S308, passing BandTestIPAddress to IPAddressForBandwidth; S309, calculate and temporarily store the maximum upload bandwidth of the relay address upload bandwidth BandTestUploadBandwidth=IPAddressForBandwidth to BandTestIPAddress; Calculate and temporarily store the relay address download bandwidth BandTestDownloadBandwidth = the maximum download bandwidth from IPAddressForBandwidth to BandTestIPAddress; S310, temporarily storing the relay bandwidth measurement result BandTestBandwidth = the smaller value of BandTestUploadBandwidth and BandTestDownloadBandwidth; S311, temporarily store comparison sequence list PendingBandCompareList = get the position of all elements with BandTestIPAddress as the last address in AbleMoonTraceRouteList; S312, temporarily storing the full communication path bandwidth list FullMoonTraceRouteBandwidthList = copying AbleMoonTraceRouteBandwidthList; S313, initialize bandwidth mapping table counter KVCounter=1; S314, calculate the value of the PendingBandCompareList[KVCounter]th element of FullMoonTraceRouteBandwidthList = the smaller value of FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] and BandTestBandwidth; Among them, PendingBandCompareList[KVCounter] is the KVCounter-th element in PendingBandCompareList, and FullMoonTraceRouteBandwidthList[PendingBandCompareList[KVCounter]] is the PendingBandCompareList[KVCounter]-th element in FullMoonTraceRouteBandwidthList; S315, set KVCounter=KVCounter+1; S316, if KVCounter is greater than the number of elements in PendingBandCompareList, go to S317, otherwise go to S314; S317, let HashMapCounter=HashMapCounter+1; S318, if HashMapCounter is greater than the number of elements in MoonIPAddressList, go to S319, otherwise go to S307; S319, temporarily storing the best transit bandwidth WidestMoonBandwidth = taking the largest value element in FullMoonTraceRouteBandwidthList; Temporarily store the best transit path sequence number WidestMoonRouteNo = the position of WidestMoonBandwidth in FullMoonTraceRouteBandwidthList; S320, temporarily storing the best transit route WidestTraceRoute = taking the WidestMoonRouteNo element in AbleMoonTraceRouteList; S321, let WidestTraceRoute=WidestTraceRoute+IPAddressForBandwidth; S322, if IPBandwidth exists and IPBandwidth is greater than WidestMoonBandwidth, then overwrite the direct communication from WidestTraceRoute = local machine to IPAddressForBandwidth; otherwise, directly go to S323; S323, output WidestTraceRoute as the result of GetTraceRouteListForBandwidth operator; S4, input the connection address ConnecToIP, use GetTraceRouteListForLatency and GetTraceRouteListForBandwidth to obtain the final communication path TraceRoute, specifically: S401, input the connection address ConnecToIP; The ConnecToIP contains the following fields: IPAddress: The IP address to connect to; Preferred: Preferred network path. Preferred can be Latency or Bandwidth. The initial default value of Preferred is Latency. S402, initializing the communication path TraceRoute; S403, if ConnecToIP.Preferred = Bandwidth, go to S405; otherwise, go to S404; Where ConnecToIP.Preferred is the Preferred field in ConnecToIP; S404, using GetTraceRouteListForLatency to obtain TraceRoute and update TraceRoute, and then go to S406; The input of GetTraceRouteListForLatency is ConnecToIP.IPAddress; Where ConnecToIP.IPAddress is the IPAddress field in ConnecToIP; S405, using GetTraceRouteListForBandwidth to obtain TraceRoute and update TraceRoute, and then go to S406; The input of GetTraceRouteListForBandwidth is ConnecToIP.IPAddress; S406, output TraceRoute as the final result.
2. The network communication path selection method based on the delay and bandwidth relay comparison operator according to claim 1 is characterized in that: In the step S1, multiple relay server IP addresses located in the public network are input to form a relay server address list MoonIPAddressList, and MoonIPAddressList is used to obtain a candidate communication path list AbleMoonTraceRouteList, a candidate communication path delay list AbleMoonTraceRouteLatencyList, and a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList, specifically: S101, input multiple relay server IP addresses located in the public network to form a relay server address list MoonIPAddressList; S102, initializing a candidate communication path list AbleMoonTraceRouteList, initializing a candidate communication path delay list AbleMoonTraceRouteLatencyList, and initializing a candidate communication path bandwidth list AbleMoonTraceRouteBandwidthList; Perform exhaustive permutation on each element in MoonIPAddressList and temporarily store the permutation results in AbleMoonTraceRouteList; S103, initialize list counter ListCounter = 1; S104, obtaining the temporarily stored candidate communication path AbleMoonTraceRoute = reading the ListCounterth element of AbleMoonTraceRouteList; S105, initializing element counter SetCounter=1, delay recorder LatencyLog=0, bandwidth recorder BandwidthLog=-1; S106, if SetCounter=1, go to S107, otherwise go to S114; S107, temporarily store the first relay network address CurrentMoonIP = read the SetCounterth element of AbleMoonTraceRoute; S108, calculating the first relay network delay CurrentMoonIPLatency = the network delay from the local machine to CurrentMoonIP; S109, update LatencyLog=LatencyLog+CurrentMoonIPLatency; S110, calculating and temporarily storing the first relay network upload bandwidth CurrentMoonIPUploadBandwidth; calculating and temporarily storing the first relay network download bandwidth CurrentMoonIPDownloadBandwidth; S111, temporarily storing the first relay network bandwidth CurrentMoonIPBandwidth = the smaller value of CurrentMoonIPUploadBandwidth and CurrentMoonIPDownloadBandwidth; S112, if BandwidthLog is -1, set BandwidthLog = CurrentMoonIPBandwidth; otherwise, set BandwidthLog = the smaller value between BandwidthLog and CurrentMoonIPBandwidth; S113, set SetCounter=SetCounter+1, and go to S106; S114, if SetCounter is greater than the number of elements in AbleMoonTraceRoute, go to S121, otherwise go to S115; S115, temporarily storing the secondary relay network address NextMoonIP=reading the SetCounterth element of AbleMoonTraceRoute; Temporarily store the front relay network address PervMoonIP = read the SetCounter-1th element of AbleMoonTraceRoute; S116, passing NextMoonIP to PervMoonIP; S117, temporarily storing the secondary relay network delay NextMoonIPLatency=calculating the network delay from PervMoonIP to NextMoonIP; Update LatencyLog=LatencyLog+NextMoonIPLatency; S118, calculate and temporarily store the secondary relay network upload bandwidth NextMoonIPUploadBandwidth = the maximum upload bandwidth from PervMoonIP to NextMoonIP; Calculate and temporarily store the secondary relay network download bandwidth NextMoonIPDownloadBandwidth = the maximum download bandwidth from PervMoonIP to NextMoonIP; S119, temporarily storing the secondary relay network bandwidth NextMoonIPBandwidth=the smaller value between NextMoonIPUploadBandwidth and NextMoonIPDownloadBandwidth; S120, BandwidthLog=take the smaller value of BandwidthLog and NextMoonIPBandwidth, and go to S113; S121, storing LatencyLog into AbleMoonTraceRouteLatencyList, and storing BandwidthLog into AbleMoonTraceRouteBandwidthList; S122, let ListCounter=ListCounter+1 S123, if ListCounter is greater than the number of elements in AbleMoonTraceRouteList, go to S124, otherwise go to S104; S124, step S1 is completed.
3. The network communication path selection method based on delay and bandwidth relay comparison operator according to claim 2 is characterized in that: The CurrentMoonIPUploadBandwidth in S110 = the maximum upload bandwidth from the local machine to CurrentMoonIP.
4. The network communication path selection method based on the delay and bandwidth relay comparison operator according to claim 3 is characterized in that: The CurrentMoonIPDownloadBandwidth in S110 = the maximum download bandwidth from the local device to CurrentMoonIP.
5. The network communication path selection method based on delay and bandwidth relay comparison operator according to claim 4 is characterized in that: The IPUploadBandwidth in S304 = the maximum upload bandwidth from the local machine to IPAddressForBandwidth.
6. The network communication path selection method based on delay and bandwidth relay comparison operator according to claim 5 is characterized in that: The IPDownloadBandwidth in S304 = the maximum download bandwidth from the local machine to IPAddressForBandwidth.