CN112422425A - Line determining method, device, gateway equipment and storage medium - Google Patents
Line determining method, device, gateway equipment and storage medium Download PDFInfo
- Publication number
- CN112422425A CN112422425A CN202011080595.8A CN202011080595A CN112422425A CN 112422425 A CN112422425 A CN 112422425A CN 202011080595 A CN202011080595 A CN 202011080595A CN 112422425 A CN112422425 A CN 112422425A
- Authority
- CN
- China
- Prior art keywords
- line
- ratio
- target
- time delay
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000001934 delay Effects 0.000 claims abstract description 38
- 238000001514 detection method Methods 0.000 claims description 67
- 230000004044 response Effects 0.000 claims description 10
- 230000005540 biological transmission Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 abstract description 61
- 238000010586 diagram Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
- H04L45/121—Shortest path evaluation by minimising delays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
- H04L45/123—Evaluation of link metrics
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
- H04L45/124—Shortest path evaluation using a combination of metrics
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the technical field of computers, and discloses a line determination method, a device, gateway equipment and a storage medium, wherein the method comprises the following steps: determining an average time delay of each of the at least two lines during a probing period; determining the ratio of the average time delay of each line to a target time delay, wherein the target time delay is determined according to the historical time delays of the at least two lines; and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located. According to the embodiment, the communication quality of the target using line is ensured, meanwhile, some unnecessary line switching is reduced, and the problem of frequent line switching caused by directly using the line with the shortest average time delay as the target using line is solved.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for determining a line, a gateway device, and a storage medium.
Background
With the advancement of technology, computer networks are rapidly developing. In a computer network, user equipment interacts with network side equipment through a broadband line preset in gateway equipment based on the gateway equipment.
In the related art, if a plurality of broadband lines are preset, the gateway device selects a line with the shortest time delay as a line for interacting with the network side device.
If the communication quality of the line is unstable, the line with the shortest time delay will change frequently, and the adoption of the scheme can cause frequent line switching and poor network stability.
Disclosure of Invention
The invention provides a line determining method, a line determining device, gateway equipment and a storage medium, which are used for avoiding frequent line switching.
In a first aspect, an embodiment of the present invention provides a line determining method, which is applied to a gateway device, where the gateway device performs data transmission with a connected network-side device through at least two preset lines, and the method includes:
determining an average time delay of each of the at least two lines during a probing period;
determining the ratio of the average time delay of each line to a target time delay, wherein the target time delay is determined according to the historical time delays of the at least two lines;
and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located.
According to the scheme, the gateway device performs data transmission with the connected network side device through at least two preset lines, and determines the ratio of the average time delay of each line to the target time delay by determining the average time delay of each line in the at least two lines in a detection period, namely the deviation of the average time delay of each line compared with the reference time delay, wherein the deviation reflects the communication quality of each line; the ratio of the average time delay of the currently used line to the target time delay in the determined ratio is the deviation of the average time delay of the currently used line compared with the reference time delay, the target ratio range of the minimum ratio in the determined ratio is the deviation range of the average time delay of the line with better communication quality compared with the reference time delay, whether the quality of the currently used line belongs to the better communication quality range can be accurately judged through the ratio corresponding to the currently used line and the target ratio range of the minimum ratio, and the subsequent target used line is determined based on the target used line, so that the communication quality of the target used line can be guaranteed, and meanwhile, unnecessary line switching can be reduced. The problem of frequent line switching caused by directly using the line with the shortest average time delay as the target using line is avoided.
Optionally, determining a target used line from the at least two lines according to the ratio of the average time delay of the currently used line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio of the determined ratios is located, includes:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
According to the scheme, the target ratio range in which the minimum ratio is located is the deviation range of the line with better communication quality compared with the reference time delay, the ratio of the average time delay of the currently used line to the target time delay is the deviation of the currently used line compared with the reference time delay, and if the ratio corresponding to the currently used line is in the target ratio range, even if the communication quality of the currently used line is not the best, the communication quality of the currently used line can be ensured to belong to the better communication quality range, so that the currently used line is continuously used, and frequent line switching is avoided.
Optionally, the method further comprises:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
According to the scheme, if the ratio corresponding to the currently used line is not in the target ratio range, the communication quality of the currently used line does not belong to a better communication quality range, line switching is needed, and the route with the best communication quality corresponding to the minimum ratio can be used as the target used line; any route with better communication quality can be selected as a target using route, and the method is suitable for requirements of different application scenes.
Optionally, before determining the target used line from the at least two lines according to the ratio of the average delay of the currently used line to the target delay in the determined ratios and the target ratio range in which the minimum ratio of the determined ratios is located, the method further includes:
determining a target ratio range in which the minimum ratio is located from a preset ratio range; or,
and adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining a target ratio range in which the minimum ratio is located from the new ratio range.
According to the scheme, the target ratio range in which the minimum ratio is located can be directly determined from a plurality of preset ratio ranges; the preset ratio range can be dynamically adjusted based on the historical ratio distribution of the at least two lines to obtain a new more reasonable ratio range, and the deviation range of the line with better communication quality can be more accurately represented by the target ratio range in which the minimum ratio determined from the new ratio range is located.
Optionally, determining an average time delay of each of the at least two lines in the probing period includes:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
In a second aspect, an embodiment of the present invention provides a line determining apparatus, including:
the time delay determining module is used for determining the average time delay of each of at least two lines in a detection period, wherein the at least two lines are preset lines used for data transmission with connected network side equipment;
a ratio determining module, configured to determine a ratio of an average delay of each line to a target delay, where the target delay is determined according to historical delays of the at least two lines;
and the line determining module is used for determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio in the determined ratios is located.
Optionally, the determining, by the line determining module, a target used line from the at least two lines according to the ratio of the average time delay of the currently used line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio of the determined ratios is located includes:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
Optionally, the route determining module is further configured to:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
Optionally, the ratio determination module is further configured to:
before the line determining module determines the target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in the determined ratios and the target ratio range where the minimum ratio in the determined ratios is located,
determining a target ratio range in which the minimum ratio is located from a preset ratio range; or,
and adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining a target ratio range in which the minimum ratio is located from the new ratio range.
Optionally, the delay determining module is specifically configured to:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
In a third aspect, an embodiment of the present invention provides a gateway device, including: a processor and a memory;
wherein the memory stores program code which, when executed by the processor, causes the processor to perform the steps of the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to the first aspect.
In addition, for technical effects brought by any one implementation manner of the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for determining a line according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another route determination method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of another method for determining a line according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a circuit determination apparatus according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a gateway device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.
In the present embodiment, A-B represents a range from A to B, and this range excludes A and includes B.
In the description of the present application, it is to be noted that, unless otherwise explicitly stated or limited, the term "connected" is to be understood broadly, and may for example be directly connected, indirectly connected through an intermediate medium, or be a communication between two devices. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
In a computer network, user equipment interacts with network side equipment through a broadband line preset in gateway equipment based on the gateway equipment. In the related art, if a plurality of broadband lines are preset, the gateway device selects a line with the shortest time delay as a line for interacting with the network side device.
If the communication quality of the line is unstable, the line with the shortest time delay will change frequently, and the adoption of the scheme can cause frequent line switching and poor network stability.
In order to avoid frequent line switching, embodiments of the present invention provide a line determining method, an apparatus, a gateway device, and a storage medium, and the present disclosure is further described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention. In this application scenario, a gateway device 100 and a network-side device 200 are included.
The gateway device 100 has at least two lines in advance, and the gateway device 100 may interact with the network-side device 200 through the at least two lines (the line 1, the line 2, the line 3, and the line 4 are illustrated as examples in the figure, and the actually predetermined lines may be more or less, and in addition, the line in the figure is illustrated as an example, and is not limited to a line).
The gateway device 100 may further determine an average time delay of each of the at least two lines in the probing period;
the ratio of the average time delay of each line to the target time delay can also be determined;
the target using line can also be determined from the at least two lines according to the ratio of the average time delay of the currently used line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio in the determined ratios is located.
The gateway device 100 may be a router, a host with a routing function turned on, or the like.
The application scenarios described above are merely examples of application scenarios for implementing the embodiments of the present application, and the embodiments of the present application are not limited to the application scenarios described above.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a line determining method provided in an embodiment of the present invention, which is applied to the gateway device, where the gateway device performs data transmission with a connected network-side device through at least two preset lines, and as shown in fig. 2, the method may include:
step 201: determining an average time delay of each of the at least two lines during the probing period.
In this embodiment, by respectively probing each of the at least two lines in one probing period, the average time delay of each line can be obtained.
In some specific embodiments, the average delay may be determined by:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
For example: the gateway equipment performs data transmission with connected network side equipment through five preset lines, which are respectively marked as line 1, line 2, line 3, line 4 and line 5, the detection period is 15s, the preset time is 3s, the gateway equipment sends detection messages to the network side equipment through the line 1, the line 2, the line 3, the line 4 and the line 5 every 3s, and each detection message carries the first time for sending the detection message; the network side equipment respectively determines second time for receiving each detection message after receiving the detection message, and sends response messages to the gateway equipment through corresponding lines, each response message carries third time for sending the response message and the first time and the second time, the gateway equipment determines fourth time for receiving the response message through each line, and detection time delay of the corresponding line is determined according to the fourth time corresponding to each line and the first time, the second time and the third time. Five probing times are performed on each line in one probing period, and the five probing delays of the line 1 are respectively denoted as t11, t12, t13, t14 and t15, so that the average delay t1 of the line 1 in the probing period is (t11+ t12+ t13+ t14+ t 15)/5; the five probing delays of line 2 are denoted as t21, t22, t23, t24 and t25, respectively, so that the average delay t2 of line 2 in the probing period is (t21+ t22+ t23+ t24+ t 25)/5; the five probing time delays of the line 3 are respectively denoted as t31, t32, t33, t34 and t35, so that the average time delay t3 of the line 3 in the probing period is (t31+ t32+ t33+ t34+ t 35)/5; the five probing delays of the line 4 are respectively denoted as t41, t42, t43, t44 and t45, so that the average delay t4 of the probing period of the line 4 is (t41+ t42+ t43+ t44+ t 45)/5; the five probing delays of the line 5 are denoted as t51, t52, t53, t54 and t55, respectively, so that the average delay t5 of the line 5 in the probing period is (t51+ t52+ t53+ t54+ t 55)/5.
The parameters such as the preset number of lines, the detection period, the preset duration and the like are exemplary illustrations, and all of the parameters can be set according to actual application scenarios.
Step 202: the ratio of the average delay to the target delay for each line is determined.
Wherein the target time delay is determined according to historical time delays of the at least two lines.
In this embodiment, after determining the average delay of each line, a ratio of the average delay of each line to the target delay needs to be determined, so as to obtain a deviation of the average delay of each line from the reference delays of the at least two lines. The above five circuits are also taken as an example for explanation:
the ratio r1 of the average time delay of the line 1 to the target time delay is t 1/d;
the ratio r2 of the average time delay of the line 2 to the target time delay is t 2/d;
the ratio r3 of the average time delay of the line 3 to the target time delay is t 3/d;
the ratio r4 of the average time delay of the line 4 to the target time delay is t 4/d;
the ratio r5 of the average time delay of the line 5 to the target time delay is t 5/d;
the above d is the target delay.
The target time delay is determined according to the historical time delays of the at least two lines, and specifically may be determined in the following ways:
1) taking an average value of all historical delays of the at least two lines as a target delay, for example:
from the start of the gateway equipment to the end of the last detection period, each line is detected for a plurality of times, each detection has corresponding historical time delay, and the average value of all the historical time delays of at least two lines is used as the target time delay of the at least two lines.
2) Taking the average value of the historical time delays of a certain number of the available lines as a target time delay, for example:
the gateway equipment is started, and a plurality of times of detection are carried out on each line from the end of the last detection period, each time of detection has corresponding historical time delay, and if the historical time delay is too much, the efficiency of determining the target time delay is influenced, so a certain amount of historical time delays are selected from the back to the front according to the detection time, and the average value of the historical time delays is used as the target time delay of at least two lines.
The two manners of determining the target time delay are merely exemplary illustrations, and the present embodiment may also determine the target time delay according to the historical time delays of the at least two lines in other manners.
Step 203: and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located.
In this embodiment, in the at least two lines, it may happen that the average time delays of some lines are relatively close, and the user side cannot perceive the difference in communication quality. At this time, if the line is directly switched to the line with the shortest average delay, the network stability will be poor due to frequent line switching.
Based on this, it is necessary to reasonably determine whether the line needs to be switched in combination with the currently used line of the at least two lines and the line with better communication quality.
For example, the ratio of the average delay of the currently used line to the target delay in the determined ratio is a deviation of the average delay of the currently used line from the reference delay, the target ratio range in which the minimum ratio in the determined ratio is located is a deviation range of the average delay of the line with better communication quality from the reference delay, and whether the quality of the currently used line belongs to the better communication quality range can be accurately determined by the target ratio range in which the ratio corresponding to the currently used line and the minimum ratio are located, so that the subsequent target used route can be reasonably and accurately determined based on the target ratio range.
In the above scheme, the ratio of the average delay of each line to the target delay is determined by the average delay of each line in the probing period in the at least two lines, that is, the deviation of the average delay of each line from the reference delay reflects the communication quality of each line; the ratio of the average time delay of the currently used line to the target time delay in the determined ratio is the deviation of the average time delay of the currently used line compared with the reference time delay, the target ratio range of the minimum ratio in the determined ratio is the deviation range of the average time delay of the line with better communication quality compared with the reference time delay, whether the quality of the currently used line belongs to the better communication quality range can be accurately determined through the ratio corresponding to the currently used line and the target ratio range of the minimum ratio, and the subsequent target used line is determined based on the target used line, so that the communication quality of the target used line can be guaranteed, and meanwhile, unnecessary line switching can be reduced. The problem of frequent line switching caused by directly using the line with the shortest average time delay as the target using line is avoided.
Fig. 3 is a schematic flowchart of another line determining method provided in the embodiment of the present invention, which is applied to the gateway device, and as shown in fig. 3, the method may include:
step 301: determining an average time delay of each of the at least two lines during the probing period.
Step 302: the ratio of the average delay to the target delay for each line is determined.
Wherein the target time delay is determined according to historical time delays of the at least two lines.
The steps 301 and 302 are implemented in the same manner as the steps 201 and 202, and are not described herein again.
Step 303: and acquiring a target ratio range in which the minimum ratio among the determined ratios is located.
Step 304: and determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range.
As described above, when the average delay of some lines is not very different, the user side cannot perceive the difference of the communication quality. Therefore, even if the communication quality of the currently used line is not the best, when the communication quality is not much different from that of the line with the best communication quality, it is not necessary to switch the line. Based on this, it is necessary to determine whether the communication quality of the currently used line greatly differs from the communication quality of the line having the best communication quality.
In this embodiment, the ratio of the average delay of the currently used line to the target delay in the determined ratio is a deviation of the average delay of the currently used line from the reference delay, the target ratio range of the minimum ratio in the determined ratio is a deviation range of the average delay of the line with better communication quality from the reference delay, and by determining whether the ratio corresponding to the currently used line is in the target ratio range of the minimum ratio, it can be accurately determined whether the quality of the currently used line belongs to the better communication quality range, that is, whether the difference between the quality of the currently used line and the communication quality of the line with the best communication quality is large.
Step 305: and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
In this embodiment, if the ratio corresponding to the currently used line is within the target ratio range, it is indicated that the communication quality of the currently used line belongs to a better communication quality range, that is, the communication quality of the currently used line and the line with the best communication quality are not greatly different, and the currently used line may be continuously used.
The above five circuits are also taken as an example for explanation:
if the currently used line is line 1, the ratio corresponding to line 1 is 0.64, the minimum ratio is the ratio corresponding to line 2 is 0.61, the target ratio range of 0.61 is 0.6-0.7, and 0.64 is also in the range of 0.6-0.7, the line 1 is taken as the target using line.
According to the scheme, if the ratio corresponding to the currently used line is within the target ratio range, even if the communication quality of the currently used line is not the best, the communication quality of the currently used line can be ensured to belong to the better communication quality range, so that the currently used line is continuously used, and frequent line switching is avoided.
Step 306: and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
In some embodiments, when the difference between the communication quality of the currently used line and the communication quality of the line with the best communication quality is large, the user side can obviously perceive the difference between the communication qualities of the currently used line and the line with the best communication quality, and the internet surfing experience of the user side is affected without switching the line. If the ratio corresponding to the currently used line is not within the target ratio range, it indicates that the communication quality of the currently used line does not belong to a better communication quality range, i.e., when the difference between the communication quality of the currently used line and the communication quality of the line with the best communication quality is larger, the line switching is required.
The above five circuits are also taken as an example for explanation:
if the currently used line is line 3, the ratio corresponding to line 3 is 0.8, the minimum ratio is 0.61 corresponding to line 2, the ratio corresponding to line 1 is 1.1, the ratio corresponding to line 4 is 1.3, the ratio corresponding to line 5 is 0.67, the target ratio range where 0.61 is located is 0.6-0.7, and 0.8 is not in the range of 0.6-0.7, the target used line needs to be reselected, line 2 corresponding to the minimum ratio can be used as the target used line, and line 2 or line 5 in the target ratio range can be selected as the target used line.
According to the scheme, if the ratio corresponding to the currently used line is not in the target ratio range, the communication quality of the currently used line does not belong to a better communication quality range, line switching is needed, and the route with the best communication quality corresponding to the minimum ratio can be used as the target used line; any route with better communication quality can be selected as a target using route, and the method is suitable for requirements of different application scenes.
Fig. 4 is a schematic flowchart of another method for determining a line according to an embodiment of the present invention, which is applied to the gateway device, and as shown in fig. 4, the method may include:
step 401: determining an average time delay of each of the at least two lines during the probing period.
Step 402: the ratio of the average delay to the target delay for each line is determined.
Wherein the target time delay is determined according to historical time delays of the at least two lines.
The steps 401 and 402 are implemented in the same manner as the steps 201 and 202, and are not described herein again.
Step 403: and adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining a target ratio range in which the minimum ratio is located from the new ratio range.
The new ratio range obtained by adjusting the preset ratio range based on the historical ratio distribution of the at least two lines can be realized by, but not limited to, the following manners:
determining historical ratios of historical time delays of at least two lines in a plurality of historical detection periods to corresponding target time delays;
obtaining the distribution of the historical ratios according to the determined plurality of historical ratios;
according to the distribution of the historical ratios, determining the hit probability of the historical ratios in each preset ratio range;
narrowing the ratio range of the hit probability which is greater than a first preset probability threshold; and/or expanding the range of ratios for which the hit probability is less than a second predetermined probability threshold.
According to the scheme, the ratios corresponding to at least two routes are distributed in a plurality of preset ratio ranges and can also be distributed in a concentrated mode, and if the ratios are distributed in a certain ratio range in a concentrated mode, the route with good communication quality cannot be well selected. The preset ratio range is dynamically adjusted through historical ratio distribution based on at least two lines, so that a new more reasonable ratio range is obtained, the proportion of the lines can be uniformly distributed in different proportion ranges, and the lines with better communication quality and the lines with poorer communication quality are distinguished. For example:
the preset proportion ranges are 0.5-0.6, 0.6-0.7, 0.7-0.8, 0.8-0.9, 0.9-1, 1-1.1, 1.1-1.2, 1.2-1.3, 1.3-1.4 and 1.4-1.5 respectively, the first preset probability threshold is 15 percent, and the second preset probability threshold is 5 percent. If the probabilities of 0.5-0.6, 1.3-1.4, 1.4-1.5 are less than 5%, the probabilities of 0.8-0.9, 0.9-1, 1-1.1, 1.1-1.2 are more than 15%, 0.5-0.6 is adjusted to 0.5-0.65, 1.3-1.4, 1.4-1.5 is adjusted to 1.3-1.5, 0.8-0.9 is adjusted to 0.85-0.92, 0.9-1 is adjusted to 0.92-1, 1-1.1 is adjusted to 1-1.07, 1.1-1.2 is adjusted to 1.07-1.15 and 1.15-1.2. 0.6-0.7 and 0.7-0.8 are correspondingly adjusted to be 0.65-0.75, 0.75-0.85, and 1.2-1.3 are not adjusted. The new ratio ranges are obtained after adjustment, and the new ratio ranges are 0.5-0.65, 0.65-0.75, 0.75-0.85, 0.85-0.92, 0.92-1, 1-1.07, 1.07-1.15, 1.15-1.2, 1.2-1.3 and 1.3-1.5.
The specific values of the preset ratio range, the first preset probability threshold, the second preset probability threshold and the new ratio range are only used for explaining the adjustment process more intuitively, and the specific values of the parameters can be set according to the actual application scene setting.
In some embodiments, the target ratio range in which the minimum ratio is located may also be directly determined from a preset ratio range.
In some specific embodiments, the corresponding relationship between the ratio range and the score may be preset, and after the ratio range is adjusted, the corresponding relationship is also adjusted correspondingly, for example:
before adjustment, the corresponding relations are that the proportion ranges from 0.5 to 0.6 to 10 minutes, from 0.6 to 0.7 to 9 minutes, from 0.7 to 0.8 to 8 minutes, from 0.8 to 0.9 to 7 minutes, from 0.9 to 1 to 6 minutes, from 1 to 1.1 to 5 minutes, from 1.1 to 1.2 to 4 minutes, from 1.2 to 1.3 to 3 minutes, from 1.3 to 1.4 to 2 minutes and from 1.4 to 1.5 to 1 minute; the corresponding relation after adjustment is that the proportion range is 0.5-0.65 corresponding to 10 minutes, 0.65-0.75 corresponding to 9 minutes, 0.75-0.85 corresponding to 8 minutes, 0.85-0.92 corresponding to 7 minutes, 0.92-1 corresponding to 6 minutes, 1-1.07 corresponding to 5 minutes, 1.07-1.15 corresponding to 4 minutes, 1.15-1.2 corresponding to 3 minutes, 1.2-1.3 corresponding to 2 minutes, and 1.3-1.5 corresponding to 1 minute.
Step 404: and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located.
This step 404 may be implemented with reference to step 203 described above.
In some specific embodiments, if the corresponding relationship between the ratio range and the score is preset, the score corresponding to the ratio range in which the ratio of each line is located may be directly determined, and the target using route may be directly determined based on the score. For example:
the proportion ranges from 0.5 to 0.6 for 10 minutes, from 0.6 to 0.7 for 9 minutes, from 0.7 to 0.8 for 8 minutes, from 0.8 to 0.9 for 7 minutes, from 0.9 to 1 for 6 minutes, from 1 to 1.1 for 5 minutes, from 1.1 to 1.2 for 4 minutes, from 1.2 to 1.3 for 3 minutes, from 1.3 to 1.4 for 2 minutes and from 1.4 to 1.5 for 1 minute. The currently used line is line 3, the corresponding ratio of line 3 is 0.8, and the score is 8 points within the range of 0.7-0.8; the ratio of the line 1 is 1.1, the score is 5 points within the range of 1-1.1; the ratio corresponding to the line 2 is 0.61, the score is 9 points within the range of 0.6-0.7; the ratio of the line 4 is 1.3, the score is 3 in the range of 1.2-1.3; line 5 corresponds to a ratio of 0.67, in the range of 0.6-0.7, with a score of 9. The highest score is 9 scores, the score of the line 3 is 8 scores, the line needs to be switched, and a target using line can be selected from the line 2 and the line 5 corresponding to the 9 scores.
According to the scheme, the target ratio range in which the minimum ratio is located can be directly determined from the preset ratio range; the preset ratio range can be dynamically adjusted based on the historical ratio distribution of the at least two lines to obtain a new more reasonable ratio range, and the deviation range of the line with better communication quality can be more accurately represented by the target ratio range in which the minimum ratio determined from the new ratio range is located.
As shown in fig. 5, based on the same inventive concept, an embodiment of the present invention provides a line determining apparatus 500, including: a delay determination module 501, a ratio determination module 502 and a line determination module 503.
The time delay determining module is used for determining the average time delay of each of at least two lines in a detection period, wherein the at least two lines are preset lines used for data transmission with connected network side equipment;
a ratio determining module, configured to determine a ratio of an average delay of each line to a target delay, where the target delay is determined according to historical delays of the at least two lines;
and the line determining module is used for determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio in the determined ratios is located.
Optionally, the determining, by the line determining module, a target used line from the at least two lines according to the ratio of the average time delay of the currently used line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio of the determined ratios is located includes:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
Optionally, the route determining module is further configured to:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
Optionally, the ratio determination module is further configured to:
before the line determining module determines the target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in the determined ratios and the target ratio range where the minimum ratio in the determined ratios is located,
determining a target ratio range in which the minimum ratio is located from a preset ratio range; or,
and adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining a target ratio range in which the minimum ratio is located from the new ratio range.
Optionally, the delay determining module is specifically configured to:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
Since the apparatus is the apparatus in the method in the embodiment of the present invention, and the principle of the apparatus for solving the problem is similar to that of the method, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not repeated.
As shown in fig. 6, based on the same inventive concept, an embodiment of the present invention provides a gateway device 600, where the gateway device 600 performs data transmission with a connected network-side device through at least two preset lines, and includes: a processor 601 and a memory 602;
a memory 602 for storing computer programs executed by the processor 601. The memory 602 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 602 may also be a non-volatile memory (non-volatile memory) such as, but not limited to, a read-only memory (rom), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or any other medium which can be used to carry or store desired program code in the form of instructions or data structures and which can be accessed by a computer. The memory 602 may be a combination of the above.
The processor 601 may include one or more Central Processing Units (CPUs), Graphics Processing Units (GPUs), or digital Processing units (dsps), etc.
The embodiment of the present invention does not limit the specific connection medium between the memory 602 and the processor 601. In fig. 6, the memory 602 and the processor 601 are connected by a bus 603, the bus 603 is represented by a thick line in fig. 6, and the connection manner between other components is merely illustrative and not limited. The bus 603 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
Wherein the memory stores program code that, when executed by the processor, causes the processor to perform the following:
determining an average time delay of each of the at least two lines during a probing period;
determining the ratio of the average time delay of each line to a target time delay, wherein the target time delay is determined according to the historical time delays of the at least two lines;
and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located.
The processor specifically performs:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
The processor further performs:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
The processor further performs:
before determining a target using line from the at least two lines according to the ratio of the average time delay of the currently used line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio of the determined ratios is located,
determining a target ratio range in which the minimum ratio is located from a preset ratio range; or adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining the target ratio range in which the minimum ratio is located from the new ratio range.
The processor specifically performs:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
Since the gateway device is a gateway device that executes the method in the embodiment of the present invention, and the principle of solving the problem of the gateway device is similar to that of the method, the implementation of the gateway device may refer to the implementation of the method, and repeated details are not described again.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the above-described route determination method. The readable storage medium may be a nonvolatile readable storage medium, among others.
The present application is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the invention. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, and/or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer and/or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the subject application may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A line determining method is applied to a gateway device, wherein the gateway device performs data transmission with a connected network side device through at least two preset lines, and the method comprises the following steps:
determining an average time delay of each of the at least two lines during a probing period;
determining the ratio of the average time delay of each line to a target time delay, wherein the target time delay is determined according to the historical time delays of the at least two lines;
and determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in each determined ratio and the target ratio range in which the minimum ratio in each determined ratio is located.
2. The method according to claim 1, wherein determining a target used line from the at least two lines according to the determined ratio of the average delay of the currently used line to the target delay in each ratio and the determined target ratio range in which the minimum ratio in each ratio is located comprises:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
3. The method of claim 2, further comprising:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
4. The method according to claim 1, wherein before determining the target used line from the at least two lines according to the determined ratio of the average delay of the currently used line to the target delay in each ratio and the target ratio range in which the minimum ratio of the determined ratios is located, the method further comprises:
determining a target ratio range in which the minimum ratio is located from a preset ratio range; or,
and adjusting a preset ratio range based on the historical ratio distribution of the at least two lines to obtain a new ratio range, and determining a target ratio range in which the minimum ratio is located from the new ratio range.
5. The method according to any of claims 1 to 4, wherein determining the average time delay of each of the at least two lines during the probing period comprises:
in the detection period, sending a detection message to the network side equipment through each line at intervals of a preset time length, wherein the detection period comprises a plurality of preset time lengths;
determining a plurality of detection time delays of each line in the detection period according to a received response message returned by the network side equipment through each line based on the detection message;
and taking the average value of a plurality of detection time delays of each line in the detection period as the average time delay of the corresponding line.
6. A line determining apparatus, comprising:
the time delay determining module is used for determining the average time delay of each of at least two lines in a detection period, wherein the at least two lines are preset lines used for data transmission with connected network side equipment;
a ratio determining module, configured to determine a ratio of an average delay of each line to a target delay, where the target delay is determined according to historical delays of the at least two lines;
and the line determining module is used for determining a target using line from the at least two lines according to the ratio of the average time delay of the current using line to the target time delay in the determined ratios and the target ratio range in which the minimum ratio in the determined ratios is located.
7. The apparatus according to claim 6, wherein the circuit determining module determines the target used circuit from the at least two circuits according to a ratio of an average delay of the currently used circuit to the target delay among the determined ratios and a target ratio range in which a minimum ratio among the determined ratios is located, and includes:
obtaining a target ratio range in which the minimum ratio among the determined ratios is located;
determining whether the ratio of the average time delay of the currently used line to the target time delay is within the target ratio range;
and if the ratio of the average time delay of the currently used line to the target time delay is determined to be within the target ratio range, taking the currently used line as the target using route.
8. The apparatus of claim 7, wherein the route determination module is further configured to:
and if the ratio of the average time delay of the current using line to the target time delay is determined not to be in the target ratio range, taking the line corresponding to the minimum ratio or the line corresponding to any ratio in the target ratio range as the target using line.
9. A gateway device, comprising: a processor and a memory;
wherein the memory stores program code which, when executed by the processor, causes the processor to perform the method of any of claims 1 to 5.
10. A computer-readable storage medium comprising computer program instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011080595.8A CN112422425B (en) | 2020-10-10 | 2020-10-10 | Line determining method, device, gateway equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011080595.8A CN112422425B (en) | 2020-10-10 | 2020-10-10 | Line determining method, device, gateway equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112422425A true CN112422425A (en) | 2021-02-26 |
CN112422425B CN112422425B (en) | 2023-01-10 |
Family
ID=74854796
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011080595.8A Active CN112422425B (en) | 2020-10-10 | 2020-10-10 | Line determining method, device, gateway equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112422425B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767523A (en) * | 2005-11-21 | 2006-05-03 | 杭州华为三康技术有限公司 | Method for adjusting data stream transmission link and its realizing device |
KR20100036599A (en) * | 2008-09-30 | 2010-04-08 | 삼성네트웍스 주식회사 | Apparatus and method for managing link information of ospf protocol on overlay network |
CN103957158A (en) * | 2014-04-14 | 2014-07-30 | 华为技术有限公司 | Determining method and device for flow forwarding path and communication system |
CN104270311A (en) * | 2014-10-29 | 2015-01-07 | 国家电网公司 | Radio network route recognizing method |
WO2015117387A1 (en) * | 2014-07-23 | 2015-08-13 | 中兴通讯股份有限公司 | Method and device for switching multi-link master clock, and ptn device |
US20150282023A1 (en) * | 2012-10-31 | 2015-10-01 | Telefonaktiebolaget L M Ericsson (Publ) | Dynamic transport channel synchronization |
CN108064439A (en) * | 2017-10-17 | 2018-05-22 | 深圳前海达闼云端智能科技有限公司 | A kind of network path optimization method, system, control server-side and networking end |
CN109831328A (en) * | 2019-01-30 | 2019-05-31 | 杭州迪普科技股份有限公司 | Switching method, device, the electronic equipment of intelligent route selection |
-
2020
- 2020-10-10 CN CN202011080595.8A patent/CN112422425B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767523A (en) * | 2005-11-21 | 2006-05-03 | 杭州华为三康技术有限公司 | Method for adjusting data stream transmission link and its realizing device |
KR20100036599A (en) * | 2008-09-30 | 2010-04-08 | 삼성네트웍스 주식회사 | Apparatus and method for managing link information of ospf protocol on overlay network |
US20150282023A1 (en) * | 2012-10-31 | 2015-10-01 | Telefonaktiebolaget L M Ericsson (Publ) | Dynamic transport channel synchronization |
CN103957158A (en) * | 2014-04-14 | 2014-07-30 | 华为技术有限公司 | Determining method and device for flow forwarding path and communication system |
WO2015117387A1 (en) * | 2014-07-23 | 2015-08-13 | 中兴通讯股份有限公司 | Method and device for switching multi-link master clock, and ptn device |
CN104270311A (en) * | 2014-10-29 | 2015-01-07 | 国家电网公司 | Radio network route recognizing method |
CN108064439A (en) * | 2017-10-17 | 2018-05-22 | 深圳前海达闼云端智能科技有限公司 | A kind of network path optimization method, system, control server-side and networking end |
CN109831328A (en) * | 2019-01-30 | 2019-05-31 | 杭州迪普科技股份有限公司 | Switching method, device, the electronic equipment of intelligent route selection |
Also Published As
Publication number | Publication date |
---|---|
CN112422425B (en) | 2023-01-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200382374A1 (en) | Method for generating network slice template and for applying network slice template, and apparatus | |
US10623251B2 (en) | Private network driven hosted network device management | |
US20090010155A1 (en) | Network communication control methods and systems | |
US11246168B2 (en) | Method for random access and terminal device | |
US12041688B2 (en) | Screen projection method and system | |
WO2022257366A1 (en) | Network slice self-optimization method, base station, and storage medium | |
CN111159612B (en) | Countdown method, system, device, computer equipment and storage medium | |
US10873530B2 (en) | Method for controlling data transmission, device, and storage medium | |
CN112422425B (en) | Line determining method, device, gateway equipment and storage medium | |
CN111427417B (en) | Time acquisition method and device and electronic equipment | |
EP3745284A1 (en) | Model parameter fusion method and apparatus | |
CN113014352B (en) | Equipment time synchronization method and device based on fiber channel protocol | |
US11343153B2 (en) | BGP logical topology generation method, and device | |
US20170034005A1 (en) | Flow Entry Management Method and Device | |
CN113747423B (en) | Cloud mobile phone state synchronization method, device, equipment, storage medium and program product | |
CN112235842A (en) | Communication method and device of Internet of things equipment | |
CN113765711B (en) | Network equipment keep-alive method and device | |
EP4366386A1 (en) | Information notification method, controller and storage medium | |
CN114679425B (en) | Message processing method, network equipment and storage medium under 5G network | |
CN114158064B (en) | Communication equipment, network allocation vector adjustment method and system thereof and electronic equipment | |
CN116366499B (en) | Data transmission method, device, electronic equipment and medium | |
US12040962B2 (en) | Routing information management method and apparatus, and computer storage medium | |
CN105959083A (en) | Long-distance transmission method and device and computer device | |
CN112822069A (en) | Communication method, device, equipment, system and storage medium | |
CN117998569A (en) | Data transmission method, device, electronic equipment, storage medium and product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |