17 EP3499820B1 18 [0085]The memory 120 is configured to store a soft- [0089]The power supply 170 is configured to supply ware program and a module.The memory 120 mainly power to the components such as a battery of the mobile includes a program storage area and a data storage area. phone.Optionally,the power supply may be logically con- The program storage area may store an operating sys nected to the processor 160 by using a power manage- tem,an application program required by at least one func- 5 ment system,to implement functions such as charging tion(for example,a sound playing function and an image management,discharging management,and power con- playing function),and the like.The data storage area may sumption management by using the power management store data(for example,audio data and an address book) system. and the like created based on use of the mobile phone [0090]Both the first device and the second device that In addition,the memory 120 may include a high-speed 10 are provided in this embodiment of the present invention random access memory,and may further include a non- are temminal devices,in other words,the second device volatile memory,for example,at least one magnetic disk provided in this embodiment of the present invention may storage component,a flash memory component,or an- also be a mobile phone.Therefore,for a schematic hard other nonvolatile solid-state storage component. ware diagram of the second device provided in this em- [0086]The input unit 130 is configured to:receive en- 15 bodiment of the present invention,refer to the schematic tered digit or character information,and generate key hardware diagram of the mobile phone shown in FIG.2. signal input related to user settings and function control Details are not described herein again. of the mobile phone.Specifically,the input unit 130 may [0091]In this embodiment of the present invention,an include a touch panel 131 and another input device 132 example in which the routing device is a router is used The touch panel 131 is also referred to as a touch-control 20 to illustrate a hardware structure of the routing device. panel,and may collect a touch operation performed by FIG.3 is a schematic hardware diagram of a router ac- a user on or near the touch panel 131 (for example,an cording to an embodiment of the present invention.As operation performed by the user on the touch panel 131 shown in FIG.3,the router provided in this embodiment or near the touch panel 131 by using any proper object of the present invention includes components such as a or accessory such as a finger or a stylus),and drive a 25 processor 210,a memory 220,and an interface 230.The corresponding connection apparatus based on a preset components of the router are illustrated below. program.The input unit 130 may further include the an- [0092]The processor 210 is configured to be respon- other input device 132 in addition to the touch panel 131 sible for exchanging routing information,searching a Specifically,the another input device 132 may include routing table,and forwarding a data packet,for example. but is not limited to one or more of a physical keyboard, processing and maintaining various tables required by a function key(such as a volume control key or a power the router and routing computing. on/off key),a trackball,a mouse,a joystick,or the like. [0093]The memory 220 is configured to store a con- [0087]The display unit 140 is configured to display in- figuration,an operating system,routing protocol soft- formation entered by the user or information provided for ware,and the like of the router.The router may have a the user,and various menus of the mobile phone.The 35 plurality of memories,for example,a read-only memory display unit 140 may include a display panel 141.Op- (Read-Only Memory,ROM),a random access memory tionally,the display panel 141 may be configured in a (Random Access Memory,RAM),a dynamic random ac- form of a liquid crystal display (Liquid Crystal Display, cess memory(DRAM),and a flash(Flash).The interface LCD),an organic light-emitting diode (Organic Light- 230 is used by the router to send and receive data pack- Emitting Diode,OLED),or the like 40 ets.The interface 230 in the router includes a local area [0088]The audio circuit 150 is configured to convert network interface and a wide area network interface.In received audio data into an electrical signal,and transmit addition,the routerhas no input device or terminal display the electrical signal to a speaker 151;and the speaker device.The interface in the router further includes a con- 151 converts the electrical signal into a sound signal,and trol port that is used by a user or an administrator to com- outputs the sound signal to a microphone 152.In addition. 45 municate with the router by using a terminal,to implement the microphone 152 converts a collected sound signal router configuration into an electrical signal;and the audio circuit 150 converts [0094]To more clearly understand the technical solu- the electrical signal into audio data after receiving the tions in the embodiments of the present invention.the electrical signal,and then outputs the audio data to the congestion control method provided in the embodiments RF circuit 110 to send the audio data to,for example, 50 of the present invention is illustrated below. another mobile phone,or outputs the audio data to the [0095]With reference to FIG.1,as shown in FIG.4. memory 120 for further processing.The processor 160 an embodiment of the present invention provides a con- is configured to implement various functions of the mobile gestion control method.The method may include the fol- phone 100 and data processing by running or executing lowing steps. the software program and/or the module that are/is stored 55 [0096]S 101.A first device sends a first data packet in the memory 120 and by invoking the data stored in the to a routing device. memory 120,to perform overall monitoring on the mobile [0097]In this embodiment of the present invention, phone. when data transmission is performed between the first 11
EP 3 499 820 B1 11 5 10 15 20 25 30 35 40 45 50 55 [0085] The memory 120 is configured to store a software program and a module. The memory 120 mainly includes a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (for example, a sound playing function and an image playing function), and the like. The data storage area may store data (for example, audio data and an address book) and the like created based on use of the mobile phone. In addition, the memory 120 may include a high-speed random access memory, and may further include a nonvolatile memory, for example, at least one magnetic disk storage component, a flash memory component, or another nonvolatile solid-state storage component. [0086] The input unit 130 is configured to: receive entered digit or character information, and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 130 may include a touch panel 131 and another input device 132. The touch panel 131 is also referred to as a touch-control panel, and may collect a touch operation performed by a user on or near the touch panel 131 (for example, an operation performed by the user on the touch panel 131 or near the touch panel 131 by using any proper object or accessory such as a finger or a stylus), and drive a corresponding connection apparatus based on a preset program. The input unit 130 may further include the another input device 132 in addition to the touch panel 131. Specifically, the another input device 132 may include but is not limited to one or more of a physical keyboard, a function key (such as a volume control key or a power on/off key), a trackball, a mouse, a joystick, or the like. [0087] The display unit 140 is configured to display information entered by the user or information provided for the user, and various menus of the mobile phone. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in a form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic LightEmitting Diode, OLED), or the like. [0088] The audio circuit 150 is configured to convert received audio data into an electrical signal, and transmit the electrical signal to a speaker 151; and the speaker 151 converts the electrical signal into a sound signal, and outputs the sound signal to a microphone 152. In addition, the microphone 152 converts a collected sound signal into an electrical signal; and the audio circuit 150 converts the electrical signal into audio data after receiving the electrical signal, and then outputs the audio data to the RF circuit 110 to send the audio data to, for example, another mobile phone, or outputs the audio data to the memory 120 for further processing. The processor 160 is configured to implement various functions of the mobile phone 100 and data processing by running or executing the software program and/or the module that are/is stored in the memory 120 and by invoking the data stored in the memory 120, to perform overall monitoring on the mobile phone. [0089] The power supply 170 is configured to supply power to the components such as a battery of the mobile phone. Optionally, the power supply may be logically connected to the processor 160 by using a power management system, to implement functions such as charging management, discharging management, and power consumption management by using the power management system. [0090] Both the first device and the second device that are provided in this embodiment of the present invention are terminal devices, in other words, the second device provided in this embodiment of the present invention may also be a mobile phone. Therefore, for a schematic hardware diagram of the second device provided in this embodiment of the present invention, refer to the schematic hardware diagram of the mobile phone shown in FIG. 2. Details are not described herein again. [0091] In this embodiment of the present invention, an example in which the routing device is a router is used to illustrate a hardware structure of the routing device. FIG. 3 is a schematic hardware diagram of a router according to an embodiment of the present invention. As shown in FIG. 3, the router provided in this embodiment of the present invention includes components such as a processor 210, a memory 220, and an interface 230. The components of the router are illustrated below. [0092] The processor 210 is configured to be responsible for exchanging routing information, searching a routing table, and forwarding a data packet, for example, processing and maintaining various tables required by the router and routing computing. [0093] The memory 220 is configured to store a configuration, an operating system, routing protocol software, and the like of the router. The router may have a plurality of memories, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a dynamic random access memory (DRAM), and a flash (Flash). The interface 230 is used by the router to send and receive data packets. The interface 230 in the router includes a local area network interface and a wide area network interface. In addition, the router has no input device or terminal display device. The interface in the router further includes a control port that is used by a user or an administrator to communicate with the router by using a terminal, to implement router configuration. [0094] To more clearly understand the technical solutions in the embodiments of the present invention, the congestion control method provided in the embodiments of the present invention is illustrated below. [0095] With reference to FIG. 1, as shown in FIG. 4, an embodiment of the present invention provides a congestion control method. The method may include the following steps. [0096] S 101. A first device sends a first data packet to a routing device. [0097] In this embodiment of the present invention, when data transmission is performed between the first 17 18
19 EP3499820B1 20 device and a second device by using the MPTCP,the [0104]Optionally,a method for calculating the average first device may successively send a plurality of to-be- queue length of the data packet queue by the routing transmitted data packets (the plurality of data packets device may be: constitute data from the first device to the second device) to the second device by using the routing device.The plurality of data packets from the first device to the second 2ang=(1-w))×2ag+wxQ device include the first data packet.The routing device can select an optimal transmission path based on actual [105]In the foregoing formula.Qavg is an average statuses of channels in a data transmission process,and queue length that is of a data packet queue and that is send,in a data packet receiving order,data packets re- 10 currently calculated by the routing device when the rout- ceived by the routing device.Therefore,the routing de- ing device receives the first data packet from the first vice can be used as a forwarding device for data trans- device.Qav is an average queue length that is of a data mission between the first device and the second device, packet queue and that is calculated by the routing device to implement data transmission between the first device when the routing device receives a previous data packet, and the second device 15 wis a weight of the data packet queue,and Q is a length [0098]It should be noted that,in this embodiment of of a current data packet queue (namely,an actual length the present invention,when the first device sends data of the current data packet queue). packets to the routing device,the first device consecu- [0106]Optionally,a method for calculating the first pre- tively sends the data packets to the routing device in an set threshold may be: order of the to-be-sent data packets (for example,the 20 order may be an order of generating these data packets by the first device). [0099]S 102.The routing device receives the first data K2C*RTT packet. [0100]S103.The routing device determines that an 25 [0107]In the foregoing formula,K1 is the first preset average queue length of a data packet queue is greater threshold,C is a capacity of a link between the first device than or equal to a first preset threshold and is less than and the second device (namely,a maximum value of a or equal to a second preset threshold. data stream that can be transmitted on the link),and RTT [0101]S104.The routing device makes a congestion is a round trip delay of a sub stream transmitted on the mark for the first data packet,and adds the first data 30 link(namely,any one of a plurality of sub streams trans- packet to the data packet queue. mitted on the link). [0102]In this embodiment of the present invention,af- [0108]Optionally,in this embodiment of the present ter the routing device receives the first data packet from invention,the RTT may be an average round trip delay the first device,the routing device first calculates the av- of the plurality of sub streams transmitted on the link be- erage queue length of the data packet queue.When the 35 tween the first device and the second device,and may average queue length of the data packet queue is less be specifically determined based on an actual require- than the first preset threshold,it indicates that the current ment.This is not limited in this embodiment of the present data packet queue of the routing device is not congested. invention. In this case,the routing device adds the first data packet [0109]Optionally,a method for calculating the second to the data packet queue,waiting for the routing device 40 preset threshold may be: to forward the first data packet.When the average queue length of the data packet queue is greater than or equal to the first preset threshold and is less than or equal to K2≥2*K the second preset threshold,it indicates that the current data packet queue of the routing device may be congest- 45[01101 In the foregoing formula,K2 is the second pre- ed.In this case,the routing device makes the congestion set threshold. mark for the first data packet,and then adds the first data [0111]In this embodiment of the present invention,the packet to the data packet queue,waiting for the routing capacity of the link and the round trip delay of the sub device to forward the first data packet.When the average stream transmitted on the link can reflect a length of a queue length of the data packet queue is greater than 50 data packet queue of the routing device.Therefore,when the second preset threshold,it indicates that the current the first preset threshold is calculated with reference to data packet queue of the routing device has been con- the capacity of the link and the round trip delay of the sub gested.In this case.the routing device discards the first stream transmitted on the link,the routing device can data packet. more accurately determine whether the first data packet [0103]It should be noted that,each time the routing 55 encounters congestion. device receives a data packet from the first device,the [0112]In this embodiment of the present invention,af- routing device calculates an average queue length of a ter the routing device determines that the average queue data packet queue once. 12
EP 3 499 820 B1 12 5 10 15 20 25 30 35 40 45 50 55 device and a second device by using the MPTCP, the first device may successively send a plurality of to-betransmitted data packets (the plurality of data packets constitute data from the first device to the second device) to the second device by using the routing device. The plurality of data packets from the first device to the second device include the first data packet. The routing device can select an optimal transmission path based on actual statuses of channels in a data transmission process, and send, in a data packet receiving order, data packets received by the routing device. Therefore, the routing device can be used as a forwarding device for data transmission between the first device and the second device, to implement data transmission between the first device and the second device. [0098] It should be noted that, in this embodiment of the present invention, when the first device sends data packets to the routing device, the first device consecutively sends the data packets to the routing device in an order of the to-be-sent data packets (for example, the order may be an order of generating these data packets by the first device). [0099] S 102. The routing device receives the first data packet. [0100] S103. The routing device determines that an average queue length of a data packet queue is greater than or equal to a first preset threshold and is less than or equal to a second preset threshold. [0101] S104. The routing device makes a congestion mark for the first data packet, and adds the first data packet to the data packet queue. [0102] In this embodiment of the present invention, after the routing device receives the first data packet from the first device, the routing device first calculates the average queue length of the data packet queue. When the average queue length of the data packet queue is less than the first preset threshold, it indicates that the current data packet queue of the routing device is not congested. In this case, the routing device adds the first data packet to the data packet queue, waiting for the routing device to forward the first data packet. When the average queue length of the data packet queue is greater than or equal to the first preset threshold and is less than or equal to the second preset threshold, it indicates that the current data packet queue of the routing device may be congested. In this case, the routing device makes the congestion mark for the first data packet, and then adds the first data packet to the data packet queue, waiting for the routing device to forward the first data packet. When the average queue length of the data packet queue is greater than the second preset threshold, it indicates that the current data packet queue of the routing device has been congested. In this case, the routing device discards the first data packet. [0103] It should be noted that, each time the routing device receives a data packet from the first device, the routing device calculates an average queue length of a data packet queue once. [0104] Optionally, a method for calculating the average queue length of the data packet queue by the routing device may be: [0105] In the foregoing formula, Qavg’ is an average queue length that is of a data packet queue and that is currently calculated by the routing device when the routing device receives the first data packet from the first device, Qavg is an average queue length that is of a data packet queue and that is calculated by the routing device when the routing device receives a previous data packet, w is a weight of the data packet queue, and Q is a length of a current data packet queue (namely, an actual length of the current data packet queue). [0106] Optionally, a method for calculating the first preset threshold may be: [0107] In the foregoing formula, K1 is the first preset threshold, C is a capacity of a link between the first device and the second device (namely, a maximum value of a data stream that can be transmitted on the link), and RTT is a round trip delay of a sub stream transmitted on the link (namely, any one of a plurality of sub streams transmitted on the link). [0108] Optionally, in this embodiment of the present invention, the RTT may be an average round trip delay of the plurality of sub streams transmitted on the link between the first device and the second device, and may be specifically determined based on an actual requirement. This is not limited in this embodiment of the present invention. [0109] Optionally, a method for calculating the second preset threshold may be: [0110] In the foregoing formula, K2 is the second preset threshold. [0111] In this embodiment of the present invention, the capacity of the link and the round trip delay of the sub stream transmitted on the link can reflect a length of a data packet queue of the routing device. Therefore, when the first preset threshold is calculated with reference to the capacity of the link and the round trip delay of the sub stream transmitted on the link, the routing device can more accurately determine whether the first data packet encounters congestion. [0112] In this embodiment of the present invention, after the routing device determines that the average queue 19 20