WO2017049925A1 - Network congestion control method and apparatus, and client - Google Patents

Network congestion control method and apparatus, and client Download PDF

Info

Publication number
WO2017049925A1
WO2017049925A1 PCT/CN2016/082528 CN2016082528W WO2017049925A1 WO 2017049925 A1 WO2017049925 A1 WO 2017049925A1 CN 2016082528 W CN2016082528 W CN 2016082528W WO 2017049925 A1 WO2017049925 A1 WO 2017049925A1
Authority
WO
WIPO (PCT)
Prior art keywords
delay
time
time point
server
client
Prior art date
Application number
PCT/CN2016/082528
Other languages
French (fr)
Chinese (zh)
Inventor
赵洋
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017049925A1 publication Critical patent/WO2017049925A1/en

Links

Images

Definitions

  • This application relates to, but is not limited to, the field of communication technology.
  • Network congestion refers to a situation in which the network transmission performance is degraded due to the limited resources of the store-and-forward node when the number of packets transmitted in the packet-switched network is too large.
  • the network When the network is congested, data loss, delay increases, and throughput drop are generally caused. In severe cases, "congestion collapse” may occur.
  • storage space limitations bandwidth capacity limitations, and processor performance limitations.
  • the client does not know the processing capability of the current transmission network environment or the server, and always sends the request message according to its maximum processing capability. When the transmission network condition is poor or the processing capability of the server is weak, a large number of request messages are generated. Congestion in the network or squeezed on the server side further deteriorates the network environment or crushes the server. Therefore, a method capable of link congestion control is urgently needed.
  • the present invention provides a network congestion control method, device, and client to solve the related art. Since the client does not understand the processing network environment or the processing capability of the server, the information is always exchanged with the server according to a single data transmission policy. The technical problem that causes the network environment to deteriorate.
  • a network congestion control method includes:
  • the acquired delay is a transmission delay that represents a transmission network environment, a processing delay that characterizes a processing capability of the server, or an overall delay that characterizes the network environment.
  • the manner of obtaining the transmission delay includes one of the following three types:
  • the difference between the first time point is used as the first transmission delay; the time when the server sends the second message to the client is used as the third time point, and the client receives the second message.
  • the time is taken as the fourth time point, and the difference between the fourth time point and the third time point is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as The transmission delay.
  • acquiring the processing delay includes:
  • the manner of obtaining the total delay includes one of the following three types:
  • the preset delay threshold includes a first threshold and a second threshold, and the first threshold is smaller than the second threshold.
  • the controlling a sending policy of the client according to the comparison result includes:
  • the controlling a sending policy of the client according to the comparison result includes:
  • the comparison result is that the delay is greater than or equal to the second threshold
  • determining whether the first N-1 comparison results before the current comparison result are all the delay is greater than or equal to the second threshold; If the result of the determination is yes, the frequency at which the client sends a message to the server is decreased, and when the determination result is no, the frequency at which the client sends a message to the server is maintained;
  • a network congestion control device includes:
  • the delay acquisition module is configured to: obtain a delay for reflecting a network state
  • the delay comparison module is configured to: compare the delay acquired by the delay acquisition module with a preset delay threshold;
  • the policy control module is configured to: control a sending policy of the client according to the comparison result obtained by the delay comparison module.
  • the delay obtaining module includes at least one of a transmission delay acquisition submodule, a processing delay acquisition submodule, and an overall delay acquisition submodule;
  • the transmission delay acquisition submodule is configured to: acquire a transmission delay that characterizes a transmission network environment
  • the processing delay acquisition submodule is configured to: acquire a processing delay that represents a processing capability of the server;
  • the overall delay acquisition submodule is configured to: obtain an overall delay characterizing a network environment
  • the transmission delay acquisition submodule when the time delay acquisition module includes the transmission delay acquisition submodule, the transmission delay acquisition submodule includes:
  • the first obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
  • a second acquiring unit configured to: acquire a time when the server receives the first message as a second time point;
  • a first calculating unit configured to: calculate, as the transmission delay, a difference between the second time point acquired by the second acquiring unit and the first time point acquired by the first acquiring unit;
  • the transmission delay acquisition submodule includes:
  • the third obtaining unit is configured to: acquire a time when the server sends the second message to the client as a third time point;
  • a fourth obtaining unit configured to: acquire a time when the client receives the second message as a fourth time point;
  • a second calculating unit configured to: calculate, as the transmission delay, a difference between the fourth time point acquired by the fourth acquiring unit and the third time point acquired by the third acquiring unit;
  • the transmission delay acquisition submodule includes:
  • the fifth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
  • a sixth obtaining unit configured to: acquire a time when the server receives the first message as a second time point;
  • the seventh obtaining unit is configured to: acquire a time when the server sends the second message to the client as a third time point;
  • An eighth obtaining unit configured to: acquire a time when the client receives the second message as a fourth time point;
  • a third calculating unit configured to: calculate a difference between the second time point acquired by the sixth acquiring unit and the first time point acquired by the fifth acquiring unit as a first transmission delay, and calculate the a difference between the fourth time point acquired by the eighth obtaining unit and the third time point acquired by the seventh acquiring unit as a second transmission delay, and calculating the first transmission delay and the second The sum of transmission delays is taken as the transmission delay.
  • the processing delay obtaining submodule when the time delay obtaining module includes the processing delay acquiring submodule, the processing delay obtaining submodule includes:
  • the ninth obtaining unit is configured to: acquire, as the second time point, the time when the server receives the first message sent by the client;
  • the tenth acquiring unit is configured to: acquire, as the third time point, a time when the server sends the second message to the client;
  • the fourth calculating unit is configured to: calculate, as the processing delay, a difference between the third time point acquired by the tenth acquiring unit and the second time point acquired by the ninth acquiring unit.
  • the total delay acquisition submodule when the time delay acquisition module includes the total delay acquisition submodule, the total delay acquisition submodule includes:
  • the eleventh acquiring unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
  • a twelfth obtaining unit configured to: acquire a time when the server sends a second message to the client as a third time point;
  • a fifth calculating unit configured to: calculate, as the overall delay, a difference between the third time point acquired by the twelfth acquiring unit and the first time point acquired by the eleventh acquiring unit;
  • the overall delay acquisition submodule includes:
  • a thirteenth obtaining unit configured to: acquire a time when the server receives the first message sent by the client as a second time point;
  • a fourteenth obtaining unit configured to: acquire a time when the client receives the second message sent by the server as a fourth time point;
  • a sixth calculating unit configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the fourteenth acquiring unit and the second time point acquired by the thirteenth acquiring unit;
  • the overall delay acquisition submodule includes:
  • the fifteenth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
  • a sixteenth obtaining unit configured to: acquire a time when the client receives the second message sent by the server as a fourth time point;
  • the seventh calculating unit is configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the sixteenth acquiring unit and the first time point acquired by the fifteenth acquiring unit.
  • the delay comparison module includes a first threshold comparison submodule and a second threshold comparison submodule
  • the first threshold comparison submodule is configured to: compare the time delay acquired by the delay acquisition module with a first threshold
  • the second threshold comparison submodule is configured to compare the time delay acquired by the delay acquisition module with a second threshold.
  • the policy control module controls a sending policy of the client according to the comparison result obtained by the delay comparison module, including:
  • the policy control module is configured to: reduce a frequency at which the client sends a message to the server;
  • the policy control module is configured to: maintain the client to the The frequency at which the server sends messages;
  • the policy control module is configured to: maintain a frequency or improve the frequency at which the client sends a message to the server. The frequency at which the client sends a message to the server.
  • the policy control module further includes a determining submodule and a control submodule:
  • the determining sub-module is configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the second threshold, determine whether the first N-1 comparison results before the current comparison result are all
  • the control sub-module is configured to: when the judgment result of the determining sub-module is YES, reduce the frequency at which the client sends a message to the server, when And when the determining result of the determining submodule is negative, maintaining a frequency at which the client sends a message to the server;
  • the control sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining the client to the service The frequency at which the message is sent by the terminal;
  • the determining sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is less than the first threshold, determine whether the first N-1 comparison results before the current comparison result are all.
  • the control sub-module is further configured to: when the determination result of the determining sub-module is YES, increase the frequency at which the client sends a message to the server, when When the judgment result of the submodule is negative, the frequency at which the client sends a message to the server is maintained.
  • the present invention also provides a client comprising the network congestion control device according to any of the above.
  • the network congestion control method, device, and client provided by the embodiment of the present invention obtain the time delay of the network state, and compare the acquired delay with the preset delay threshold to learn the current network condition, and then according to the current network situation.
  • the comparison result controls the sending policy of the client, achieves the real-time understanding of the current network state, and adjusts the data transmission policy of the client according to the current network state, and solves the problem that the processing capability of the network environment or the server is not understood by the client in the related technology. It always interacts with a single data transmission strategy, which leads to the deterioration of the network environment, improves the efficiency of client-server interaction, and optimizes network resource configuration.
  • FIG. 1 is a flowchart of a network congestion control method according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of a network congestion control apparatus according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a delay acquisition module in a network congestion control apparatus provided in the embodiment shown in FIG. 2;
  • FIG. 4 is a schematic structural diagram of a transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 5 is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 6 is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 7 is a schematic structural diagram of a processing delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 8 is a schematic structural diagram of an overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 9 is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 10 is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
  • FIG. 11 is a schematic structural diagram of a delay comparison module in a network congestion control apparatus according to the embodiment shown in FIG. 2;
  • FIG. 12 is a schematic structural diagram of a policy control module in a network congestion control apparatus provided in the embodiment shown in FIG. 2;
  • FIG. 13 is a schematic structural diagram of another policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2.
  • network congestion occurs primarily due to storage space and bandwidth capacity limitations and processor performance limitations. Therefore, in theory, solving network congestion can be done from three aspects: increasing storage space and bandwidth capacity or improving processor performance.
  • storage space and bandwidth capacity cannot be increased indefinitely, and processor performance is also improved. It is impossible to increase infinitely, so the most practical way to solve network congestion is to perform network congestion control.
  • the network congestion control method and device and the client provided by the embodiment of the present invention obtain a delay capable of transmitting a network environment or a server processing capability, compare the delay with a preset delay threshold, and then control the client according to the comparison result.
  • the data transmission strategy is to achieve real-time understanding of the current network status, and adjust the client's data transmission policy according to the current network status.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 1 is a flowchart of a network congestion control method according to Embodiment 1 of the present invention.
  • the network congestion control method provided in this embodiment may include steps 101 to 103:
  • Step 101 Obtain a delay for reflecting a network status.
  • the obtained delay may be a transmission delay, a processing delay, or an overall delay.
  • the transmission delay can be the time taken by the client to interact with the server in the transmission process, so the transmission delay can characterize the transmission network.
  • the client sends a message to the server
  • the sending time of the message is intercepted as the first time point
  • the time when the server receives the message is taken as the second time point
  • the second time point and the first time point are The time difference between the two is the transmission delay
  • the delay between the second time point and the first time point is only a one-way transmission delay.
  • another one-way transmission delay can also be obtained.
  • the server sends a message to the client the sending time of the message is intercepted as the third time point, and the time when the client receives the message is taken as the fourth time.
  • the time difference between the fourth time point and the third time point can also be used as the transmission delay. again In terms of the two-way transmission delay, the sum of the two-way transmission delay is one of the transmission delays.
  • the processing delay can be the time taken by the server to process the message sent by the client, that is, the time between receiving the request message from the server and the response message sent by the server to the client, and the processing time reflects the processing capability of the server.
  • the interception server receives the request message sent by the client as the second time point, and intercepts the time when the server sends the response message to the client as the third time point, and compares the first time. The second time point and the third time point are obtained, and the time difference between the third time point and the second time point is obtained as a processing delay.
  • the overall delay acquisition method can be divided into indirect acquisition and direct acquisition:
  • the overall delay is the sum of the transmission delay and the processing delay, it corresponds to the three forms of obtaining the transmission delay, and the indirect acquisition methods of the overall delay mainly have the following three types:
  • the first method is: obtaining the time when the client sends the request message to the server as the first time point, and obtaining the time when the server receives the request message as the second time point, and the difference between the second time point and the first time point
  • the first transmission delay the time when the server sends the response message to the client is taken as the third time point, and the difference between the third time point and the second time point is taken as the processing delay; the first transmission delay and the processing are calculated.
  • the sum of delays as the overall delay;
  • the second method is to obtain the time when the server sends a response message to the client as the third time point, and obtain the time when the client receives the response message as the fourth time point, and the difference between the fourth time point and the third time point.
  • the second transmission delay the time when the acquiring server receives the request message sent by the client is used as the second time point, and the difference between the third time point and the second time point is used as the processing delay; and the second transmission delay is calculated. And the sum of the processing delays as the overall delay;
  • the third method is: obtaining the time when the client sends the request message to the server as the first time point, and obtaining the time when the server receives the request message as the second time point, and taking the difference between the second time point and the first time point as The first transmission delay is obtained as the third time point when the server sends the response message to the client, and the time when the client receives the response message is taken as the fourth time point, and the fourth time point and the third time point are The difference is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as the transmission delay, and the difference between the third time point and the second time point is used as the processing delay, and the transmission delay is calculated. And the sum of processing delays as the overall delay.
  • the method for directly obtaining the overall delay may be adopted in this embodiment.
  • This method is simple, and the intermediate link of indirect acquisition is omitted.
  • the direct acquisition method of the overall delay mainly includes the following three types:
  • the first method is: obtaining the time when the client sends the request message to the server is the first time, and the time for the server to send the response message to the client is the third time point, and the third time point and the first time point are directly The difference is the way of overall delay;
  • the second mode the time when the server receives the request message sent by the client is the second time point, and the time when the client receives the response message sent by the server is the fourth time point, and then the fourth time point is directly The difference from the second time point is the overall delay;
  • the third method obtaining the time when the client sends the request message to the server is the first time point, and obtaining the response time sent by the client to the server is the fourth time point, and then directly the fourth time point and the The difference in time is used as the overall delay.
  • the time stamp may be set in the information exchanged between the client and the server, that is, the extension field is added in at least one of the request message or the response message, and the client and the server are added.
  • the party that sends the information records the timestamp of the sending request message or the response message in the extension field.
  • the other party receives the information, it compares the timestamp contained in the information with its own system time, and calculates that the message is transmitted.
  • the delay in the process For example, in an embodiment of the present invention, when sending a request message to a server, the client may set a timestamp of the sending time in the request message, and when the server receives the request message, obtain a timestamp from the server. Compare with your own system time to obtain the transmission delay of the request message.
  • the method of setting the timestamp is not limited to the foregoing manner.
  • the client may record the time when the request message is sent to the server, but the timestamp of the time is not set in the request message.
  • the server receives the above request message, it records the received time, and sets the timestamp of the time in the response message of the replying client.
  • the client receives the response message replied by the server, the response message is received from the response message.
  • the above method is set by one of the client or the server, and the other party calculates the delay, and the system time of the client and the server must be synchronized.
  • the party that sets the timestamp is the party that calculates the delay.
  • the parties that calculates the delay For example, when the client sends the request message to the server, when the sending time is set in the request message, The timestamp, when the server receives the request message and sends a response message, the timestamp is copied into the extension field of the response message, and when the client receives the response message sent by the server, the timestamp is obtained. Compared with your own system time, you can calculate the sum of transmission delay and processing delay to reflect the overall network status. This method of obtaining the delay is not required to set the time stamp by one of the client or the server, and the other party does not need to require the system time synchronization between the server and the client.
  • the present invention further provides an embodiment, the delay is obtained by setting a counter, and the client may start to use the counter to start timing when sending the request message to the server, when receiving the response message from the server. Stop timing, this method is simple, there is no need to add extension fields in the interaction information between the client and the server, and no calculation is needed.
  • Step 102 Compare the acquired delay with a preset delay threshold.
  • the result of the comparison between the delay and the preset delay threshold may reflect the current network state.
  • two preset thresholds may be set, that is, the preset delay threshold includes the first threshold and the first threshold.
  • the second threshold is that the first threshold is less than the second threshold.
  • the current network state is bad.
  • the value of the delay is greater than or equal to the first threshold and less than the second threshold, Indicates that the current network status is normal.
  • the value of the above delay is less than the first threshold, the current network status is good.
  • the value of the preset delay threshold can be set by the user, and the user can flexibly set according to the storage space and bandwidth capacity of the network used by the user and the performance of the processor.
  • the value of the first threshold may be equal to the value of the second threshold.
  • Step 103 Control a sending policy of the client according to the comparison result.
  • the current client's transmission policy may be controlled according to the comparison result.
  • the comparison result is that the delay is greater than or equal to the second threshold
  • the frequency of sending the message by the client to the server is decreased
  • the comparison result is that the delay is greater than or equal to the first threshold and less than the second threshold
  • the comparison result is that the delay is less than the first threshold
  • the frequency at which the client sends a message to the server is maintained or the frequency at which the client sends a message to the server is increased.
  • the present invention also provides another optional embodiment, when the comparison result is that the delay is greater than or equal to the second
  • the threshold it is determined whether the first N-1 comparison results before the current comparison result are all the time delays greater than the second threshold, that is, whether there are already N comparison results, the delay is greater than or equal to the second threshold, and the current comparison result That is, the result of the Nth comparison; when the judgment result is YES, the frequency at which the client sends a message to the server is decreased, and when the judgment result is no, the frequency at which the client sends a message to the server is maintained; If the delay is less than the first threshold, it is determined whether the first N-1 comparison results before the current comparison result are all less than the first threshold, that is, whether there is already N comparison results, the delay is less than the second threshold.
  • the current comparison result is the Nth comparison result; when the judgment result is yes, the frequency of the message sent by the client to the server is increased, and when the judgment result is no, the frequency at which the client sends the message to the server is maintained; The result is that when the delay is greater than or equal to the first threshold and less than the second threshold, the frequency of sending the message to the server by the client is directly maintained.
  • the type of information that the client interacts with the server may include at least one of a REQMODE message, an Option message, or a Cache message.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 2 is a schematic structural diagram of a network congestion control apparatus according to Embodiment 2 of the present invention.
  • the network congestion control apparatus provided in this embodiment may include: a delay acquisition module 201, a delay comparison module 202, and a policy control module 203.
  • the delay obtaining module 201 is configured to: obtain a delay for reflecting a network state
  • the delay acquisition module 201 includes a transmission delay acquisition submodule. 2011, processing at least one of a delay acquisition sub-module 2012 and an overall delay acquisition sub-module 2013.
  • the transmission delay acquisition sub-module 2011 is configured to: obtain a transmission delay, which is a time that the information exchanged between the client and the server in the transmission process, and thus the transmission delay can represent the condition of the transmission network.
  • the transmission delay acquisition sub-module 2011 may include one of the following three structures:
  • the first structure is a schematic structural diagram of a transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG.
  • the first obtaining unit 401 is configured to: intercept the sending time of the message as the first time point
  • the second obtaining unit 402 is configured to: intercept the time when the server receives the message as the second time.
  • the first calculating unit 403 is configured to: calculate a time difference between the second time point acquired by the second obtaining unit 402 and the first time point acquired by the first acquiring unit 401, that is, a transmission delay.
  • the delay between the second time point and the first time point is only a one-way transmission delay.
  • the transmission delay acquisition sub-module 2011 can also acquire another one-way transmission delay, which is obtained by the second transmission delay acquisition sub-module 2011.
  • the second structure is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG.
  • the third obtaining unit 501, the fourth obtaining unit 502, and the second calculating unit 503 are included.
  • the third obtaining unit 501 is configured to: intercept the sending time of the message as the third time point
  • the fourth obtaining unit 502 is configured to: intercept the time when the client receives the message as the fourth time.
  • the second calculating unit 503 is configured to calculate a time difference between the fourth time point acquired by the fourth obtaining unit 502 and the third time point acquired by the third acquiring unit 501 as the transmission delay.
  • the sum of the two unidirectional transmission delays may be obtained as a transmission delay, where the transmission delay belongs to the bidirectional transmission delay by the third transmission delay. Get the submodule 2011 get.
  • the third structure is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG.
  • the processing delay acquisition sub-module 2012 is configured to: obtain a processing delay, where the processing delay may be a time taken by the server to process the message sent by the client, that is, the client receives the request message from the server to the service.
  • the time between sending a response message to the client, and the processing delay reflects the processing power of the server.
  • FIG. 7 a schematic diagram of a processing delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, the processing delay acquisition submodule 2012 shown in FIG.
  • the ninth obtaining unit 701 is configured to: intercept the time when the server receives the request message sent by the client as the second time point.
  • the tenth obtaining unit 702 is configured to: intercept the time when the server sends the response message to the client as the third time point, and the fourth calculating unit 703 is configured to: compare the second time point acquired by the tenth obtaining unit 702 with the ninth acquiring unit.
  • a time difference between the third time point and the second time point is obtained as a processing delay.
  • the overall delay acquisition sub-module 2013 can have multiple structures:
  • the first structure is a schematic structural diagram of an overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule 2013 shown in FIG.
  • the eleventh obtaining unit 801, the twelfth obtaining unit 802, and the fifth calculating unit 803 are configured to: acquire the time when the client sends the request message to the server as the first time point, and the twelfth acquiring unit
  • the 802 is set to: obtain the server to send the response message to the third time point
  • the fifth calculating unit 803 is configured to: calculate the third time point acquired by the twelfth acquiring unit 802 and the first acquired by the eleventh acquiring unit 801 The difference in time points as the overall delay;
  • the second structure is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule shown in FIG.
  • the 2013 includes a thirteenth obtaining unit 901, a fourteenth obtaining unit 902, and a sixth calculating unit 903.
  • the thirteenth obtaining unit 901 is configured to: obtain a time when the server receives the request message sent by the client, and the time is the second time point.
  • the fourteenth obtaining unit 902 is configured to: acquire the time when the client receives the response message sent by the server is the fourth time point, and the sixth calculating unit 903 is configured to: calculate the fourth time point acquired by the fourteenth obtaining unit 902 The difference between the second time points acquired by the thirteenth obtaining unit 901 is taken as an overall delay;
  • the third structure is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule shown in FIG. 2013 includes a fifteenth obtaining unit 1001, a sixteenth obtaining unit 1002, and a seventh calculating unit 1003;
  • the fifteenth obtaining unit 1001 is configured to acquire the time when the client sends the request message to the server is the first time point
  • the sixteenth obtaining unit 1002 is configured to acquire the time when the client receives the response message sent by the server is the fourth time.
  • the seventh calculation unit is set to 1003 to calculate a difference between the fourth time point acquired by the sixteenth acquisition unit 1002 and the first time point acquired by the fifteenth acquisition unit 1001 as the overall time delay.
  • the overall delay acquisition sub-module 2013 obtains the overall delay by using the direct acquisition method. Since the overall delay is the sum of the transmission delay and the processing delay, the overall delay acquisition sub-module 2013 can be separately obtained. The transmission delay and the processing delay are calculated, and then the sum of the transmission delay and the processing delay is calculated to obtain the overall delay. Therefore, the overall delay acquisition sub-module 2013 can also be three other structures:
  • the fourth overall delay acquisition sub-module obtains the time when the client sends the request message to the server as the first time point, and obtains the time when the server receives the request message as the second time point, and the second time point and the first time
  • the difference between the time points is used as the first transmission delay
  • the time when the server sends the response message is taken as the third time point, and the difference between the third time point and the second time point is taken as the processing delay
  • the first transmission delay is calculated. Handling the sum of delays as an overall delay;
  • the fifth overall delay acquisition sub-module obtains the time when the server sends the response message as the third time point, and obtains the time when the client receives the response message as the fourth time point, and the fourth time point and the third time point
  • the difference is used as the second transmission delay
  • the time when the server receives the request message sent by the client is used as the second time point, and the difference between the third time point and the second time point is used as the processing delay; the second transmission is calculated.
  • the sum of the delay and the processing delay as the overall delay
  • the sixth overall delay acquisition sub-module obtains the time when the client sends the request message to the server as the first time point, and obtains the time when the server receives the request message as the second time point, and the second time point and the first time
  • the difference between the points is used as the first transmission delay, and the time at which the server sends the response message to the client is taken as the third time point, and the time when the client receives the response message is obtained as the fourth time point, and the fourth time point and the third time point are obtained.
  • the difference between the time points is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as the transmission delay, and the difference between the third time point and the second time point is used as the processing delay, and the calculation is calculated.
  • the sum of the transmission delay and the processing delay is taken as the overall delay.
  • the time stamp may be set in the information that the client interacts with the server, that is, in the request message or the response message.
  • the extension field is added in one less case, and the party sending the information in the client and the server records the timestamp of sending the request message or the response message in the extension field, and when the other party receives the information, the timestamp included in the message is included. Compare with your own system time and calculate the delay of the message during transmission.
  • the transmission delay acquisition sub-module 2011 may set a timestamp of the sending time in the request message when the client sends the request message to the server, when the server receives the request message. At the same time, the transmission delay acquisition sub-module 2011 obtains a timestamp from the server, and compares with the system time of the server to obtain the transmission delay of the request message.
  • the method of setting the timestamp is not limited to the foregoing manner.
  • the client may record the time when the request message is sent to the server, but the timestamp of the time is not set in the request message.
  • the server receives the above request message, it records the received time, and sets the timestamp of the time in the response message of the replying client.
  • the client receives the response message replied by the server, the response message is received from the response message.
  • the above method is set by one of the client or the server, and the other party calculates the delay, and the system time of the client and the server must be synchronized.
  • the party that sets the timestamp is the party that calculates the time delay.
  • the timestamp of the sending time is set in the request message.
  • the server receives the request message and sends a response message, the server copies the timestamp into the extension field of the response message.
  • the client receives the response message sent by the server, it obtains the timestamp from the system and the system.
  • the sum of the transmission delay and the processing delay can be calculated to reflect the overall network condition. This method of obtaining the delay is not required to set the time stamp by one of the client or the server, and the other party does not need to require the system time synchronization between the server and the client.
  • the delay obtaining module 201 obtains a delay by setting a counter, and can start timing by using a counter when the client sends a request message to the server, when the client receives When the response message from the server stops timing, this method is simple, and there is no need to add an extension field in the interaction information between the client and the server, and no calculation is needed.
  • the delay comparison module 202 is configured to: compare the delay acquired by the delay acquisition module 201 with a preset delay threshold; optionally, as shown in FIG. 11, the network provided in the embodiment shown in FIG. Hold A structure diagram of a delay comparison module in the plug control device, the delay comparison module 202 includes a first threshold comparison sub-module 2021 and a second threshold comparison sub-module 2022; after the delay acquisition module 201 acquires the delay, the first threshold
  • the comparison sub-module 2021 is configured to compare the delay obtained by the delay acquisition module 201 with the first threshold, and obtain a result.
  • the second threshold comparison sub-module 2022 is configured to: obtain the delay obtained by the delay acquisition module 201. The second threshold is compared, and the result is obtained.
  • the current network state is bad; when the value of the delay is greater than or If the first threshold is less than the second threshold, the current network status is normal. When the value of the delay is less than the first threshold, the current network status is good.
  • the threshold value for comparison between the first threshold comparison sub-module 2021 and the second threshold comparison sub-module 2022 can be set by the user autonomously, and the user can flexibly set according to the storage space and bandwidth capacity of the network used by the user and the performance of the processor. In practical applications, the value of the first threshold may be equal to the value of the second threshold.
  • the policy control module 203 is configured to: control the sending policy of the client according to the comparison result obtained by the delay comparison module 202.
  • the policy control module 203 can control the data transmission policy of the current client according to the comparison result.
  • the policy control module 203 is configured to reduce the frequency at which the client sends the message to the server; when the comparison result is that the delay is greater than or equal to the first threshold and is less than the first The second time threshold, the policy control module 203 is configured to maintain the frequency at which the client sends a message to the server.
  • the policy control module 203 is configured to maintain the client sending the message to the server. Frequency or increase the frequency with which clients send messages to the server.
  • the present invention further provides another optional embodiment.
  • FIG. 12 a schematic structural diagram of a policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2, the policy control module 203 includes a judgment.
  • the sub-module 2031 and the control sub-module 2032, on the one hand, the judging sub-module 2031 is set to: when the comparison result obtained by the current-span comparison module 202 is that the delay is greater than the second threshold, the first N-1 comparison results before the current comparison result are determined.
  • the control sub-module 2032 is set to: when determining When the determination result of the submodule 2031 is YES, the frequency at which the client sends a message to the server is decreased, and when the judgment result of the submodule 2031 is negative, The frequency of the message sent by the client to the server is maintained.
  • the determining sub-module 2031 is further configured to: when the comparison result obtained by the time delay comparison module 202 is that the delay is less than the first threshold, before the current comparison result is determined Whether the N-1 comparison result is less than the first threshold, that is, whether there is already N comparison results, the delay is less than the second threshold, and the current comparison result is also the Nth comparison result; accordingly, the controller
  • the module 2032 is further configured to: when the judgment result of the determining submodule 2031 is YES, increase the frequency at which the client sends a message to the server, and when the judgment result of the submodule 2031 is negative, the client is sent to send a message to the server.
  • control sub-module 2032 is further configured to: when the comparison result obtained by the delay comparison module 202 is that the delay is greater than or equal to the first threshold and less than the second threshold, directly maintain the frequency at which the client sends a message to the server. .
  • FIG. 13 a schematic structural diagram of another policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2, a control policy adjustment module
  • the 203 may further include a policy storage sub-module 2033, configured to: store a control policy adjustment record that has been performed in a certain period, where the day is used as the above-mentioned period, because in one day
  • the interaction between the client and the server has a busy time and a free time. In the long-term interaction, the busy hour and the idle time of each day are in a relatively fixed time period, so when the policy storage sub-module 2033 stores one day.
  • control sub-module 2032 can adjust the control policy according to the record provided by the policy storage sub-module 2033, so that the adjustment of the control strategy of the present invention is before the network condition, and the defect of the hysteresis adjustment is avoided. .
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the embodiment of the present invention further provides a client, which includes the network congestion control device provided in any of the embodiments shown in FIG. 2 to FIG.
  • the client provided in the embodiment of the present invention may be a client supporting an Internet Content Adaptation Protocol (ICAP).
  • ICAP Internet Content Adaptation Protocol
  • the client may be a personal computer or a terminal that supports the ICAP protocol software. It can also be a carrier-class network node device that implements the ICAP protocol.
  • the client obtains related resources for service processing by sending a related request message to the server.
  • the server used in conjunction with the client provided by the embodiment of the present invention may be a personal computer, a terminal or a commercial server that supports the ICAP protocol software, or a carrier-class network node device that implements the ICAP protocol.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the time delay of the network state is obtained, and the obtained delay is compared with the preset delay threshold to learn the current network situation, and then the policy of the client is controlled according to the comparison result, and the real-time is achieved. Understand the current network status and adjust the data transmission policy of the client according to the current network status.
  • the related technology solves the problem that the client does not understand the network environment or the processing capability of the server, and always interacts with a single data transmission policy.
  • the problem that causes the network environment to deteriorate is improved, and the efficiency of the interaction between the client and the server is improved, and the network resource configuration is optimized.

Abstract

A network congestion control method and apparatus, and a client. The network congestion control method comprises: acquiring a delay for representing a network state; comparing the delay with a pre-set delay threshold; and controlling a sending strategy of a client according to a comparison result.

Description

网络拥塞控制方法、装置及客户端Network congestion control method, device and client 技术领域Technical field
本申请涉及但不限于通信技术领域。This application relates to, but is not limited to, the field of communication technology.
背景技术Background technique
网络拥塞是指在分组交换网络中传送分组的数目太多时,由于存储转发节点的资源有限而造成网络传输性能下降的情况。当网络发生拥塞时,一般会出现数据丢失,时延增加,吞吐量下降等状况,严重时甚至会导致“拥塞崩溃”。一般导致网络拥塞发生主要有这样几个因素:存储空间的限制、带宽容量的限制以及处理器性能的限制。在相关技术中,客户端并不了解当前传输网络环境或服务端的处理能力,始终按照自己的最大处理能力发送请求消息,当传输网络条件差或服务端的处理能力较弱时,会造成大量请求消息拥塞在网络中或挤压在服务端,进一步恶化网络环境或压垮服务端,因此迫切需要一种能够进行链路拥塞控制的方法。Network congestion refers to a situation in which the network transmission performance is degraded due to the limited resources of the store-and-forward node when the number of packets transmitted in the packet-switched network is too large. When the network is congested, data loss, delay increases, and throughput drop are generally caused. In severe cases, "congestion collapse" may occur. There are several main factors that cause network congestion: storage space limitations, bandwidth capacity limitations, and processor performance limitations. In the related art, the client does not know the processing capability of the current transmission network environment or the server, and always sends the request message according to its maximum processing capability. When the transmission network condition is poor or the processing capability of the server is weak, a large number of request messages are generated. Congestion in the network or squeezed on the server side further deteriorates the network environment or crushes the server. Therefore, a method capable of link congestion control is urgently needed.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本文提供一种网络拥塞控制方法、装置及客户端,以解决相关技术中,由于客户端不了解传输网络环境或服务端的处理能力,始终按照某种单一的数据发送策略与服务端进行信息交互,而导致网络环境恶化的技术问题。The present invention provides a network congestion control method, device, and client to solve the related art. Since the client does not understand the processing network environment or the processing capability of the server, the information is always exchanged with the server according to a single data transmission policy. The technical problem that causes the network environment to deteriorate.
一种网络拥塞控制方法,包括:A network congestion control method includes:
获取用于体现网络状态的时延;Obtain a delay for reflecting the state of the network;
将所述时延与预设时延门限进行比较;Comparing the delay with a preset delay threshold;
根据比较结果控制客户端的发送策略。Control the client's sending policy based on the comparison result.
可选地,在本发明一种实施例中,所述获取的时延为表征传输网络环境的传输时延、表征服务端处理能力的处理时延或表征网络环境的总体时延。 Optionally, in an embodiment of the present invention, the acquired delay is a transmission delay that represents a transmission network environment, a processing delay that characterizes a processing capability of the server, or an overall delay that characterizes the network environment.
可选地,在本发明一种实施例中,当获取的所述时延为所述传输时延时,获取所述传输时延的方式包括以下三种之一:Optionally, in an embodiment of the present invention, when the obtained delay is the transmission delay, the manner of obtaining the transmission delay includes one of the following three types:
获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端收到所述第一消息的时间作为第二时间点,将所述第二时间点与所述第一时间点之差作为所述传输时延;Obtaining, by the client, a time for sending the first message to the server as a first time point, acquiring a time when the server receives the first message as a second time point, and using the second time point The difference between the first time points is used as the transmission delay;
获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,获取所述客户端收到所述第二消息的时间作为第四时间点,将所述第四时间点与所述第三时间点之差作为所述传输时延;Obtaining, by the server, a time for sending the second message to the client as a third time point, acquiring a time when the client receives the second message as a fourth time point, and using the fourth time point The difference between the third time points is used as the transmission delay;
获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端收到所述第一消息的时间作为第二时间点,将所述第二时间点与所述第一时间点之差作为第一传输时延;获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,获取所述客户端收到所述第二消息的时间作为第四时间点,将所述第四时间点与所述第三时间点之差作为第二传输时延,计算出所述第一传输时延与所述第二传输时延的和作为所述传输时延。Obtaining, by the client, a time for sending the first message to the server as a first time point, acquiring a time when the server receives the first message as a second time point, and using the second time point The difference between the first time point is used as the first transmission delay; the time when the server sends the second message to the client is used as the third time point, and the client receives the second message. The time is taken as the fourth time point, and the difference between the fourth time point and the third time point is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as The transmission delay.
可选地,在本发明一种实施例中,当获取的所述时延为所述处理时延时,获取所述处理时延,包括:Optionally, in an embodiment of the present invention, when the obtained delay is the processing delay, acquiring the processing delay includes:
获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点,获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,将所述第三时间点与所述第二时间点之差作为所述处理时延。Obtaining, as the second time point, the time when the server receives the first message sent by the client, and acquiring the time when the server sends the second message to the client, as the third time point, where the The difference between the three time points and the second time point is taken as the processing delay.
可选地,在本发明一种实施例中,当获取的所述时延为所述总体时延时,获取所述总体时延的方式包括以下三种之一:Optionally, in an embodiment of the present invention, when the obtained delay is the overall time delay, the manner of obtaining the total delay includes one of the following three types:
获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,将所述第三时间点与所述第一时间点之差作为所述总体时延;Obtaining, as the first time, the time when the client sends the first message to the server, and acquiring the time when the server sends the second message to the client as the third time point, where the third time is a difference between the point and the first time point as the overall time delay;
获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点,获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点,将所述第四时间点与所述第二时间点之差作为所述总体时延;Obtaining, as the second time point, the time when the server receives the first message sent by the client, and acquiring the time when the client receives the second message sent by the server, as the fourth time point, Determining a difference between the fourth time point and the second time point as the overall time delay;
获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获 取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点,将所述第四时间点与所述第一时间点之差作为所述总体时延。Obtaining, as the first time, the time when the client sends the first message to the server And taking the time when the client receives the second message sent by the server as the fourth time point, and using the difference between the fourth time point and the first time point as the overall time delay.
可选地,在本发明一种实施例中,所述预设时延门限包括第一门限与第二门限,所述第一门限小于所述第二门限。Optionally, in an embodiment of the present invention, the preset delay threshold includes a first threshold and a second threshold, and the first threshold is smaller than the second threshold.
可选地,在本发明一种实施例中,所述根据比较结果控制客户端的发送策略,包括:Optionally, in an embodiment of the present invention, the controlling a sending policy of the client according to the comparison result includes:
当所述比较结果为所述时延大于或等于所述第二门限时,降低所述客户端向所述服务端发送消息的频率;When the comparison result is that the delay is greater than or equal to the second threshold, reducing a frequency at which the client sends a message to the server;
当所述比较结果为所述时延大于或等于所述第一门限且小于所述第二门限时,维持所述客户端向所述服务端发送消息的频率;And maintaining, when the comparison result is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining a frequency at which the client sends a message to the server;
当所述比较结果为所述时延小于所述第一门限时,维持所述客户端向所述服务端发送消息的频率或提高所述客户端向所述服务端发送消息的频率。And when the comparison result is that the delay is less than the first threshold, maintaining a frequency at which the client sends a message to the server or increasing a frequency at which the client sends a message to the server.
可选地,在本发明一种实施例中,所述根据比较结果控制客户端的发送策略,包括:Optionally, in an embodiment of the present invention, the controlling a sending policy of the client according to the comparison result includes:
当所述比较结果为所述时延大于或等于所述第二门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延大于或等于所述第二门限;当判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当判断结果为否时,维持所述客户端向所述服务端发送消息的频率;When the comparison result is that the delay is greater than or equal to the second threshold, determining whether the first N-1 comparison results before the current comparison result are all the delay is greater than or equal to the second threshold; If the result of the determination is yes, the frequency at which the client sends a message to the server is decreased, and when the determination result is no, the frequency at which the client sends a message to the server is maintained;
当所述比较结果为所述时延大于或等于所述第一门限且小于所述第二门限时,维持所述客户端向所述服务端发送消息的频率;And maintaining, when the comparison result is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining a frequency at which the client sends a message to the server;
当所述比较结果为所述时延小于所述第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延小于所述第一门限;当判断结果为是时,提高所述客户端向所述服务端发送消息的频率,当判断结果为否时,维持所述客户端向所述服务端发送消息的频率。When the comparison result is that the delay is less than the first threshold, determining whether the first N-1 comparison results before the current comparison result are all the delay is less than the first threshold; when the judgment result is yes The frequency of the message sent by the client to the server is increased, and when the determination result is no, the frequency at which the client sends a message to the server is maintained.
一种网络拥塞控制装置,包括:A network congestion control device includes:
时延获取模块,设置为:获取用于体现网络状态的时延;The delay acquisition module is configured to: obtain a delay for reflecting a network state;
时延比较模块,设置为:将所述时延获取模块获取的所述时延与预设时延门限进行比较; The delay comparison module is configured to: compare the delay acquired by the delay acquisition module with a preset delay threshold;
策略控制模块,设置为:根据所述时延比较模块得出的比较结果控制客户端的发送策略。The policy control module is configured to: control a sending policy of the client according to the comparison result obtained by the delay comparison module.
可选地,在本发明一种实施例中,所述时延获取模块包括传输时延获取子模块、处理时延获取子模块和总体时延获取子模块中的至少一个;Optionally, in an embodiment of the present invention, the delay obtaining module includes at least one of a transmission delay acquisition submodule, a processing delay acquisition submodule, and an overall delay acquisition submodule;
所述传输时延获取子模块设置为:获取表征传输网络环境的传输时延;The transmission delay acquisition submodule is configured to: acquire a transmission delay that characterizes a transmission network environment;
所述处理时延获取子模块设置为:获取表征服务端处理能力的处理时延;The processing delay acquisition submodule is configured to: acquire a processing delay that represents a processing capability of the server;
所述总体时延获取子模块设置为:获取表征网络环境的总体时延The overall delay acquisition submodule is configured to: obtain an overall delay characterizing a network environment
可选地,在本发明一种实施例中,所述时延获取模块包括所述传输时延获取子模块时,所述传输时延获取子模块包括:Optionally, in an embodiment of the present invention, when the time delay acquisition module includes the transmission delay acquisition submodule, the transmission delay acquisition submodule includes:
第一获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The first obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
第二获取单元,设置为:获取所述服务端收到所述第一消息的时间作为第二时间点;a second acquiring unit, configured to: acquire a time when the server receives the first message as a second time point;
第一计算单元,设置为:计算所述第二获取单元获取的所述第二时间点与所述第一获取单元获取的所述第一时间点之差作为所述传输时延;a first calculating unit, configured to: calculate, as the transmission delay, a difference between the second time point acquired by the second acquiring unit and the first time point acquired by the first acquiring unit;
或者,所述传输时延获取子模块包括:Alternatively, the transmission delay acquisition submodule includes:
第三获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;The third obtaining unit is configured to: acquire a time when the server sends the second message to the client as a third time point;
第四获取单元,设置为:获取所述客户端收到所述第二消息的时间作为第四时间点;a fourth obtaining unit, configured to: acquire a time when the client receives the second message as a fourth time point;
第二计算单元,设置为:计算所述第四获取单元获取的所述第四时间点与所述第三获取单元获取的所述第三时间点之差作为所述传输时延;a second calculating unit, configured to: calculate, as the transmission delay, a difference between the fourth time point acquired by the fourth acquiring unit and the third time point acquired by the third acquiring unit;
或者,所述传输时延获取子模块包括:Alternatively, the transmission delay acquisition submodule includes:
第五获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The fifth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
第六获取单元,设置为:获取所述服务端收到所述第一消息的时间作为第二时间点; a sixth obtaining unit, configured to: acquire a time when the server receives the first message as a second time point;
第七获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;The seventh obtaining unit is configured to: acquire a time when the server sends the second message to the client as a third time point;
第八获取单元,设置为:获取所述客户端收到所述第二消息的时间作为第四时间点;An eighth obtaining unit, configured to: acquire a time when the client receives the second message as a fourth time point;
第三计算单元,设置为:计算所述第六获取单元获取的所述第二时间点与所述第五获取单元获取的所述第一时间点之差作为第一传输时延,计算所述第八获取单元获取的所述第四时间点与所述第七获取单元获取的所述第三时间点之差作为第二传输时延,并计算所述第一传输时延与所述第二传输时延之和作为所述传输时延。a third calculating unit, configured to: calculate a difference between the second time point acquired by the sixth acquiring unit and the first time point acquired by the fifth acquiring unit as a first transmission delay, and calculate the a difference between the fourth time point acquired by the eighth obtaining unit and the third time point acquired by the seventh acquiring unit as a second transmission delay, and calculating the first transmission delay and the second The sum of transmission delays is taken as the transmission delay.
可选地,在本发明一种实施例中,所述时延获取模块包括所述处理时延获取子模块时,所述处理时延获取子模块包括:Optionally, in an embodiment of the present invention, when the time delay obtaining module includes the processing delay acquiring submodule, the processing delay obtaining submodule includes:
第九获取单元,设置为:获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点;The ninth obtaining unit is configured to: acquire, as the second time point, the time when the server receives the first message sent by the client;
第十获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;The tenth acquiring unit is configured to: acquire, as the third time point, a time when the server sends the second message to the client;
第四计算单元,设置为:计算所述第十获取单元获取的所述第三时间点与所述第九获取单元获取的所述第二时间点之差作为所述处理时延。The fourth calculating unit is configured to: calculate, as the processing delay, a difference between the third time point acquired by the tenth acquiring unit and the second time point acquired by the ninth acquiring unit.
可选地,在本发明一种实施例中,所述时延获取模块包括所述总体时延获取子模块时,所述总体时延获取子模块包括:Optionally, in an embodiment of the present invention, when the time delay acquisition module includes the total delay acquisition submodule, the total delay acquisition submodule includes:
第十一获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The eleventh acquiring unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
第十二获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;a twelfth obtaining unit, configured to: acquire a time when the server sends a second message to the client as a third time point;
第五计算单元,设置为:计算所述第十二获取单元获取的所述第三时间点与所述第十一获取单元获取的所述第一时间点之差作为所述总体时延;a fifth calculating unit, configured to: calculate, as the overall delay, a difference between the third time point acquired by the twelfth acquiring unit and the first time point acquired by the eleventh acquiring unit;
或者,所述总体时延获取子模块包括:Alternatively, the overall delay acquisition submodule includes:
第十三获取单元,设置为:获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点; a thirteenth obtaining unit, configured to: acquire a time when the server receives the first message sent by the client as a second time point;
第十四获取单元,设置为:获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点;a fourteenth obtaining unit, configured to: acquire a time when the client receives the second message sent by the server as a fourth time point;
第六计算单元,设置为:计算所述第十四获取单元获取的所述第四时间点与所述第十三获取单元获取的所述第二时间点之差作为所述总体时延;a sixth calculating unit, configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the fourteenth acquiring unit and the second time point acquired by the thirteenth acquiring unit;
或者,所述总体时延获取子模块包括:Alternatively, the overall delay acquisition submodule includes:
第十五获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The fifteenth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
第十六获取单元,设置为:获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点;a sixteenth obtaining unit, configured to: acquire a time when the client receives the second message sent by the server as a fourth time point;
第七计算单元,设置为:计算所述第十六获取单元获取的所述第四时间点与所述第十五获取单元获取的所述第一时间点之差作为所述总体时延。The seventh calculating unit is configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the sixteenth acquiring unit and the first time point acquired by the fifteenth acquiring unit.
可选地,在本发明一种实施例中,所述时延比较模块包括第一门限比较子模块和第二门限比较子模块;Optionally, in an embodiment of the present invention, the delay comparison module includes a first threshold comparison submodule and a second threshold comparison submodule;
所述第一门限比较子模块设置为:将所述时延获取模块获取的所述时延与第一门限进行比较;The first threshold comparison submodule is configured to: compare the time delay acquired by the delay acquisition module with a first threshold;
所述第二门限比较子模块设置为:将所述时延获取模块获取的所述时延与第二门限进行比较。The second threshold comparison submodule is configured to compare the time delay acquired by the delay acquisition module with a second threshold.
可选地,在本发明一种实施例中,所述策略控制模块根据所述时延比较模块得出的比较结果控制客户端的发送策略,包括:Optionally, in an embodiment of the present invention, the policy control module controls a sending policy of the client according to the comparison result obtained by the delay comparison module, including:
当所述时延比较模块获得的比较结果为所述时延大于或等于所述第二门限时,所述策略控制模块是设置为:降低所述客户端向所述服务端发送消息的频率;When the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the second threshold, the policy control module is configured to: reduce a frequency at which the client sends a message to the server;
当所述时延比较模块获得的比较结果为所述时延大于或等于所述第一门限且小于所述第二门限时,所述策略控制模块是设置为:维持所述客户端向所述服务端发送消息的频率;When the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the first threshold and less than the second threshold, the policy control module is configured to: maintain the client to the The frequency at which the server sends messages;
当所述时延比较模块获得的比较结果为所述时延小于所述第一门限时,所述策略控制模块是设置为:维持所述客户端向所述服务端发送消息的频率或提高所述客户端向所述服务端发送消息的频率。 When the comparison result obtained by the delay comparison module is that the delay is less than the first threshold, the policy control module is configured to: maintain a frequency or improve the frequency at which the client sends a message to the server. The frequency at which the client sends a message to the server.
可选地,在本发明一种实施例中,所述策略控制模块还包括判断子模块和控制子模块:Optionally, in an embodiment of the present invention, the policy control module further includes a determining submodule and a control submodule:
所述判断子模块设置为:当所述时延比较模块获得的比较结果为所述时延大于或等于所述第二门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延大于或等于所述第二门限;所述控制子模块设置为:当所述判断子模块的判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当所述判断子模块的判断结果为否时,维持所述客户端向所述服务端发送消息的频率;The determining sub-module is configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the second threshold, determine whether the first N-1 comparison results before the current comparison result are all The control sub-module is configured to: when the judgment result of the determining sub-module is YES, reduce the frequency at which the client sends a message to the server, when And when the determining result of the determining submodule is negative, maintaining a frequency at which the client sends a message to the server;
所述控制子模块还设置为:当所述时延比较模块获得的比较结果为所述时延大于等于所述第一门限且小于所述第二门限时,维持所述客户端向所述服务端发送消息的频率;The control sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining the client to the service The frequency at which the message is sent by the terminal;
所述判断子模块还设置为:当所述时延比较模块获得的比较结果为所述时延小于所述第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延小于所述第一门限;所述控制子模块还设置为:当所述判断子模块的判断结果为是时,提高所述客户端向所述服务端发送消息的频率,当所述判断子模块的判断结果为否时,维持所述客户端向所述服务端发送消息的频率。The determining sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is less than the first threshold, determine whether the first N-1 comparison results before the current comparison result are all The control sub-module is further configured to: when the determination result of the determining sub-module is YES, increase the frequency at which the client sends a message to the server, when When the judgment result of the submodule is negative, the frequency at which the client sends a message to the server is maintained.
本发明还提供一种客户端,包括如上任一项所述的网络拥塞控制装置。The present invention also provides a client comprising the network congestion control device according to any of the above.
本发明实施例提供的网络拥塞控制方法、装置及客户端,通过获取能够表征网络状态的时延,并将获取的时延与预设时延门限进行比较,来获知当前的网络情况,然后根据比较结果控制客户端的发送的策略,达到了实时了解当前网络状态,并根据当前网络状态对客户端的数据发送策略进行调整的效果,解决了相关技术中由于客户端不了解网络环境或服务端的处理能力,始终以单一的数据发送策略进行交互,而导致网络环境恶化的问题,提高了客户端与服务端信息交互的效率,优化了网络资源配置。The network congestion control method, device, and client provided by the embodiment of the present invention obtain the time delay of the network state, and compare the acquired delay with the preset delay threshold to learn the current network condition, and then according to the current network situation. The comparison result controls the sending policy of the client, achieves the real-time understanding of the current network state, and adjusts the data transmission policy of the client according to the current network state, and solves the problem that the processing capability of the network environment or the server is not understood by the client in the related technology. It always interacts with a single data transmission strategy, which leads to the deterioration of the network environment, improves the efficiency of client-server interaction, and optimizes network resource configuration.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述 BRIEF abstract
图1为本发明实施例一提供的一种网络拥塞控制方法的流程图;FIG. 1 is a flowchart of a network congestion control method according to Embodiment 1 of the present invention;
图2为本发明实施例二提供的一种的网络拥塞控制装置的结构示意图;2 is a schematic structural diagram of a network congestion control apparatus according to Embodiment 2 of the present invention;
图3为图2所示实施例提供的网络拥塞控制装置中一种时延获取模块的结构示意图;3 is a schematic structural diagram of a delay acquisition module in a network congestion control apparatus provided in the embodiment shown in FIG. 2;
图4为图3所示实施例提供的网络拥塞控制装置中一种传输时延获取子模块的结构示意图;4 is a schematic structural diagram of a transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图5为图3所示实施例提供的网络拥塞控制装置中另一种传输时延获取子模块的结构示意图;5 is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图6为图3所示实施例提供的网络拥塞控制装置中又一种传输时延获取子模块的结构示意图;6 is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图7为图3所示实施例提供的网络拥塞控制装置中一种处理时延获取子模块的结构示意图;7 is a schematic structural diagram of a processing delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图8为图3所示实施例提供的网络拥塞控制装置中一种总体时延获取子模块的结构示意图;8 is a schematic structural diagram of an overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图9为图3所示实施例提供的网络拥塞控制装置中另一种总体时延获取子模块的结构示意图;FIG. 9 is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图10为图3所示实施例提供的网络拥塞控制装置中又一种总体时延获取子模块的结构示意图;10 is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3;
图11为图2所示实施例提供的网络拥塞控制装置中一种时延比较模块的结构示意图;FIG. 11 is a schematic structural diagram of a delay comparison module in a network congestion control apparatus according to the embodiment shown in FIG. 2;
图12为图2所示实施例提供的网络拥塞控制装置中一种策略控制模块的结构示意图;12 is a schematic structural diagram of a policy control module in a network congestion control apparatus provided in the embodiment shown in FIG. 2;
图13为图2所示实施例提供的网络拥塞控制装置中另一种策略控制模块的结构示意图。FIG. 13 is a schematic structural diagram of another policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2.
本发明的实施方式Embodiments of the invention
下文中将结合附图对本发明的实施方式进行详细说明。需要说明的是, 在不冲突的情况下,本文中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted, The features in the embodiments and the embodiments herein may be arbitrarily combined with each other without conflict.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
通常,网络拥塞发生主要是由于存储空间与带宽容量的限制以及处理器性能的限制。因此,从理论上来说,解决网络拥塞可以从增加存储空间与带宽容量或者提升处理器性能三个方面进行,但是就实际而言,存储空间与带宽容量不可能无限制增加,处理器的性能也不可能无限提升,所以,解决网络拥塞最实用的方法是进行网络拥塞控制。本发明实施例提供的网络拥塞控制方法、装置及客户端通过获取能够传输网络环境或者服务器处理能力的时延,并将该时延与预设时延门限进行比较,然后根据比较结果控制客户端的数据发送的策略,以达到了实时了解当前网络状态,并根据当前网络状态对客户端的数据发送策略进行调整的效果。下面通过具体实施方式结合附图对本发明作进一步详细说明:Typically, network congestion occurs primarily due to storage space and bandwidth capacity limitations and processor performance limitations. Therefore, in theory, solving network congestion can be done from three aspects: increasing storage space and bandwidth capacity or improving processor performance. However, in reality, storage space and bandwidth capacity cannot be increased indefinitely, and processor performance is also improved. It is impossible to increase infinitely, so the most practical way to solve network congestion is to perform network congestion control. The network congestion control method and device and the client provided by the embodiment of the present invention obtain a delay capable of transmitting a network environment or a server processing capability, compare the delay with a preset delay threshold, and then control the client according to the comparison result. The data transmission strategy is to achieve real-time understanding of the current network status, and adjust the client's data transmission policy according to the current network status. The present invention will be further described in detail below by way of specific embodiments with reference to the accompanying drawings:
实施例一:Embodiment 1:
图1为本发明实施例一提供的一种网络拥塞控制方法的流程图。本实施例提供的网络拥塞控制方法,可以包括步骤101~步骤103:FIG. 1 is a flowchart of a network congestion control method according to Embodiment 1 of the present invention. The network congestion control method provided in this embodiment may include steps 101 to 103:
步骤101,获取用于体现网络状态的时延;Step 101: Obtain a delay for reflecting a network status.
在本实施例中,可选地,获取的时延可以是传输时延、处理时延或者总体时延。In this embodiment, the obtained delay may be a transmission delay, a processing delay, or an overall delay.
传输时延可以为客户端与服务端进行交互的信息在传输过程中所花费的时间,因此传输时延可以表征传输网络的情况。一方面,当客户端发送消息给服务端时,截取该消息的发送时间作为第一时间点,截取服务端收到该消息的时间作为第二时间点,第二时间点与第一时间点之间的时间差即为传输时延,上述第二时间点与第一时间点之间的时延仅为单向传输时延。另一方面,还可以获取另一种单向传输时延,在服务端向客户端发送消息时,截取该消息的发送时间作为第三时间点,截取客户端收到该消息的时间作为第四时间点,第四时间点与第三时间点之间的时间差也可以作为传输时延。再一 方面,上述两种单向传输时延之和为双向传输时延,也是传输时延中的一种。The transmission delay can be the time taken by the client to interact with the server in the transmission process, so the transmission delay can characterize the transmission network. On the one hand, when the client sends a message to the server, the sending time of the message is intercepted as the first time point, and the time when the server receives the message is taken as the second time point, and the second time point and the first time point are The time difference between the two is the transmission delay, and the delay between the second time point and the first time point is only a one-way transmission delay. On the other hand, another one-way transmission delay can also be obtained. When the server sends a message to the client, the sending time of the message is intercepted as the third time point, and the time when the client receives the message is taken as the fourth time. At the time point, the time difference between the fourth time point and the third time point can also be used as the transmission delay. again In terms of the two-way transmission delay, the sum of the two-way transmission delay is one of the transmission delays.
处理时延可以为服务端处理客户端发送的消息所花费的时间,即从服务端接收到客户端的请求消息到服务端向客户端发送响应消息之间的时间,处理时间体现了服务器的处理能力。当客户端向服务端发送消息时,截取服务端收到客户端发送过来的请求消息的时间作为第二时间点,截取服务端发送响应消息给客户端的时间作为第三时间点,比较所述第二时间点与所述第三时间点,得到所述第三时间点与所述第二时间点之间的时间差为处理时延。The processing delay can be the time taken by the server to process the message sent by the client, that is, the time between receiving the request message from the server and the response message sent by the server to the client, and the processing time reflects the processing capability of the server. . When the client sends a message to the server, the interception server receives the request message sent by the client as the second time point, and intercepts the time when the server sends the response message to the client as the third time point, and compares the first time. The second time point and the third time point are obtained, and the time difference between the third time point and the second time point is obtained as a processing delay.
总体时延的获取方式有多种,总的来说,总体时延的获取方式可以分为间接获取与直接获取:There are many ways to obtain the overall delay. In general, the overall delay acquisition method can be divided into indirect acquisition and direct acquisition:
由于总体时延是传输时延与处理时延的总和,因此与获取传输时延的三种形式相对应,总体时延的间接获取方式主要有以下三种:Since the overall delay is the sum of the transmission delay and the processing delay, it corresponds to the three forms of obtaining the transmission delay, and the indirect acquisition methods of the overall delay mainly have the following three types:
第一种方式:获取客户端向服务端发送请求消息的时间作为第一时间点,获取服务端收到该请求消息的时间作为第二时间点,将第二时间点与第一时间点之差作为第一传输时延,获取服务端向客户端发送响应消息的时间作为第三时间点,将第三时间点与第二时间点之差作为处理时延;计算出第一传输时延与处理时延的和作为总体时延;The first method is: obtaining the time when the client sends the request message to the server as the first time point, and obtaining the time when the server receives the request message as the second time point, and the difference between the second time point and the first time point As the first transmission delay, the time when the server sends the response message to the client is taken as the third time point, and the difference between the third time point and the second time point is taken as the processing delay; the first transmission delay and the processing are calculated. The sum of delays as the overall delay;
第二种方式:获取服务端向客户端发送响应消息的时间作为第三时间点,获取客户端收到该响应消息的时间作为第四时间点,将第四时间点与第三时间点之差作为第二传输时延,获取服务端收到客户端发送的请求消息的时间作为第二时间点,将第三时间点与第二时间点之差作为处理时延;计算出第二传输时延与处理时延的和作为总体时延;The second method is to obtain the time when the server sends a response message to the client as the third time point, and obtain the time when the client receives the response message as the fourth time point, and the difference between the fourth time point and the third time point. As the second transmission delay, the time when the acquiring server receives the request message sent by the client is used as the second time point, and the difference between the third time point and the second time point is used as the processing delay; and the second transmission delay is calculated. And the sum of the processing delays as the overall delay;
第三种方式:获取客户端向服务端发送请求消息的时间作为第一时间点,获取服务端收到请求消息的时间作为第二时间点,将第二时间点与第一时间点之差作为第一传输时延,获取服务端向客户端发送响应消息的时间作为第三时间点,获取客户端收到该响应消息的时间作为第四时间点,将第四时间点与第三时间点之差作为第二传输时延,计算出第一传输时延与第二传输时延的和作为传输时延,将第三时间点与第二时间点之差作为处理时延,计算出传输时延与处理时延的和作为总体时延。 The third method is: obtaining the time when the client sends the request message to the server as the first time point, and obtaining the time when the server receives the request message as the second time point, and taking the difference between the second time point and the first time point as The first transmission delay is obtained as the third time point when the server sends the response message to the client, and the time when the client receives the response message is taken as the fourth time point, and the fourth time point and the third time point are The difference is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as the transmission delay, and the difference between the third time point and the second time point is used as the processing delay, and the transmission delay is calculated. And the sum of processing delays as the overall delay.
可选地,本实施例可以采用直接获取总体时延的方式,这种方式简单,省略了间接获取的中间环节,总体时延的直接获取方式主要包括以下三种:Optionally, the method for directly obtaining the overall delay may be adopted in this embodiment. This method is simple, and the intermediate link of indirect acquisition is omitted. The direct acquisition method of the overall delay mainly includes the following three types:
第一种方式:获取客户端向服务端发送请求消息的时间为第一时间点,获取服务端向客户端发送响应消息的时间为第三时间点,直接将第三时间点与第一时间点之差即为总体时延的方式;The first method is: obtaining the time when the client sends the request message to the server is the first time, and the time for the server to send the response message to the client is the third time point, and the third time point and the first time point are directly The difference is the way of overall delay;
第二种方式:获取服务端收到客户端发送的请求消息的时间为第二时间点,获取客户端收到服务端发送的响应消息的时间为第四时间点,然后直接将第四时间点与第二时间点之差即为总体时延;The second mode: the time when the server receives the request message sent by the client is the second time point, and the time when the client receives the response message sent by the server is the fourth time point, and then the fourth time point is directly The difference from the second time point is the overall delay;
第三种方式:获取客户端向服务端发送请求消息的时间为第一时间点,获取客户端收到服务端发送的响应消息的时间为第四时间点,然后直接将第四时间点与第一时间点之差作为总体时延。The third method: obtaining the time when the client sends the request message to the server is the first time point, and obtaining the response time sent by the client to the server is the fourth time point, and then directly the fourth time point and the The difference in time is used as the overall delay.
获取时延的时候,可以采取在客户端与服务端进行交互的信息中设置时间戳的方式,即在请求消息或响应消息两种中的至少一种中增加扩展字段,客户端与服务端中发送信息的一方在扩展字段中记录下发送请求消息或响应消息的时间戳,当另一方收到信息的时候,将信息中包含的时间戳与自己的系统时间进行比较,计算出该消息在传输过程中的时延。例如,在本发明一种实施例中,客户端在向服务端发送请求消息的时候可以在该请求消息中设置发送时刻的时间戳,当服务端收到请求消息的时候,从中获取到时间戳,同自己的系统时间进行对比,获得该请求消息的传输时延。When the delay is obtained, the time stamp may be set in the information exchanged between the client and the server, that is, the extension field is added in at least one of the request message or the response message, and the client and the server are added. The party that sends the information records the timestamp of the sending request message or the response message in the extension field. When the other party receives the information, it compares the timestamp contained in the information with its own system time, and calculates that the message is transmitted. The delay in the process. For example, in an embodiment of the present invention, when sending a request message to a server, the client may set a timestamp of the sending time in the request message, and when the server receives the request message, obtain a timestamp from the server. Compare with your own system time to obtain the transmission delay of the request message.
本发明实施例在实际应用中,设置时间戳的方式不拘于上述方式,例如,客户端可以记录下其向服务端发送请求消息的时间,但并不在请求消息中设置该时间的时间戳,当服务端收到上述请求消息的时候,记录下收到的时间,并将该时间的时间戳设置在回复客户端的响应消息中,当客户端收到服务端回复的响应消息后,从响应消息中获得服务端设置的时间戳,同其先前记录的时间进行比较,获得上述请求消息的传输时延。In the actual application, the method of setting the timestamp is not limited to the foregoing manner. For example, the client may record the time when the request message is sent to the server, but the timestamp of the time is not set in the request message. When the server receives the above request message, it records the received time, and sets the timestamp of the time in the response message of the replying client. When the client receives the response message replied by the server, the response message is received from the response message. Obtain the timestamp set by the server and compare it with the time of the previous record to obtain the transmission delay of the above request message.
上述由客户端或者服务端中的一方设置时间戳,另一方计算时延的方式,要求客户端与服务端的系统时间必须同步。The above method is set by one of the client or the server, and the other party calculates the delay, and the system time of the client and the server must be synchronized.
可选地,在本实施例中,设置时间戳的一方即是计算时延的一方,例如,当客户端向服务端发送请求消息的时候,在该请求消息中设置发送时刻的时 间戳,当服务端收到该请求消息并发送响应消息的时候,将该时间戳复制到响应消息的扩展字段中,当客户端收到服务端发送的响应消息后,从中获取到时间戳,与自己的系统时间进行对比,可以计算出传输时延与处理时延之和,用于体现总体网络状况。这种获取时延的方式与上述由客户端或者服务端中的一方设置时间戳,另一方计算时延的方式相比,不必要求服务端与客户端的系统时间同步。Optionally, in this embodiment, the party that sets the timestamp is the party that calculates the delay. For example, when the client sends the request message to the server, when the sending time is set in the request message, The timestamp, when the server receives the request message and sends a response message, the timestamp is copied into the extension field of the response message, and when the client receives the response message sent by the server, the timestamp is obtained. Compared with your own system time, you can calculate the sum of transmission delay and processing delay to reflect the overall network status. This method of obtaining the delay is not required to set the time stamp by one of the client or the server, and the other party does not need to require the system time synchronization between the server and the client.
可选地,本发明还提供一种实施例,通过设置计数器的方式获得时延,客户端可以在向服务端发送请求消息的时候开始利用计数器进行计时,当其收到来自服务端的响应消息时停止计时,这种方式简单,不需要在客户端与服务端的交互信息中增加扩展字段,也不需要进行计算。Optionally, the present invention further provides an embodiment, the delay is obtained by setting a counter, and the client may start to use the counter to start timing when sending the request message to the server, when receiving the response message from the server. Stop timing, this method is simple, there is no need to add extension fields in the interaction information between the client and the server, and no calculation is needed.
步骤102,将获取的时延与预设时延门限进行比较;Step 102: Compare the acquired delay with a preset delay threshold.
时延与预设时延门限的大小比较的结果可以体现当前的网络状态,可选地,在本实施例中,可以设置两个预设门限,即预设时延门限包括第一门限与第二门限,第一门限小于第二门限,当上述时延的值大于或等于第二门限,则表示当前网络状态恶劣;当上述时延的值大于或等于第一门限且小于第二门限,则表示当前网络状态正常;当上述时延的值小于第一门限,则表示当前网络状态良好。The result of the comparison between the delay and the preset delay threshold may reflect the current network state. Optionally, in this embodiment, two preset thresholds may be set, that is, the preset delay threshold includes the first threshold and the first threshold. The second threshold is that the first threshold is less than the second threshold. When the value of the delay is greater than or equal to the second threshold, the current network state is bad. When the value of the delay is greater than or equal to the first threshold and less than the second threshold, Indicates that the current network status is normal. When the value of the above delay is less than the first threshold, the current network status is good.
预设时延门限的值可以由用户自主设置,用户可以根据其使用的网络的存储空间与带宽容量以及处理器的性能进行比较灵活的设置。可选地,在实际应用中,第一门限的值可以等于第二门限的值。The value of the preset delay threshold can be set by the user, and the user can flexibly set according to the storage space and bandwidth capacity of the network used by the user and the performance of the processor. Optionally, in practical applications, the value of the first threshold may be equal to the value of the second threshold.
步骤103,根据比较结果控制客户端的发送策略。Step 103: Control a sending policy of the client according to the comparison result.
根据上述步骤获取到比较结果后,可以根据比较结果对当前客户端的发送策略进行控制。可选地,当比较结果为时延大于或等于第二门限时,降低客户端向服务端发送消息的频率;当比较结果为时延大于等于第一门限且小于第二门限时,维持客户端向服务端发送消息的频率;当比较结果为时延小于第一门限时,维持客户端向服务端发送消息的频率或提高客户端向服务端发送消息的频率。After obtaining the comparison result according to the above steps, the current client's transmission policy may be controlled according to the comparison result. Optionally, when the comparison result is that the delay is greater than or equal to the second threshold, the frequency of sending the message by the client to the server is decreased; when the comparison result is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining the client The frequency at which the message is sent to the server; when the comparison result is that the delay is less than the first threshold, the frequency at which the client sends a message to the server is maintained or the frequency at which the client sends a message to the server is increased.
本发明还提供另一种可选地实施例,当比较结果为时延大于或等于第二 门限时,判断当前比较结果之前的前N-1次比较结果是否均为时延大于所述第二门限,即判断是否已经存在N次比较结果为时延大于或等于第二门限,当前比较结果即为第N次比较结果;当判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当判断结果为否时,维持客户端向服务端发送消息的频率;当比较结果为时延小于第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为时延小于第一门限,即判断是否已经存在N次比较结果为时延小于第二门限,同样当前比较结果即为第N次比较结果;当判断结果为是时,提高客户端向服务端发送消息的频率,当判断结果为否时,维持客户端向服务端发送消息的频率;当比较结果为时延大于或等于第一门限且小于第二门限时,直接维持客户端向服务端发送消息的频率。The present invention also provides another optional embodiment, when the comparison result is that the delay is greater than or equal to the second When the threshold is determined, it is determined whether the first N-1 comparison results before the current comparison result are all the time delays greater than the second threshold, that is, whether there are already N comparison results, the delay is greater than or equal to the second threshold, and the current comparison result That is, the result of the Nth comparison; when the judgment result is YES, the frequency at which the client sends a message to the server is decreased, and when the judgment result is no, the frequency at which the client sends a message to the server is maintained; If the delay is less than the first threshold, it is determined whether the first N-1 comparison results before the current comparison result are all less than the first threshold, that is, whether there is already N comparison results, the delay is less than the second threshold. Similarly, the current comparison result is the Nth comparison result; when the judgment result is yes, the frequency of the message sent by the client to the server is increased, and when the judgment result is no, the frequency at which the client sends the message to the server is maintained; The result is that when the delay is greater than or equal to the first threshold and less than the second threshold, the frequency of sending the message to the server by the client is directly maintained.
在本实施例中,客户端与服务端进行交互的信息类型可以包括REQMODE收发消息、Options收发消息或者Cache收发消息中的至少一种。In this embodiment, the type of information that the client interacts with the server may include at least one of a REQMODE message, an Option message, or a Cache message.
实施例二:Embodiment 2:
图2为本发明实施例二提供的一种的网络拥塞控制装置的结构示意图。本实施例提供的网络拥塞控制装置可以包括:时延获取模块201、时延比较模块202和策略控制模块203。FIG. 2 is a schematic structural diagram of a network congestion control apparatus according to Embodiment 2 of the present invention. The network congestion control apparatus provided in this embodiment may include: a delay acquisition module 201, a delay comparison module 202, and a policy control module 203.
其中,时延获取模块201,设置为:获取用于体现网络状态的时延;The delay obtaining module 201 is configured to: obtain a delay for reflecting a network state;
可选地,请结合图3所示,为图2所提供的网络拥塞控制装置中一种时延获取模块的结构示意图,在本实施例中,时延获取模块201包括传输时延获取子模块2011、处理时延获取子模块2012和总体时延获取子模块2013中的至少一个。Optionally, as shown in FIG. 3, which is a schematic structural diagram of a delay acquisition module in the network congestion control apparatus provided in FIG. 2, in this embodiment, the delay acquisition module 201 includes a transmission delay acquisition submodule. 2011, processing at least one of a delay acquisition sub-module 2012 and an overall delay acquisition sub-module 2013.
传输时延获取子模块2011设置为:获取传输时延,该传输时延为客户端与服务端进行交互的信息在传输过程中所花费的时间,因此该传输时延可以表征传输网络的情况。传输时延获取子模块2011可以包括以下三种结构中的其中一种:The transmission delay acquisition sub-module 2011 is configured to: obtain a transmission delay, which is a time that the information exchanged between the client and the server in the transmission process, and thus the transmission delay can represent the condition of the transmission network. The transmission delay acquisition sub-module 2011 may include one of the following three structures:
第一种结构,如图4所示,为图3所示实施例提供的网络拥塞控制装置中一种传输时延获取子模块的结构示意图,图4所示的传输时延获取子模块2011包括第一获取单元401,第二获取单元402和第一计算单元403。 The first structure, as shown in FIG. 4, is a schematic structural diagram of a transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG. The first obtaining unit 401, the second obtaining unit 402, and the first calculating unit 403.
当客户端发送消息给服务端时,第一获取单元401设置为:截取该消息的发送时间作为第一时间点,第二获取单元402设置为:截取服务端收到该消息的时间作为第二时间点,第一计算单元403设置为:计算得到第二获取单元402获取的第二时间点与第一获取单元401获取的第一时间点之间的时间差即为传输时延。第二时间点与第一时间点之间的时延仅为单向传输时延。类似地,传输时延获取子模块2011还可以获取另一种单向传输时延,该种单向传输时延由第二种传输时延获取子模块2011获取。When the client sends a message to the server, the first obtaining unit 401 is configured to: intercept the sending time of the message as the first time point, and the second obtaining unit 402 is configured to: intercept the time when the server receives the message as the second time. At the time point, the first calculating unit 403 is configured to: calculate a time difference between the second time point acquired by the second obtaining unit 402 and the first time point acquired by the first acquiring unit 401, that is, a transmission delay. The delay between the second time point and the first time point is only a one-way transmission delay. Similarly, the transmission delay acquisition sub-module 2011 can also acquire another one-way transmission delay, which is obtained by the second transmission delay acquisition sub-module 2011.
第二种结构,如图5所示,为图3所示实施例提供的网络拥塞控制装置中另一种传输时延获取子模块的结构示意图,图5所示的传输时延获取子模块2011包括第三获取单元501,第四获取单元502和第二计算单元503。在服务端向客户端发送消息时,第三获取单元501设置为:截取该消息的发送时间作为第三时间点,第四获取单元502设置为:截取客户端收到该消息的时间作为第四时间点,第二计算单元503设置为:计算第四获取单元502获取的第四时间点与第三获取单元501获取的第三时间点之间的时间差作为传输时延。The second structure, as shown in FIG. 5, is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG. The third obtaining unit 501, the fourth obtaining unit 502, and the second calculating unit 503 are included. When the server sends a message to the client, the third obtaining unit 501 is configured to: intercept the sending time of the message as the third time point, and the fourth obtaining unit 502 is configured to: intercept the time when the client receives the message as the fourth time. At the time point, the second calculating unit 503 is configured to calculate a time difference between the fourth time point acquired by the fourth obtaining unit 502 and the third time point acquired by the third acquiring unit 501 as the transmission delay.
可选地,在发明另一种可能的实现方式中,还可以获取上述两种单向传输时延之和作为传输时延,这种传输时延属于双向传输时延由第三种传输时延获取子模块2011获取。Optionally, in another possible implementation manner of the invention, the sum of the two unidirectional transmission delays may be obtained as a transmission delay, where the transmission delay belongs to the bidirectional transmission delay by the third transmission delay. Get the submodule 2011 get.
第三种结构,如图6所示,为图3所示实施例提供的网络拥塞控制装置中又一种传输时延获取子模块的结构示意图,图6所示的传输时延获取子模块2011包括第五获取单元601、第六获取单元602、第七获取单元603、第八获取单元604以及第三计算单元605,当客户端发送消息给服务端时,第五获取单元601设置为:截取该消息的发送时间作为第一时间点,第六获取单元602设置为:截取服务端收到该消息的时间作为第二时间点,在服务端向客户端发送消息时,第七获取单元603设置为:截取该消息的发送时间作为第三时间点,第八获取单元604设置为:截取客户端收到该消息的时间作为第四时间点,而第三计算单元605设置为:计算第六获取单元602获取的第二时间点与第五获取单元601获取的第一时间点之差作为第一传输时延,计算第八获取单元604获取的第四时间点与第七获取单元603获取的第三时间点之差作为第二传输时延,然后通过计算第一传输时延与第二传输时延之和作为传输时延。 The third structure, as shown in FIG. 6, is a schematic structural diagram of another transmission delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the transmission delay acquisition submodule 2011 shown in FIG. The fifth obtaining unit 601, the sixth obtaining unit 602, the seventh obtaining unit 603, the eighth obtaining unit 604, and the third calculating unit 605, when the client sends a message to the server, the fifth obtaining unit 601 is configured to: intercept The sending time of the message is used as the first time point, and the sixth obtaining unit 602 is configured to: intercept the time when the server receives the message as the second time point, and when the server sends a message to the client, the seventh acquiring unit 603 sets To: intercept the sending time of the message as the third time point, the eighth obtaining unit 604 is configured to: intercept the time when the client receives the message as the fourth time point, and the third calculating unit 605 is configured to: calculate the sixth acquiring The difference between the second time point acquired by the unit 602 and the first time point acquired by the fifth obtaining unit 601 is used as the first transmission delay, and the fourth time point and the seventh acquired by the eighth obtaining unit 604 are calculated. The difference between the third time points acquired by the obtaining unit 603 is used as the second transmission delay, and then the sum of the first transmission delay and the second transmission delay is calculated as the transmission delay.
可选地,处理时延获取子模块2012设置为:获取处理时延,该处理时延可以为服务端处理客户端发送的消息所花费的时间,即从服务端接收到客户端的请求消息到服务端向客户端发送响应消息之间的时间,处理时延体现了服务器的处理能力。如图7所示,为图3所示所示实施例提供的网络拥塞控制装置中一种处理时延获取子模块的结构示意图,图7所示处理时延获取子模块2012包括:第九获取单元701、第十获取单元702以及第四计算单元703,在获取处理时延的时候,第九获取单元701设置为:截取服务端收到客户端发送过来的请求消息的时间作为第二时间点,第十获取单元702设置为:截取服务端发送响应消息给客户端的时间作为第三时间点,第四计算单元703设置为:比较第十获取单元702获取的第二时间点与第九获取单元701获取的第三时间点,得到所述第三时间点与所述第二时间点之间的时间差作为处理时延。Optionally, the processing delay acquisition sub-module 2012 is configured to: obtain a processing delay, where the processing delay may be a time taken by the server to process the message sent by the client, that is, the client receives the request message from the server to the service. The time between sending a response message to the client, and the processing delay reflects the processing power of the server. As shown in FIG. 7, a schematic diagram of a processing delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, the processing delay acquisition submodule 2012 shown in FIG. 7 includes: a ninth acquisition The unit 701, the tenth obtaining unit 702, and the fourth calculating unit 703, when acquiring the processing delay, the ninth obtaining unit 701 is configured to: intercept the time when the server receives the request message sent by the client as the second time point. The tenth obtaining unit 702 is configured to: intercept the time when the server sends the response message to the client as the third time point, and the fourth calculating unit 703 is configured to: compare the second time point acquired by the tenth obtaining unit 702 with the ninth acquiring unit. At a third time point acquired by 701, a time difference between the third time point and the second time point is obtained as a processing delay.
可选地,总体时延获取子模块2013可以有多种结构:Optionally, the overall delay acquisition sub-module 2013 can have multiple structures:
第一种结构,如图8所示,为图3所示实施例提供的网络拥塞控制装置中一种总体时延获取子模块的结构示意图,图8所示总体时延获取子模块2013包括第十一获取单元801、第十二获取单元802和第五计算单元803;第十一获取单元801设置为:获取客户端给服务端发送请求消息的时间为第一时间点,第十二获取单元802设置为:获取服务端发送响应消息的时间为第三时间点,第五计算单元803设置为:计算第十二获取单元802获取的第三时间点与第十一获取单元801获取的第一时间点之差作为总体时延;The first structure, as shown in FIG. 8, is a schematic structural diagram of an overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule 2013 shown in FIG. The eleventh obtaining unit 801, the twelfth obtaining unit 802, and the fifth calculating unit 803 are configured to: acquire the time when the client sends the request message to the server as the first time point, and the twelfth acquiring unit The 802 is set to: obtain the server to send the response message to the third time point, and the fifth calculating unit 803 is configured to: calculate the third time point acquired by the twelfth acquiring unit 802 and the first acquired by the eleventh acquiring unit 801 The difference in time points as the overall delay;
第二种结构,如图9所示,为图3所示所示实施例提供的网络拥塞控制装置中另一种总体时延获取子模块的结构示意图,图9所示总体时延获取子模块2013包括第十三获取单元901、第十四获取单元902和第六计算单元903;第十三获取单元901设置为:获取服务端收到客户端发送的请求消息的时间为第二时间点,第十四获取单元902设置为:获取客户端收到服务端发送的响应消息的时间为第四时间点,第六计算单元903设置为:计算第十四获取单元902获取的第四时间点与第十三获取单元901获取的第二时间点之差作为总体时延;The second structure, as shown in FIG. 9, is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule shown in FIG. The 2013 includes a thirteenth obtaining unit 901, a fourteenth obtaining unit 902, and a sixth calculating unit 903. The thirteenth obtaining unit 901 is configured to: obtain a time when the server receives the request message sent by the client, and the time is the second time point. The fourteenth obtaining unit 902 is configured to: acquire the time when the client receives the response message sent by the server is the fourth time point, and the sixth calculating unit 903 is configured to: calculate the fourth time point acquired by the fourteenth obtaining unit 902 The difference between the second time points acquired by the thirteenth obtaining unit 901 is taken as an overall delay;
第三种结构,如图10所示,为图3所示所示实施例提供的网络拥塞控制装置中又一种总体时延获取子模块的结构示意图,图10所示总体时延获取子模块2013包括第十五获取单元1001、第十六获取单元1002和第七计算单元1003; 第十五获取单元1001设置为获取客户端给服务端发送请求消息的时间为第一时间点,第十六获取单元1002设置为获取客户端收到服务端发送的响应消息的时间为第四时间点,第七计算单元设置为1003计算第十六获取单元1002获取的第四时间点与第十五获取单元1001获取的第一时间点之差作为总体时延。The third structure, as shown in FIG. 10, is a schematic structural diagram of another overall delay acquisition submodule in the network congestion control apparatus provided in the embodiment shown in FIG. 3, and the overall delay acquisition submodule shown in FIG. 2013 includes a fifteenth obtaining unit 1001, a sixteenth obtaining unit 1002, and a seventh calculating unit 1003; The fifteenth obtaining unit 1001 is configured to acquire the time when the client sends the request message to the server is the first time point, and the sixteenth obtaining unit 1002 is configured to acquire the time when the client receives the response message sent by the server is the fourth time. The seventh calculation unit is set to 1003 to calculate a difference between the fourth time point acquired by the sixteenth acquisition unit 1002 and the first time point acquired by the fifteenth acquisition unit 1001 as the overall time delay.
上述三种总体时延获取子模块2013都是通过直接获取的方式得到总体时延的,由于总体时延是传输时延与处理时延的总和,总体时延获取子模块2013可以通过先分别获取传输时延与处理时延,然后计算得到传输时延与处理时延的和的方式来获得总体时延,因此,总体时延获取子模块2013还可以为另外三种结构:The overall delay acquisition sub-module 2013 obtains the overall delay by using the direct acquisition method. Since the overall delay is the sum of the transmission delay and the processing delay, the overall delay acquisition sub-module 2013 can be separately obtained. The transmission delay and the processing delay are calculated, and then the sum of the transmission delay and the processing delay is calculated to obtain the overall delay. Therefore, the overall delay acquisition sub-module 2013 can also be three other structures:
第四种总体时延获取子模块,获取客户端发送请求消息给服务端的时间作为第一时间点,获取服务端收到该请求消息的时间作为第二时间点,将第二时间点与第一时间点之差作为第一传输时延,获取服务端发送响应消息的时间作为第三时间点,将第三时间点与第二时间点之差作为处理时延;计算出第一传输时延与处理时延的和作为总体时延;The fourth overall delay acquisition sub-module obtains the time when the client sends the request message to the server as the first time point, and obtains the time when the server receives the request message as the second time point, and the second time point and the first time The difference between the time points is used as the first transmission delay, and the time when the server sends the response message is taken as the third time point, and the difference between the third time point and the second time point is taken as the processing delay; the first transmission delay is calculated. Handling the sum of delays as an overall delay;
第五种总体时延获取子模块,获取服务端发送响应消息的时间作为第三时间点,获取客户端收到该响应消息的时间作为第四时间点,将第四时间点与第三时间点之差作为第二传输时延,获取服务端收到客户端发送的请求消息的时间作为第二时间点,将第三时间点与第二时间点之差作为处理时延;计算出第二传输时延与处理时延的和作为总体时延;The fifth overall delay acquisition sub-module obtains the time when the server sends the response message as the third time point, and obtains the time when the client receives the response message as the fourth time point, and the fourth time point and the third time point The difference is used as the second transmission delay, and the time when the server receives the request message sent by the client is used as the second time point, and the difference between the third time point and the second time point is used as the processing delay; the second transmission is calculated. The sum of the delay and the processing delay as the overall delay;
第六种总体时延获取子模块,获取客户端发送请求消息给服务端的时间作为第一时间点,获取服务端收到请求消息的时间作为第二时间点,将第二时间点与第一时间点之差作为第一传输时延,获取服务端发送响应消息给客户端的时间作为第三时间点,获取客户端收到该响应消息的时间作为第四时间点,将第四时间点与第三时间点之差作为第二传输时延,计算出第一传输时延与第二传输时延的和作为传输时延,将第三时间点与第二时间点之差作为处理时延,计算出传输时延与处理时延的和作为总体时延。The sixth overall delay acquisition sub-module obtains the time when the client sends the request message to the server as the first time point, and obtains the time when the server receives the request message as the second time point, and the second time point and the first time The difference between the points is used as the first transmission delay, and the time at which the server sends the response message to the client is taken as the third time point, and the time when the client receives the response message is obtained as the fourth time point, and the fourth time point and the third time point are obtained. The difference between the time points is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as the transmission delay, and the difference between the third time point and the second time point is used as the processing delay, and the calculation is calculated. The sum of the transmission delay and the processing delay is taken as the overall delay.
可选地,时延获取模块201获取时延的时候,可以采取在客户端与服务端进行交互的信息中设置时间戳的方式,即在请求消息或响应消息两种中的至 少一种中增加扩展字段,客户端与服务端中发送信息的一方在扩展字段中记录下发送请求消息或响应消息的时间戳,当另一方收到信息的时候,将信息中包含的时间戳与自己的系统时间进行比较,计算出该消息在传输过程中的时延。例如,在本发明一种实施例中,传输时延获取子模块2011在客户端向服务端发送请求消息的时候可以在该请求消息中设置发送时刻的时间戳,当服务端收到请求消息的时候,传输时延获取子模块2011从中获取到时间戳,同服务端的系统时间进行对比,获得该请求消息的传输时延。Optionally, when the delay obtaining module 201 obtains the delay, the time stamp may be set in the information that the client interacts with the server, that is, in the request message or the response message. The extension field is added in one less case, and the party sending the information in the client and the server records the timestamp of sending the request message or the response message in the extension field, and when the other party receives the information, the timestamp included in the message is included. Compare with your own system time and calculate the delay of the message during transmission. For example, in an embodiment of the present invention, the transmission delay acquisition sub-module 2011 may set a timestamp of the sending time in the request message when the client sends the request message to the server, when the server receives the request message. At the same time, the transmission delay acquisition sub-module 2011 obtains a timestamp from the server, and compares with the system time of the server to obtain the transmission delay of the request message.
本发明实施例在实际应用中,设置时间戳的方式不拘于上述方式,例如,客户端可以记录下其向服务端发送请求消息的时间,但并不在请求消息中设置该时间的时间戳,当服务端收到上述请求消息的时候,记录下收到的时间,并将该时间的时间戳设置在回复客户端的响应消息中,当客户端收到服务端回复的响应消息后,从响应消息中获得服务端设置的时间戳,同其先前记录的时间进行比较,获得上述请求消息的传输时延。In the actual application, the method of setting the timestamp is not limited to the foregoing manner. For example, the client may record the time when the request message is sent to the server, but the timestamp of the time is not set in the request message. When the server receives the above request message, it records the received time, and sets the timestamp of the time in the response message of the replying client. When the client receives the response message replied by the server, the response message is received from the response message. Obtain the timestamp set by the server and compare it with the time of the previous record to obtain the transmission delay of the above request message.
上述由客户端或者服务端中的一方设置时间戳,另一方计算时延的方式,要求客户端与服务端的系统时间必须同步。The above method is set by one of the client or the server, and the other party calculates the delay, and the system time of the client and the server must be synchronized.
可选地,在本实施例中,设置时间戳的一方即是计算时延的一方,例如,当客户端向服务端发送请求消息的时候,在该请求消息中设置发送时刻的时间戳,当服务端收到该请求消息并发送响应消息的时候,将该时间戳复制到响应消息的扩展字段中,当客户端收到服务端发送的响应消息后,从中获取到时间戳,与自己的系统时间进行对比,可以计算出传输时延与处理时延之和,用于体现总体网络状况。这种获取时延的方式与上述由客户端或者服务端中的一方设置时间戳,另一方计算时延的方式相比,不必要求服务端与客户端的系统时间同步。Optionally, in this embodiment, the party that sets the timestamp is the party that calculates the time delay. For example, when the client sends the request message to the server, the timestamp of the sending time is set in the request message. When the server receives the request message and sends a response message, the server copies the timestamp into the extension field of the response message. When the client receives the response message sent by the server, it obtains the timestamp from the system and the system. By comparing the time, the sum of the transmission delay and the processing delay can be calculated to reflect the overall network condition. This method of obtaining the delay is not required to set the time stamp by one of the client or the server, and the other party does not need to require the system time synchronization between the server and the client.
可选地,本发明还提供一种实施例,时延获取模块201通过设置计数器的方式获得时延,可以在客户端向服务端发送请求消息的时候开始利用计数器进行计时,当客户端收到来自服务端的响应消息时停止计时,这种方式简单,不需要在客户端与服务端的交互信息中增加扩展字段,也不需要进行计算。Optionally, the present invention further provides an embodiment, the delay obtaining module 201 obtains a delay by setting a counter, and can start timing by using a counter when the client sends a request message to the server, when the client receives When the response message from the server stops timing, this method is simple, and there is no need to add an extension field in the interaction information between the client and the server, and no calculation is needed.
时延比较模块202,设置为:将时延获取模块201获取的时延与预设时延门限进行比较;可选地,结合图11所示,为图2所示所示实施例提供的网络拥 塞控制装置中一种时延比较模块的结构示意图,时延比较模块202包括第一门限比较子模块2021和第二门限比较子模块2022;当时延获取模块201获取到时延之后,第一门限比较子模块2021设置为:将时延获取模块201获得的时延与第一门限进行比较,并得出结果,第二门限比较子模块2022设置为:将时延获取模块201获得的时延与第二门限进行比较,并得出结果,当上述两个比较子模块比较的结果为上述时延的值大于或等于第二门限时,则表示当前网络状态恶劣;当上述时延的值大于或等于第一门限且小于第二门限,则表示当前网络状态正常;当上述时延的值小于第一门限,则表示当前网络状态良好。The delay comparison module 202 is configured to: compare the delay acquired by the delay acquisition module 201 with a preset delay threshold; optionally, as shown in FIG. 11, the network provided in the embodiment shown in FIG. Hold A structure diagram of a delay comparison module in the plug control device, the delay comparison module 202 includes a first threshold comparison sub-module 2021 and a second threshold comparison sub-module 2022; after the delay acquisition module 201 acquires the delay, the first threshold The comparison sub-module 2021 is configured to compare the delay obtained by the delay acquisition module 201 with the first threshold, and obtain a result. The second threshold comparison sub-module 2022 is configured to: obtain the delay obtained by the delay acquisition module 201. The second threshold is compared, and the result is obtained. When the comparison result of the two comparison sub-modules is that the value of the delay is greater than or equal to the second threshold, the current network state is bad; when the value of the delay is greater than or If the first threshold is less than the second threshold, the current network status is normal. When the value of the delay is less than the first threshold, the current network status is good.
第一门限比较子模块2021和第二门限比较子模块2022进行比较的门限值可以由用户自主设置,用户可以根据其使用的网络的存储空间与带宽容量以及处理器的性能进行比较灵活的设置,在实际应用中,第一门限的值可以等于第二门限的值。The threshold value for comparison between the first threshold comparison sub-module 2021 and the second threshold comparison sub-module 2022 can be set by the user autonomously, and the user can flexibly set according to the storage space and bandwidth capacity of the network used by the user and the performance of the processor. In practical applications, the value of the first threshold may be equal to the value of the second threshold.
策略控制模块203,设置为:根据时延比较模块202得出的比较结果控制客户端的发送策略。The policy control module 203 is configured to: control the sending policy of the client according to the comparison result obtained by the delay comparison module 202.
时延比较模块202获取到比较结果后,策略控制模块203可以根据比较结果对当前客户端的数据发送策略进行控制。可选地,当比较结果为时延大于或等于第二门限时,策略控制模块203是设置为降低客户端向服务端发送消息的频率;当比较结果为时延大于等于第一门限且小于第二门限时,策略控制模块203是设置为维持客户端向服务端发送消息的频率;当比较结果为时延小于第一门限时,策略控制模块203是设置为维持客户端向服务端发送消息的频率或提高客户端向服务端发送消息的频率。After the delay comparison module 202 obtains the comparison result, the policy control module 203 can control the data transmission policy of the current client according to the comparison result. Optionally, when the comparison result is that the delay is greater than or equal to the second threshold, the policy control module 203 is configured to reduce the frequency at which the client sends the message to the server; when the comparison result is that the delay is greater than or equal to the first threshold and is less than the first The second time threshold, the policy control module 203 is configured to maintain the frequency at which the client sends a message to the server. When the comparison result is that the delay is less than the first threshold, the policy control module 203 is configured to maintain the client sending the message to the server. Frequency or increase the frequency with which clients send messages to the server.
本发明还提供另一种可选地实施例,如图12所示,为图2所示所示实施例提供的网络拥塞控制装置中一种策略控制模块的结构示意图,策略控制模块203包括判断子模块2031和控制子模块2032,一方面,判断子模块2031设置为:当时延比较模块202得到的比较结果为时延大于第二门限时,判断当前比较结果之前的前N-1次比较结果是否均为时延大于所述第二门限,即判断是否已经存在N次比较结果为时延大于第二门限,该当前比较结果即为第N次比较结果;控制子模块2032设置为:当判断子模块2031的判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当判断子模块2031的判断结果为否 时,维持客户端向服务端发送消息的频率;另一方面,判断子模块2031还设置为:当时延比较模块202得到的比较结果为时延小于第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为时延小于第一门限,即判断是否已经存在N次比较结果为时延小于第二门限,该当前比较结果同样为第N次比较结果;相应地,控制子模块2032还设置为:当判断子模块2031的判断结果为是时,提高客户端向服务端发送消息的频率,当判断子模块2031的判断结果为否时,维持客户端向服务端发送消息的频率;再一方面,控制子模块2032还设置为:当时延比较模块202得到的比较结果为时延大于或等于第一门限且小于第二门限时,直接维持客户端向服务端发送消息的频率。The present invention further provides another optional embodiment. As shown in FIG. 12, a schematic structural diagram of a policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2, the policy control module 203 includes a judgment. The sub-module 2031 and the control sub-module 2032, on the one hand, the judging sub-module 2031 is set to: when the comparison result obtained by the current-span comparison module 202 is that the delay is greater than the second threshold, the first N-1 comparison results before the current comparison result are determined. Whether the delay is greater than the second threshold, that is, determining whether there are already N comparison results, the delay is greater than the second threshold, and the current comparison result is the Nth comparison result; the control sub-module 2032 is set to: when determining When the determination result of the submodule 2031 is YES, the frequency at which the client sends a message to the server is decreased, and when the judgment result of the submodule 2031 is negative, The frequency of the message sent by the client to the server is maintained. On the other hand, the determining sub-module 2031 is further configured to: when the comparison result obtained by the time delay comparison module 202 is that the delay is less than the first threshold, before the current comparison result is determined Whether the N-1 comparison result is less than the first threshold, that is, whether there is already N comparison results, the delay is less than the second threshold, and the current comparison result is also the Nth comparison result; accordingly, the controller The module 2032 is further configured to: when the judgment result of the determining submodule 2031 is YES, increase the frequency at which the client sends a message to the server, and when the judgment result of the submodule 2031 is negative, the client is sent to send a message to the server. On the other hand, the control sub-module 2032 is further configured to: when the comparison result obtained by the delay comparison module 202 is that the delay is greater than or equal to the first threshold and less than the second threshold, directly maintain the frequency at which the client sends a message to the server. .
可选地,在本发明提供的另外一种实施例中,如图13所示,为图2所示实施例提供的网络拥塞控制装置中另一种策略控制模块的结构示意图,控制策略调整模块203除了包括判断子模块2031和控制子模块2032外,还可以包括策略存储子模块2033,设置为:存储一定周期内做过的控制策略调整记录,这里以天作为上述周期进行说明,由于在一天中,客户端与服务端的交互具有忙时与闲时之分,在长期的交互中,每一天的忙时与闲时都处于较固定的时间段内,所以当策略存储子模块2033存储了一天中做过的控制策略调整记录后,控制子模块2032可以根据策略存储子模块2033的提供的记录对控制策略进行调整,使本发明的控制策略的调整处于网络状况之前,避免了滞后调整的缺陷。Optionally, in another embodiment provided by the present invention, as shown in FIG. 13, a schematic structural diagram of another policy control module in the network congestion control apparatus provided in the embodiment shown in FIG. 2, a control policy adjustment module In addition to the determining sub-module 2031 and the control sub-module 2032, the 203 may further include a policy storage sub-module 2033, configured to: store a control policy adjustment record that has been performed in a certain period, where the day is used as the above-mentioned period, because in one day The interaction between the client and the server has a busy time and a free time. In the long-term interaction, the busy hour and the idle time of each day are in a relatively fixed time period, so when the policy storage sub-module 2033 stores one day. After the control policy adjustment record is made, the control sub-module 2032 can adjust the control policy according to the record provided by the policy storage sub-module 2033, so that the adjustment of the control strategy of the present invention is before the network condition, and the defect of the hysteresis adjustment is avoided. .
实施例三:Embodiment 3:
在实施例二的基础上,本发明实施例还提供一种客户端,该客户端包括图2到图13所示任一实施例中提供的网络拥塞控制装置。On the basis of the second embodiment, the embodiment of the present invention further provides a client, which includes the network congestion control device provided in any of the embodiments shown in FIG. 2 to FIG.
在发明实施例提供的客户端可以是支持因特网内容修改协议(Internet Content Adaptation Protocol,简称为:ICAP)的客户端,举例来说,该客户端既可以是安装支持ICAP协议软件的个人电脑或者终端,也可以是实现ICAP协议的电信级网络节点设备。该客户端通过向服务端发送相关请求消息,以获取相关资源用于业务处理。相应地,与本发明实施例提供的客户端配合使用的服务端既可以是安装支持ICAP协议软件的个人电脑、终端或者商用服务器,也可以是实现ICAP协议的电信级网络节点设备。 The client provided in the embodiment of the present invention may be a client supporting an Internet Content Adaptation Protocol (ICAP). For example, the client may be a personal computer or a terminal that supports the ICAP protocol software. It can also be a carrier-class network node device that implements the ICAP protocol. The client obtains related resources for service processing by sending a related request message to the server. Correspondingly, the server used in conjunction with the client provided by the embodiment of the present invention may be a personal computer, a terminal or a commercial server that supports the ICAP protocol software, or a carrier-class network node device that implements the ICAP protocol.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例通过获取能够表征网络状态的时延,并将获取的时延与预设时延门限进行比较,来获知当前的网络情况,然后根据比较结果控制客户端的发送的策略,达到了实时了解当前网络状态,并根据当前网络状态对客户端的数据发送策略进行调整的效果,解决了相关技术中由于客户端不了解网络环境或服务端的处理能力,始终以单一的数据发送策略进行交互,而导致网络环境恶化的问题,提高了客户端与服务端信息交互的效率,优化了网络资源配置。 In the embodiment of the present invention, the time delay of the network state is obtained, and the obtained delay is compared with the preset delay threshold to learn the current network situation, and then the policy of the client is controlled according to the comparison result, and the real-time is achieved. Understand the current network status and adjust the data transmission policy of the client according to the current network status. The related technology solves the problem that the client does not understand the network environment or the processing capability of the server, and always interacts with a single data transmission policy. The problem that causes the network environment to deteriorate is improved, and the efficiency of the interaction between the client and the server is improved, and the network resource configuration is optimized.

Claims (17)

  1. 一种网络拥塞控制方法,包括:A network congestion control method includes:
    获取用于体现网络状态的时延;Obtain a delay for reflecting the state of the network;
    将所述时延与预设时延门限进行比较;Comparing the delay with a preset delay threshold;
    根据比较结果控制客户端的发送策略。Control the client's sending policy based on the comparison result.
  2. 根据权利要求1所述的网络拥塞控制方法,其中,所述获取的时延为表征传输网络环境的传输时延、表征服务端处理能力的处理时延或表征网络环境的总体时延。The network congestion control method according to claim 1, wherein the acquired delay is a transmission delay that characterizes a transmission network environment, a processing delay that characterizes a processing capability of the server, or an overall delay that characterizes the network environment.
  3. 根据权利要求2所述的网络拥塞控制方法,其中,当获取的所述时延为所述传输时延时,获取所述传输时延的方式包括以下三种之一:The network congestion control method according to claim 2, wherein when the obtained delay is the transmission delay, the manner of obtaining the transmission delay includes one of the following three types:
    获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端收到所述第一消息的时间作为第二时间点,将所述第二时间点与所述第一时间点之差作为所述传输时延;Obtaining, by the client, a time for sending the first message to the server as a first time point, acquiring a time when the server receives the first message as a second time point, and using the second time point The difference between the first time points is used as the transmission delay;
    获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,获取所述客户端收到所述第二消息的时间作为第四时间点,将所述第四时间点与所述第三时间点之差作为所述传输时延;Obtaining, by the server, a time for sending the second message to the client as a third time point, acquiring a time when the client receives the second message as a fourth time point, and using the fourth time point The difference between the third time points is used as the transmission delay;
    获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端收到所述第一消息的时间作为第二时间点,将所述第二时间点与所述第一时间点之差作为第一传输时延;获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,获取所述客户端收到所述第二消息的时间作为第四时间点,将所述第四时间点与所述第三时间点之差作为第二传输时延,计算出所述第一传输时延与所述第二传输时延的和作为所述传输时延。Obtaining, by the client, a time for sending the first message to the server as a first time point, acquiring a time when the server receives the first message as a second time point, and using the second time point The difference between the first time point is used as the first transmission delay; the time when the server sends the second message to the client is used as the third time point, and the client receives the second message. The time is taken as the fourth time point, and the difference between the fourth time point and the third time point is used as the second transmission delay, and the sum of the first transmission delay and the second transmission delay is calculated as The transmission delay.
  4. 根据权利要求2所述的网络拥塞控制方法,其中,当获取的所述时延为所述处理时延时,获取所述处理时延的方式,包括:The network congestion control method according to claim 2, wherein when the obtained delay is the processing delay, the manner of obtaining the processing delay includes:
    获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点,获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,将所述第三时间点与所述第二时间点之差作为所述处理时延。 Obtaining, as the second time point, the time when the server receives the first message sent by the client, and acquiring the time when the server sends the second message to the client, as the third time point, where the The difference between the three time points and the second time point is taken as the processing delay.
  5. 根据权利要求2所述的网络拥塞控制方法,其中,当获取的所述时延为所述总体时延时,获取所述总体时延的方式包括以下三种之一:The network congestion control method according to claim 2, wherein when the obtained delay is the overall time delay, the manner of obtaining the overall delay includes one of the following three types:
    获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述服务端向所述客户端发送第二消息的时间作为第三时间点,将所述第三时间点与所述第一时间点之差作为所述总体时延;Obtaining, as the first time, the time when the client sends the first message to the server, and acquiring the time when the server sends the second message to the client as the third time point, where the third time is a difference between the point and the first time point as the overall time delay;
    获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点,获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点,将所述第四时间点与所述第二时间点之差作为所述总体时延;Obtaining, as the second time point, the time when the server receives the first message sent by the client, and acquiring the time when the client receives the second message sent by the server, as the fourth time point, Determining a difference between the fourth time point and the second time point as the overall time delay;
    获取所述客户端向所述服务端发送第一消息的时间作为第一时间点,获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点,将所述第四时间点与所述第一时间点之差作为所述总体时延。Obtaining, by the client, a time for sending the first message to the server as a first time point, and acquiring a time when the client receives the second message sent by the server as a fourth time point, where the The difference between the four time points and the first time point is taken as the overall time delay.
  6. 根据权利要求1-5中任一项所述的网络拥塞控制方法,其中,所述预设时延门限包括第一门限与第二门限,所述第一门限小于所述第二门限。The network congestion control method according to any one of claims 1 to 5, wherein the preset delay threshold includes a first threshold and a second threshold, and the first threshold is smaller than the second threshold.
  7. 根据权利要求6所述的网络拥塞控制方法,其中,所述根据比较结果控制客户端的发送策略,包括:The network congestion control method according to claim 6, wherein the controlling the sending policy of the client according to the comparison result comprises:
    当所述比较结果为所述时延大于或等于所述第二门限时,降低所述客户端向所述服务端发送消息的频率;When the comparison result is that the delay is greater than or equal to the second threshold, reducing a frequency at which the client sends a message to the server;
    当所述比较结果为所述时延大于或等于所述第一门限且小于所述第二门限时,维持所述客户端向所述服务端发送消息的频率;And maintaining, when the comparison result is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining a frequency at which the client sends a message to the server;
    当所述比较结果为所述时延小于所述第一门限时,维持所述客户端向所述服务端发送消息的频率或提高所述客户端向所述服务端发送消息的频率。And when the comparison result is that the delay is less than the first threshold, maintaining a frequency at which the client sends a message to the server or increasing a frequency at which the client sends a message to the server.
  8. 根据权利要求6所述的网络拥塞控制方法,其中,所述根据比较结果控制客户端的发送策略,包括:The network congestion control method according to claim 6, wherein the controlling the sending policy of the client according to the comparison result comprises:
    当所述比较结果为所述时延大于或等于所述第二门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延大于或等于所述第二门限;当判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当判断结果为否时,维持所述客户端向所述服务端发送消息的频率;When the comparison result is that the delay is greater than or equal to the second threshold, determining whether the first N-1 comparison results before the current comparison result are all the delay is greater than or equal to the second threshold; If the result of the determination is yes, the frequency at which the client sends a message to the server is decreased, and when the determination result is no, the frequency at which the client sends a message to the server is maintained;
    当所述比较结果为所述时延大于或等于所述第一门限且小于所述第二门 限时,维持所述客户端向所述服务端发送消息的频率;When the comparison result is that the delay is greater than or equal to the first threshold and less than the second gate Limiting the frequency at which the client sends a message to the server;
    当所述比较结果为所述时延小于所述第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延小于所述第一门限;当判断结果为是时,提高所述客户端向所述服务端发送消息的频率,当判断结果为否时,维持所述客户端向所述服务端发送消息的频率。When the comparison result is that the delay is less than the first threshold, determining whether the first N-1 comparison results before the current comparison result are all the delay is less than the first threshold; when the judgment result is yes The frequency of the message sent by the client to the server is increased, and when the determination result is no, the frequency at which the client sends a message to the server is maintained.
  9. 一种网络拥塞控制装置,包括:A network congestion control device includes:
    时延获取模块,设置为:获取用于体现网络状态的时延;The delay acquisition module is configured to: obtain a delay for reflecting a network state;
    时延比较模块,设置为:将所述时延获取模块获取的所述时延与预设时延门限进行比较;The delay comparison module is configured to: compare the delay acquired by the delay acquisition module with a preset delay threshold;
    策略控制模块,设置为:根据所述时延比较模块得出的比较结果控制客户端的发送策略。The policy control module is configured to: control a sending policy of the client according to the comparison result obtained by the delay comparison module.
  10. 根据权利要求9所述的网络拥塞控制装置,其中,所述时延获取模块包括传输时延获取子模块、处理时延获取子模块和总体时延获取子模块中的至少一个;The network congestion control apparatus according to claim 9, wherein the delay acquisition module comprises at least one of a transmission delay acquisition sub-module, a processing delay acquisition sub-module, and an overall delay acquisition sub-module;
    所述传输时延获取子模块设置为:获取表征传输网络环境的传输时延;The transmission delay acquisition submodule is configured to: acquire a transmission delay that characterizes a transmission network environment;
    所述处理时延获取子模块设置为:获取表征服务端处理能力的处理时延;The processing delay acquisition submodule is configured to: acquire a processing delay that represents a processing capability of the server;
    所述总体时延获取子模块设置为:获取表征网络环境的总体时延。The overall delay acquisition sub-module is configured to: obtain an overall delay that characterizes the network environment.
  11. 根据权利要求10所述的网络拥塞控制装置,其中,所述时延获取模块包括所述传输时延获取子模块时,所述传输时延获取子模块包括:The network congestion control apparatus according to claim 10, wherein when the delay acquisition module includes the transmission delay acquisition submodule, the transmission delay acquisition submodule comprises:
    第一获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The first obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
    第二获取单元,设置为:获取所述服务端收到所述第一消息的时间作为第二时间点;a second acquiring unit, configured to: acquire a time when the server receives the first message as a second time point;
    第一计算单元,设置为:计算所述第二获取单元获取的所述第二时间点与所述第一获取单元获取的所述第一时间点之差作为所述传输时延;a first calculating unit, configured to: calculate, as the transmission delay, a difference between the second time point acquired by the second acquiring unit and the first time point acquired by the first acquiring unit;
    或者,所述传输时延获取子模块包括:Alternatively, the transmission delay acquisition submodule includes:
    第三获取单元,设置为:获取所述服务端向所述客户端发送第二消息的 时间作为第三时间点;a third obtaining unit, configured to: obtain, by the server, a second message sent to the client Time as the third time point;
    第四获取单元,设置为:获取所述客户端收到所述第二消息的时间作为第四时间点;a fourth obtaining unit, configured to: acquire a time when the client receives the second message as a fourth time point;
    第二计算单元,设置为:计算所述第四获取单元获取的所述第四时间点与所述第三获取单元获取的所述第三时间点之差作为所述传输时延;a second calculating unit, configured to: calculate, as the transmission delay, a difference between the fourth time point acquired by the fourth acquiring unit and the third time point acquired by the third acquiring unit;
    或者,所述传输时延获取子模块包括:Alternatively, the transmission delay acquisition submodule includes:
    第五获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The fifth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
    第六获取单元,设置为:获取所述服务端收到所述第一消息的时间作为第二时间点;a sixth obtaining unit, configured to: acquire a time when the server receives the first message as a second time point;
    第七获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;The seventh obtaining unit is configured to: acquire a time when the server sends the second message to the client as a third time point;
    第八获取单元,设置为:获取所述客户端收到所述第二消息的时间作为第四时间点;An eighth obtaining unit, configured to: acquire a time when the client receives the second message as a fourth time point;
    第三计算单元,设置为:计算所述第六获取单元获取的所述第二时间点与所述第五获取单元获取的所述第一时间点之差作为第一传输时延,计算所述第八获取单元获取的所述第四时间点与所述第七获取单元获取的所述第三时间点之差作为第二传输时延,并计算所述第一传输时延与所述第二传输时延之和作为所述传输时延。a third calculating unit, configured to: calculate a difference between the second time point acquired by the sixth acquiring unit and the first time point acquired by the fifth acquiring unit as a first transmission delay, and calculate the a difference between the fourth time point acquired by the eighth obtaining unit and the third time point acquired by the seventh acquiring unit as a second transmission delay, and calculating the first transmission delay and the second The sum of transmission delays is taken as the transmission delay.
  12. 根据权利要求10所述的网络拥塞控制装置,其中,所述时延获取模块包括所述处理时延获取子模块时,所述处理时延获取子模块包括:The network congestion control apparatus according to claim 10, wherein when the delay acquisition module includes the processing delay acquisition sub-module, the processing delay acquisition sub-module comprises:
    第九获取单元,设置为:获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点;The ninth obtaining unit is configured to: acquire, as the second time point, the time when the server receives the first message sent by the client;
    第十获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;The tenth acquiring unit is configured to: acquire, as the third time point, a time when the server sends the second message to the client;
    第四计算单元,设置为:计算所述第十获取单元获取的所述第三时间点与所述第九获取单元获取的所述第二时间点之差作为所述处理时延。 The fourth calculating unit is configured to: calculate, as the processing delay, a difference between the third time point acquired by the tenth acquiring unit and the second time point acquired by the ninth acquiring unit.
  13. 根据权利要求10所述的网络拥塞控制装置,其中,所述时延获取模块包括所述总体时延获取子模块时,所述总体时延获取子模块包括:The network congestion control apparatus according to claim 10, wherein when the delay acquisition module includes the overall delay acquisition submodule, the overall delay acquisition submodule comprises:
    第十一获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The eleventh acquiring unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
    第十二获取单元,设置为:获取所述服务端向所述客户端发送第二消息的时间作为第三时间点;a twelfth obtaining unit, configured to: acquire a time when the server sends a second message to the client as a third time point;
    第五计算单元,设置为:计算所述第十二获取单元获取的所述第三时间点与所述第十一获取单元获取的所述第一时间点之差作为所述总体时延;a fifth calculating unit, configured to: calculate, as the overall delay, a difference between the third time point acquired by the twelfth acquiring unit and the first time point acquired by the eleventh acquiring unit;
    或者,所述总体时延获取子模块包括:Alternatively, the overall delay acquisition submodule includes:
    第十三获取单元,设置为:获取所述服务端收到所述客户端发送的第一消息的时间作为第二时间点;a thirteenth obtaining unit, configured to: acquire a time when the server receives the first message sent by the client as a second time point;
    第十四获取单元,设置为:获取所述客户端收到所述服务端发送的第二消息的时间作为第四时间点;a fourteenth obtaining unit, configured to: acquire a time when the client receives the second message sent by the server as a fourth time point;
    第六计算单元,设置为:计算所述第十四获取单元获取的所述第四时间点与所述第十三获取单元获取的所述第二时间点之差作为所述总体时延;a sixth calculating unit, configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the fourteenth acquiring unit and the second time point acquired by the thirteenth acquiring unit;
    或者,所述总体时延获取子模块包括:Alternatively, the overall delay acquisition submodule includes:
    第十五获取单元,设置为:获取所述客户端向所述服务端发送第一消息的时间作为第一时间点;The fifteenth obtaining unit is configured to: acquire a time when the client sends the first message to the server as the first time point;
    第十六获取单元,设置为:所述客户端收到所述服务端发送的第二消息的时间作为第四时间点;a sixteenth obtaining unit, configured to: the time when the client receives the second message sent by the server is used as a fourth time point;
    第七计算单元,设置为:计算所述第十六获取单元获取的所述第四时间点与所述第十五获取单元获取的所述第一时间点之差作为所述总体时延。The seventh calculating unit is configured to: calculate, as the overall delay, a difference between the fourth time point acquired by the sixteenth acquiring unit and the first time point acquired by the fifteenth acquiring unit.
  14. 根据权利要求9-13中任一项所述的网络拥塞控制装置,其中,所述时延比较模块包括第一门限比较子模块和第二门限比较子模块;The network congestion control apparatus according to any one of claims 9-13, wherein the delay comparison module comprises a first threshold comparison sub-module and a second threshold comparison sub-module;
    所述第一门限比较子模块设置为:将所述时延获取模块获取的所述时延与第一门限进行比较;The first threshold comparison submodule is configured to: compare the time delay acquired by the delay acquisition module with a first threshold;
    所述第二门限比较子模块设置为:将所述时延获取模块获取的所述时延 与第二门限进行比较。The second threshold comparison submodule is configured to: the time delay acquired by the delay acquisition module Compare with the second threshold.
  15. 根据权利要求14所述的网络拥塞控制装置,其中,所述策略控制模块根据所述时延比较模块得出的比较结果控制客户端的发送策略,包括:The network congestion control apparatus according to claim 14, wherein the policy control module controls the sending policy of the client according to the comparison result obtained by the delay comparison module, including:
    当所述时延比较模块获得的比较结果为所述时延大于或等于所述第二门限时,所述策略控制模块是设置为:降低所述客户端向所述服务端发送消息的频率;When the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the second threshold, the policy control module is configured to: reduce a frequency at which the client sends a message to the server;
    当所述时延比较模块获得的比较结果为所述时延大于或等于所述第一门限且小于所述第二门限时,所述策略控制模块是设置为:维持所述客户端向所述服务端发送消息的频率;When the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the first threshold and less than the second threshold, the policy control module is configured to: maintain the client to the The frequency at which the server sends messages;
    当所述时延比较模块获得的比较结果为所述时延小于所述第一门限时,所述策略控制模块是设置为:维持所述客户端向所述服务端发送消息的频率或提高所述客户端向所述服务端发送消息的频率。When the comparison result obtained by the delay comparison module is that the delay is less than the first threshold, the policy control module is configured to: maintain a frequency or improve the frequency at which the client sends a message to the server. The frequency at which the client sends a message to the server.
  16. 根据权利要求14所述的网络拥塞控制装置,其中,所述策略控制模块还包括判断子模块和控制子模块:The network congestion control apparatus according to claim 14, wherein the policy control module further comprises a judgment submodule and a control submodule:
    所述判断子模块设置为:当所述时延比较模块获得的比较结果为所述时延大于或等于所述第二门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延大于或等于所述第二门限;所述控制子模块设置为:当所述判断子模块的判断结果为是时,降低所述客户端向所述服务端发送消息的频率,当所述判断子模块的判断结果为否时,维持所述客户端向所述服务端发送消息的频率;The determining sub-module is configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the second threshold, determine whether the first N-1 comparison results before the current comparison result are all The control sub-module is configured to: when the judgment result of the determining sub-module is YES, reduce the frequency at which the client sends a message to the server, when And when the determining result of the determining submodule is negative, maintaining a frequency at which the client sends a message to the server;
    所述控制子模块还设置为:当所述时延比较模块获得的比较结果为所述时延大于等于所述第一门限且小于所述第二门限时,维持所述客户端向所述服务端发送消息的频率;The control sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is greater than or equal to the first threshold and less than the second threshold, maintaining the client to the service The frequency at which the message is sent by the terminal;
    所述判断子模块还设置为:当所述时延比较模块获得的比较结果为所述时延小于所述第一门限时,判断当前比较结果之前的前N-1次比较结果是否均为所述时延小于所述第一门限;所述控制子模块还设置为:当所述判断子模块的判断结果为是时,提高所述客户端向所述服务端发送消息的频率,当所述判断子模块的判断结果为否时,维持所述客户端向所述服务端发送消息的 频率。The determining sub-module is further configured to: when the comparison result obtained by the delay comparison module is that the delay is less than the first threshold, determine whether the first N-1 comparison results before the current comparison result are all The control sub-module is further configured to: when the determination result of the determining sub-module is YES, increase the frequency at which the client sends a message to the server, when When the judgment result of the submodule is negative, the client is sent to send a message to the server. frequency.
  17. 一种客户端,包括如权利要求9-16中任一项所述的网络拥塞控制装置。 A client comprising the network congestion control device of any of claims 9-16.
PCT/CN2016/082528 2015-09-22 2016-05-18 Network congestion control method and apparatus, and client WO2017049925A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510607030.3 2015-09-22
CN201510607030.3A CN106549876A (en) 2015-09-22 2015-09-22 Based on the method for controlling network congestion of ICAP agreements, device and client

Publications (1)

Publication Number Publication Date
WO2017049925A1 true WO2017049925A1 (en) 2017-03-30

Family

ID=58364978

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/082528 WO2017049925A1 (en) 2015-09-22 2016-05-18 Network congestion control method and apparatus, and client

Country Status (2)

Country Link
CN (1) CN106549876A (en)
WO (1) WO2017049925A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535785A (en) * 2019-08-29 2019-12-03 郑州阿帕斯科技有限公司 A kind of control method, device and distributed system sending frequency
US20220303202A1 (en) * 2019-08-19 2022-09-22 Beijing Xiaomi Mobile Software Co., Ltd. Data processing method and apparatus, electronic device and computer-readable storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022268B (en) * 2018-01-09 2022-05-03 腾讯科技(深圳)有限公司 Data transmission control method, device and storage medium
CN112073325B (en) * 2019-06-10 2023-05-12 阿里巴巴集团控股有限公司 Data congestion control and bandwidth estimation method
CN111464358B (en) * 2020-04-02 2021-08-20 深圳创维-Rgb电子有限公司 Message reporting method and device
CN114339468B (en) * 2021-12-22 2023-05-30 珠海格力电器股份有限公司 Data transmission method and device of unit equipment, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5367523A (en) * 1993-08-26 1994-11-22 International Business Machines Corporation Adaptive rate-based congestion and flow control in packet communications networks
CN102726092A (en) * 2011-11-25 2012-10-10 华为技术有限公司 Method and apparatus for controlling network congestion
CN103152285A (en) * 2013-03-14 2013-06-12 华为技术有限公司 Local terminal network element, opposite terminal network element and sending window adjustment method
CN104883710A (en) * 2015-05-08 2015-09-02 北京邮电大学 Congestion control method for wireless sensor network in star configuration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5367523A (en) * 1993-08-26 1994-11-22 International Business Machines Corporation Adaptive rate-based congestion and flow control in packet communications networks
CN102726092A (en) * 2011-11-25 2012-10-10 华为技术有限公司 Method and apparatus for controlling network congestion
CN103152285A (en) * 2013-03-14 2013-06-12 华为技术有限公司 Local terminal network element, opposite terminal network element and sending window adjustment method
CN104883710A (en) * 2015-05-08 2015-09-02 北京邮电大学 Congestion control method for wireless sensor network in star configuration

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220303202A1 (en) * 2019-08-19 2022-09-22 Beijing Xiaomi Mobile Software Co., Ltd. Data processing method and apparatus, electronic device and computer-readable storage medium
US11949574B2 (en) * 2019-08-19 2024-04-02 Beijing Xiaomi Mobile Software Co., Ltd. Data processing method and apparatus, electronic device and computer-readable storage medium
CN110535785A (en) * 2019-08-29 2019-12-03 郑州阿帕斯科技有限公司 A kind of control method, device and distributed system sending frequency

Also Published As

Publication number Publication date
CN106549876A (en) 2017-03-29

Similar Documents

Publication Publication Date Title
WO2017049925A1 (en) Network congestion control method and apparatus, and client
US10805322B2 (en) Packet capture and network traffic replay
US11582163B2 (en) System for early system resource constraint detection and recovery
US9596281B2 (en) Transport accelerator implementing request manager and connection manager functionality
WO2016192478A1 (en) Data transmission method and apparatus
US9014264B1 (en) Dynamic media transmission rate control using congestion window size
EP2930899B1 (en) Tcp link configuration method and apparatus
US9930097B2 (en) Transport accelerator systems and methods
US9172765B2 (en) Polling-based secure network message notification system and method with performance enhancing features
US8369324B1 (en) Variable compression queue
US20160080529A1 (en) Method and device for sending requests
US8886615B2 (en) Web service performance optimization by adaptively using compression
WO2013017001A1 (en) Method, device and system for realizing application performance self-adaption
US11386441B2 (en) Enhancing employee engagement using intelligent workspaces
EP3286967A1 (en) Technique for scheduling transmission of content in an access network
US11444882B2 (en) Methods for dynamically controlling transmission control protocol push functionality and devices thereof
US9544249B2 (en) Apparatus and method for aligning order of received packets
CN109327398B (en) Method and device for preventing packet loss
US10601444B2 (en) Information processing apparatus, information processing method, and recording medium storing program
Miyazawa et al. Performance evaluation of tcp bbr and cubic tcp in smart devices downloading on wi-fi
US8495238B1 (en) Facilitating self-tuning traffic shaping without a central traffic manager
CN115277581B (en) Control method and device for network transmission, computer equipment and storage medium
WO2023119511A1 (en) Communication device, communication system, and communication method
WO2023105671A1 (en) Computer and program
JP7424494B2 (en) Request delivery device, request delivery method, and request delivery program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16847807

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16847807

Country of ref document: EP

Kind code of ref document: A1