Flow control method, gateway and switch

By identifying control object information in the gateway cluster and forwarding it to the corresponding gateway for traffic control, the problem of low traffic control efficiency in the prior art is solved, real-time and efficient traffic management is achieved.

CN114726796BActive Publication Date: 2024-12-06ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210346229.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-12-06
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

In the prior art, third-party equipment is used to count the sum of traffic scattered in multiple gateways for traffic control, which is inefficient and time-consuming, affecting the efficiency of message forwarding.

Method used

The first switch receives the packet allocated by the load balancing method, recognizes the control object information, and determines the gateway configuration parameters from the preconfigured information, forwards the packet to the corresponding second gateway, realizes traffic control and avoids the intervention of third-party equipment. .

Benefits of technology

Improve traffic control efficiency, real-time control is realized, detection costs are saved, and traffic of the same control object is forwarded and counted by a gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114726796B_ABST
    Figure CN114726796B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a flow control method, a gateway and a switch. After the first switch distributes the received message to the first gateway in a load balancing manner, the first gateway identifies the control object information from the message, and determines the gateway configuration parameters corresponding to the control object information from the pre-configuration information, and then returns the message and the gateway configuration parameters to the first switch; the first switch determines the second gateway according to the gateway configuration parameters, and then distributes the message to the second gateway, and the second gateway forwards the message and counts the message flow of the control object to perform flow control. The technical solution provided by the embodiment of the present application improves the efficiency of flow control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular to a flow control method, a gateway, and a switch. Background Art

[0002] In scenarios where a gateway cluster is used for message forwarding, the flow of messages forwarded by the gateway cluster is usually controlled based on the control object targeted by the message. For example, in cloud network scenarios, flow control is usually performed on message flows from the same control object, such as from the same tenant or from the same service, to avoid exceeding the bandwidth limit of the tenant or service.

[0003] In the case of cluster deployment, the message will be forwarded to the gateway through the switch in a load balancing manner. Therefore, the message traffic from the same control object may be dispersed to multiple gateways. In the existing technology, a third-party device is usually used to count the sum of the traffic dispersed in multiple gateways, and then the traffic is controlled based on the total traffic. However, this method is time-consuming. Summary of the invention

[0004] The embodiments of the present application provide a flow control method, a gateway and a switch to solve the technical problem of low flow control efficiency in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a traffic control method, which is applied to a first gateway, and the method includes:

[0006] receiving a message sent by the first switch, where the message is allocated by the first switch in a load balancing manner;

[0007] Identifying control object information in the message;

[0008] Determine the gateway configuration parameters corresponding to the control object information from the pre-configuration information;

[0009] The message and the gateway configuration parameters are returned to the first switch; the gateway configuration parameters are used to determine the second gateway that uniquely corresponds to the control object identified by the control object information, so as to forward the message to the second gateway; the second gateway is used to forward the message and perform flow control on the message flow corresponding to the control object.

[0010] In a second aspect, an embodiment of the present application provides a flow control method, which is applied to a first switch, and the method includes:

[0011] Receive messages;

[0012] Allocate the message to a first gateway in a gateway cluster in a load balancing manner; the first gateway is used to identify the control object information in the message and determine the gateway configuration parameters corresponding to the control object information based on pre-configuration information;

[0013] receiving the message and the gateway configuration parameters returned by the first gateway;

[0014] According to the gateway configuration parameters, the message is forwarded to the corresponding second gateway; the second gateway is used to perform flow control on the message flow corresponding to the received control object information.

[0015] In a third aspect, an embodiment of the present application provides a flow control method, which is applied to a second gateway, and the method includes:

[0016] receiving a message sent by a first switch; the message is sent by the first switch according to a second gateway corresponding to a gateway configuration parameter; the gateway configuration parameter is determined by the first gateway receiving the message in a load balancing manner according to control object information in the message;

[0017] Identifying the control object information in the message;

[0018] Counting the message flow corresponding to the received control object information;

[0019] The flow rate of the control object identified by the control object information is controlled according to the message flow rate.

[0020] In a fourth aspect, an embodiment of the present application provides a flow control device, which is applied to a first gateway, and the device includes:

[0021] A receiving module, configured to receive a message sent by the first switch, wherein the message is allocated by the first switch in a load balancing manner;

[0022] An identification module, used to identify a control object targeted by the message;

[0023] A determination module, used to determine the gateway configuration parameters corresponding to the control object information from the pre-configuration information;

[0024] A return module is used to return the message and the gateway configuration parameters to the first switch; the gateway configuration parameters are used to determine the second gateway that uniquely corresponds to the control object identified by the control object information, so as to forward the message to the second gateway; the second gateway is used to forward the message and perform flow control on the message flow corresponding to the control object.

[0025] In a fifth aspect, an embodiment of the present application provides a flow control device, which is applied to a first switch, and the device includes:

[0026] A receiving module, configured to receive a message; receive the message and the gateway configuration parameters returned by the first gateway;

[0027] A sending module, configured to distribute the message to a first gateway in a gateway cluster in a load balancing manner; the first gateway is configured to identify the control object information in the message and determine a gateway configuration parameter corresponding to the control object information based on pre-configuration information;

[0028] A forwarding module is used to forward the message to the corresponding second gateway according to the gateway configuration parameters; the second gateway is used to perform flow control on the message flow corresponding to the received control object information.

[0029] In a sixth aspect, an embodiment of the present application provides a flow control device, which is applied to a second gateway, and the device includes:

[0030] A receiving module, configured to receive a message sent by a first switch; the message is sent by the first switch according to a second gateway corresponding to a gateway configuration parameter; the gateway configuration parameter is determined by the first gateway receiving the message in a load balancing manner according to control object information in the message;

[0031] An identification module, used to identify the control object to which the message belongs;

[0032] A statistics module, used to count the message flow corresponding to the received control object information;

[0033] A control module is used to perform flow control on the control object identified by the control object information according to the message flow.

[0034] In the seventh aspect, an embodiment of the present application provides a gateway, including a storage component, a display component and a processing component; the storage component stores one or more computer program instructions; the one or more computer program instructions are used by the processing component to call and execute the traffic control method described in the first aspect and / or the third aspect.

[0035] In an eighth aspect, an embodiment of the present application provides a switch, comprising a storage component, a display component and a processing component; the storage component stores one or more computer program instructions; the one or more computer program instructions are used by the processing component to call and execute the flow control method described in the second aspect above.

[0036] In the ninth aspect, a computer storage medium is provided in an embodiment of the present application, storing a computer program, which, when executed by a computer, implements the flow control method as described in the first aspect, the flow control method as described in the second aspect, or the flow control method as described in the third aspect.

[0037] The embodiment of the present application provides a flow control method, a gateway and a switch. After the first switch receives a message and distributes it to the first gateway in a load balancing manner, the first gateway identifies the control object information from the message, and determines the gateway configuration parameters corresponding to the control object information from the pre-configuration information, and then returns the message and the gateway configuration parameters to the first switch; the first switch can determine the second gateway that uniquely corresponds to the control object according to the gateway configuration parameters, and then distribute the message to the second gateway, which forwards the message and counts the message traffic of the control object to perform flow control. The technical solution provided by the embodiment of the present application can forward the traffic forwarded by the same control object through the gateway cluster through one gateway, so that when performing flow control, the gateway can perform flow statistics and flow control without the need to borrow third-party equipment, effectively improving the efficiency of flow control, realizing real-time control, and saving detection costs.

[0038] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 A schematic diagram of a system architecture in which the technical solution of an embodiment of the present application is applied is shown;

[0041] Figure 2 A flow chart of an embodiment of a flow control method provided by the present application is shown;

[0042] Figure 3 A flow chart of another embodiment of a flow control method provided by the present application is shown;

[0043] Figure 4 A flow chart showing another embodiment of a flow control method provided by the present application is shown;

[0044] Figure 5 A schematic diagram of an embodiment of a flow control scenario provided by the present application is shown;

[0045] Figure 6 A schematic structural diagram of an embodiment of a flow control device provided by the present application is shown;

[0046] Figure 7 A schematic structural diagram of another embodiment of a flow control device provided by the present application is shown;

[0047] Figure 8 A schematic structural diagram of another embodiment of a flow control device provided by the present application is shown;

[0048] Fig. 9 A schematic diagram showing the structure of an embodiment of a gateway provided by the present application is shown;

[0049] Fig.10 A schematic diagram of the structure of an embodiment of a switch provided by the present application is shown. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0051] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0052] The technical solution of the embodiment of the present application is applied to the scenario of using a gateway cluster for traffic forwarding, for example, in a cloud network scenario, the gateway usually adopts a cluster deployment form for traffic forwarding. At present, cloud service providers provide computing resources (such as networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services, etc.), and tenants can also build services using rented computing resources. Among them, "service" in this article can represent an application, multiple applications, or a subset of a single application. In general, "service" and "application" can be used interchangeably, and a service consists of one or more functions, and each function of a service can be separately addressed, for example, via a separate endpoint of an application program interface; a tenant refers to a user who uses computing resources, and a corresponding tenant identifier such as an account can be created in the system that provides computing resources to distinguish different tenants. In the cloud network scenario, there is a tenant using a service to access the public network, or a tenant's data center computer room accesses a service. At this time, the gateway is required to forward traffic between different networks. In addition, tenants can also purchase bandwidth resources, and the gateway cluster can perform traffic control such as speed limit processing for tenants or for a certain service of the tenant under the constraint of bandwidth resources.

[0053] Taking service access to the public network as an example, since tenants can configure multiple elastic network addresses on the built services, they can use multiple network addresses to send messages to the public network. In the case of cluster deployment, the messages will be forwarded to the gateway through the switch in a load balancing manner, resulting in the message traffic from the same service being dispersed to multiple gateways. In the traditional method, third-party equipment is usually used to count the sum of the traffic dispersed in multiple gateways, and then the traffic is controlled based on the total traffic. However, this method is time-consuming and affects the efficiency of message forwarding.

[0054] Based on this, an embodiment of the present application provides a flow control method, after the first switch distributes the received message to the first gateway in a load balancing manner, the first gateway identifies the control object from the message, and determines the gateway configuration parameters corresponding to the control object from the pre-configuration information, and then returns the message and the gateway configuration parameters to the first switch; the first switch can determine the second gateway that uniquely corresponds to the control object according to the gateway configuration parameters, and then distribute the message to the second gateway, which forwards the message and counts the message flow of the control object to perform flow control. The technical solution provided by the embodiment of the present application can forward the traffic forwarded by the same control object through the gateway cluster through one gateway, so that when performing flow control, the gateway can perform flow statistics and flow control without the need to borrow third-party equipment, effectively improving the efficiency of flow control, achieving real-time control, and saving detection costs.

[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0056] Figure 1 The technical solution of the embodiment of the present application can be applied to a system architecture diagram, in which the system architecture may include at least one switch 101 connected to the source end, a gateway cluster consisting of multiple gateways 102, and at least one switch 103 connected to the destination end, wherein, optionally, in order to improve reliability, multiple switches 101 and multiple switches 103 may be included.

[0057] In actual applications, such as in a cloud network scenario, the source end can be, for example, a tenant's data center computer room, such as an Internet Data Center (IDC), and the destination end is a service, or vice versa, the source end is a service and the destination end is an IDC; or the source end can be a service built by the tenant and the destination end is a public network, or vice versa, the source end is a public network and the destination end is a service, etc. Of course, the present application is not limited to this, and any two different network parties that need to forward traffic through a network cluster are applicable to the technical solution of the present application.

[0058] The message sent by the source end first arrives at the switch 101, and is distributed to the gateway 102 by the switch 101 in a load balancing manner. For example, based on the message quintuple information, the message with the same quintuple can be distributed as the same traffic to the same gateway 102, etc. When the gateway 102 forwards the message, it is first sent to the switch 103, and then forwarded to the destination by the switch 103.

[0059] Among them, the switch and the gateway can use the Border Gateway Protocol (BGP) to exchange routing information and determine the path, etc. Of course, the present application is not limited to this.

[0060] Corresponds to Figure 1 The system architecture diagram described above will be used to explain in detail the implementation details of the technical solution of the embodiment of the present application.

[0061] Figure 2 A flow chart of an embodiment of a flow control method provided by the present application is shown. The technical solution of this embodiment is executed by the first gateway, and the method may include:

[0062] S201: Receive a message sent by a first switch.

[0063] The message is distributed by the first switch in a load balancing manner. The first switch is any switch connected to the gateway cluster.

[0064] In an optional embodiment, the first switch may perform load balancing based on the quintuple of the message, for example, by performing a hash operation on the quintuple to obtain a corresponding index, thereby determining the first gateway in the correspondence between the pre-configured index and the gateway, so that messages with the same quintuple may be sent to the same gateway, wherein the quintuple refers to the source address, source port, destination address, destination port and transport layer protocol of the message; of course, the first switch may also distribute messages according to other load balancing methods, which is not specifically limited in the present application.

[0065] S202: Identify the control object information in the message.

[0066] The control object information is used to identify the control object, for example, it can be the object identifier of the control object. The control object can refer to the user corresponding to the message or the service used by the user. In the cloud network scenario, the control object can refer to the tenant who rents the computing resources or the service provided to the tenant. The service can be built based on the computing resources rented by the tenant, so that traffic control can be implemented at the granularity of the tenant or the granularity of the service used by the tenant. When the control object is a tenant, the object identifier can be, for example, the tenant identifier; when the control object is a service used by the tenant, the object identifier can be, for example, the tenant identifier and the service identifier.

[0067] Of course, the control object can also be determined in combination with the type of bandwidth resources purchased by the tenant. For example, a tenant can purchase a comprehensive bandwidth resource for all the services it has built. In this case, the control object can be the tenant. If the tenant purchases corresponding bandwidth resources for each service it has built, then the control object can be any service of the tenant.

[0068] Optionally, the message includes control object information. The gateway can parse the message to obtain the control object information, and then identify the control object for flow control corresponding to the message.

[0069] S203: Determine the control object from the pre-configuration information information S204: Return the message and the gateway configuration parameters to the first switch.

[0070] Optionally, one control object corresponds to only one gateway configuration parameter; one gateway configuration parameter may correspond to one or more control objects.

[0071] The gateway configuration parameters are used by the first switch to determine the second gateway that uniquely corresponds to the control object, so that the message corresponding to the control object is forwarded only to the second gateway, so that all messages of the same control object are forwarded to the same second gateway; the second gateway is used to forward the message and can perform flow control on the message flow corresponding to the control object, wherein the gateway configuration parameters can uniquely identify the second gateway.

[0072] The second gateway may receive messages corresponding to one or more control objects, and distinguish different control objects by identifying the control object information in the messages and then perform flow control respectively.

[0073] In order to facilitate the search for a gateway for traffic forwarding, as an optional method, different network segments can be pre-configured for different gateways in the gateway cluster. The first gateway can be configured with a correspondence between the control object information and the network segment. Therefore, the pre-configuration information can include network segments corresponding to different control object information; then, determining the gateway configuration parameters corresponding to the control object information from the pre-configuration information can be implemented as follows: determining the target network segment corresponding to the control object information from the pre-configuration information, and selecting the target URL from the target network segment. The gateway configuration parameter can be a target URL.

[0074] Of course, the pre-configuration information may include network segments corresponding to different control object information, and the gateway configuration parameter may also be the target network segment corresponding to the target object. Each control object information only corresponds to one network segment, and one network segment may correspond to one or more control object information.

[0075] Taking the control object as a tenant as an example, the first gateway can be configured with a correspondence between a tenant identifier and multiple network segments, each tenant identifier uniquely corresponds to a network segment, and a network segment can correspond to one or more tenant identifiers, so that after the tenant identifier is identified, the target network segment corresponding to the tenant identifier can be determined in the pre-configuration information. Among them, pre-configuring different network segments for different gateways in the gateway cluster can include: selecting a preset network segment; dividing the preset network segment into multiple network segments according to the number of gateways in the gateway cluster, and allocating the multiple network segments one by one to multiple gateways in the gateway cluster, so that each gateway is bound to a network segment. Among them, the preset network segment can be a randomly selected network segment. Of course, multiple different network segments can also be randomly selected and allocated to multiple gateways in the gateway cluster.

[0076] Among them, each gateway can send the network segment information of its bound network segment to the first switch. After the first switch receives the message and target URL returned by the first gateway, it can determine the target network segment where the target URL is located. Then, according to the network segments bound to different gateways, the second gateway corresponding to the target network segment can be determined.

[0077] In addition, after determining the target network segment corresponding to the control object from the pre-configuration information, it is also possible to determine whether the target network segment is a network segment configured by the first gateway. In the case where the target network segment is a network segment configured by the first gateway, it indicates that all messages corresponding to the control object are actually forwarded by the first gateway, so the first gateway forwards the message and counts the message flow corresponding to the control object received without returning to the first switch; thus, the first gateway can perform flow control on the control object according to the message flow.

[0078] In the case that the target network segment is not the network segment configured for the first gateway, an operation of selecting a target URL from the target network segment may be performed.

[0079] Among them, the flow control of the control object according to the message flow can be realized as follows: based on the target bandwidth corresponding to the control object, the message flow is speed-limited. Of course, the flow control of the control object can be not limited to speed-limiting processing, for example, it can also simply count the message flow corresponding to the control object and report it to the control end in real time.

[0080] Optionally, speed limiting processing of the control object according to the target bandwidth corresponding to the control object can be implemented as follows: determining whether the message traffic exceeds the target bandwidth; if so, discarding the excess traffic that exceeds the target bandwidth; or determining the cost information of the excess traffic according to a predetermined billing method, or sending traffic alarm information for the control object to the control system, etc. Of course, the present application is not limited to this.

[0081] As another optional method, when different network segments are pre-configured for different gateways in a gateway cluster, the pre-configuration information specifically includes different network segments pre-configured for different gateways in the gateway cluster; then, determining the gateway configuration parameters corresponding to the control object information from the pre-configuration information can also be implemented as: according to the object identifier in the message, determining the matching target URL from the address set consisting of different network segments corresponding to the gateway cluster.

[0082] The control object information is the object identifier of the control object, that is, the target URL matching the object identifier can be found from the address set. Among them, the URL matching the object identifier can be pre-generated and saved accordingly, so the pre-configuration information can include the correspondence between different object identifiers and URLs, so that based on the object identifier, the correspondence can be found to determine the target URL corresponding to the object identifier; in addition, the target URL belonging to the address set can also be calculated based on the object identifier according to the same address conversion algorithm. The gateway configuration parameter can also be the target URL.

[0083] Since the object identifiers in all messages corresponding to the control object are the same, the target website determined according to the object identifier of the control object will also be unique in the same network segment, so that all messages corresponding to the control object can be forwarded to the second gateway.

[0084] In addition, after determining the matching target website, it is also possible to determine whether the target website is located in the network segment configured by the first gateway. In the case where the target website is located in the network segment configured by the first gateway, it indicates that all messages corresponding to the control object are actually forwarded by the first gateway, and the first gateway forwards the message, and counts the message flow corresponding to the control object received, and performs flow control on the control object according to the message flow; there is no need to return the message to the first switch.

[0085] In the case that the target website address is not located in the network segment configured by the first gateway, the target website address is returned to the first switch as a gateway configuration parameter.

[0086] As another optional method, the gateway may be configured with a correspondence between an object identifier and a gateway identifier, and the pre-configuration information may include gateway identifiers corresponding to different object identifiers; then, determining the gateway configuration parameters corresponding to the control object information from the pre-configuration information may also be implemented as follows: determining the gateway identifier corresponding to the object identifier from the pre-configuration information; the gateway configuration parameters may be the gateway identifier.

[0087] In addition, after determining the gateway identifier corresponding to the object identifier of the controlled object, if the gateway identifier is the gateway identifier of the first gateway, the first gateway can forward the message, count the message flow corresponding to the controlled object received, and perform flow control on the controlled object according to the message flow; without returning the message to the first switch.

[0088] When the gateway identifier corresponding to the object identifier of the control object is different from the gateway identifier of the first gateway, the gateway identifier is returned to the first switch as a gateway configuration parameter.

[0089] In summary, the gateway configuration parameter may be a target URL or a target network segment or a gateway identifier.

[0090] In order to facilitate transmission, in addition to returning the gateway configuration parameters and the message to the first switch at the same time, the gateway configuration parameters can also be added to the target field in the message, so that the message containing the gateway configuration parameters can be sent to the first switch.

[0091] The target field may be a field that can be parsed by the first switch, so that the first switch can parse the target field of the message to obtain the gateway configuration parameter, and then determine the corresponding second gateway.

[0092] In order not to affect message forwarding, since the destination address in the message is the gateway address, and the gateway addresses of multiple gateways in the gateway cluster are the same, the modification of the destination address will not affect the message forwarding process. Therefore, the target field can be the field where the destination address is located. Further optionally, adding the gateway configuration parameter to the target field in the message can include: using the gateway configuration parameter to modify the destination address corresponding to the destination address field in the message.

[0093] Optionally, when the gateway configuration parameter is the target website, returning the message and the gateway configuration parameter to the first switch can be implemented as follows: adding the target website to the target field in the message, returning the message containing the target website to the first switch; the target field is used by the first switch to parse and obtain the target website; the target network segment where the target website is located is used to determine the corresponding second gateway. Optionally, when the network segment where the target website is located is the same as the network segment configured by the first gateway, the target website is added to the target field in the message.

[0094] The target field may be a field where the destination address is located. Further optionally, adding the target website to the target field in the message includes: using the target website to modify the destination address corresponding to the destination address field in the message.

[0095] In the case where the gateway configuration parameter is a gateway identifier, returning the message and the gateway configuration parameter to the first switch can be implemented as follows: adding the gateway identifier to a target field in the message, and returning the message containing the gateway identifier to the first switch; the target field is used by the first switch to parse and obtain the gateway identifier to determine the corresponding second gateway. The target field may be a field where the destination address is located. Further optionally, adding the gateway identifier to the target field in the message includes: using the gateway identifier to modify the destination address corresponding to the destination address field in the message.

[0096] Optionally, in the case where the gateway configuration parameter is a target network segment, returning the message and the gateway configuration parameter to the first switch can be implemented as follows: adding the target network segment to the target field in the message, returning the message containing the target network segment to the first switch; the target field is used by the first switch to parse and obtain the target network segment; the target network segment is used to determine the corresponding second gateway. The target field can be a field where the destination address is located. Further optionally, adding the target URL to the target field in the message includes: using the target network segment to modify the destination address corresponding to the destination address field in the message.

[0097] In this embodiment, the traffic forwarded by the same control object through the gateway cluster is forwarded through one gateway, so that when performing flow control, the gateway can perform flow statistics and flow control without the intervention of third-party equipment, effectively improving the flow control efficiency, realizing real-time control, and saving detection costs.

[0098] In addition, in some embodiments, the link between the second gateway and the first switch may fail, so the above method further includes: determining whether the link between the second gateway and the first switch fails; if so, sending the message and the gateway configuration parameters to the second switch.

[0099] The first switch can sense whether the link between each gateway is faulty. Therefore, after the first switch receives the message returned by the first gateway and determines the corresponding second gateway, if it is determined that the link with the second gateway is faulty, a fault notification can be sent to the first gateway. The first gateway can determine that the link between the second gateway and the first switch is faulty based on the fault notification; then the message can be sent to the second switch for forwarding. The second switch can be any switch in the same switch cluster as the first switch.

[0100] In addition, it can be seen from the above description that when the gateway configuration parameter is the target URL, the first switch will determine the target network segment according to the target URL, and then determine the corresponding second gateway. However, due to the possibility of failure of the second gateway, the message returned by the first gateway to the first switch may not be forwarded to the second gateway. In order to improve the control reliability, in some embodiments, since the multiple gateways in the gateway cluster correspond to different network segments, different coefficients can be configured for different network segments for each gateway, wherein the coefficient corresponding to the network segment bound to each gateway can be set to a predetermined value. Therefore, the method can also include: the first gateway determines different coefficients configured for different network segments; wherein the coefficient corresponding to the network segment bound to the first gateway is a predetermined value; the coefficients corresponding to different network segments are sent to at least one switch; wherein the coefficients corresponding to different network segments set by any gateway are used to determine the network segment to which it is bound.

[0101] In addition, the coefficients corresponding to different network segments configured by each gateway correspond to different priorities, and the priority corresponding to the predetermined value is the highest; after the first gateway returns the message to the first switch, the first switch determines the corresponding second gateway according to the target network segment where the target website is located. If it is detected that the second gateway has a fault, it can also: send a fault notification to the first gateway, so that after the first gateway receives the fault notification, it can also determine a target coefficient with a priority lower than the predetermined value; find a third gateway that sets the target network segment as the target coefficient; and forward the message to the third gateway.

[0102] Take a cluster with three gateways as an example, wherein the bound network segment can be pre-configured for each gateway, and the pre-configured network segment can be divided based on the number of gateways in the gateway cluster. Since there are three gateways in the gateway cluster, three network segments will be configured, if they are IP-PREFIX1, IP-PREFIX2, and IP-PREFIX3, wherein the coefficients of each gateway configured with the three network segments are respectively, gateway 1: IP-PREFIX1 coefficient is 1, IP-PREFIX2 coefficient is 2, and IP-PREFIX3 coefficient is 3; gateway 2: IP-PREFIX1 coefficient is 3, IP-PREFIX2 coefficient is 1, and IP-PREFIX3 coefficient is 2; gateway 3: IP-PREFIX1 coefficient is 2, IP-PREFIX2 coefficient is 3, and IP-PREFIX3 coefficient is 1. Among them, the predetermined value can be 1, and the network segment information sent by the gateway to the switch can include the network segment and its corresponding coefficient. Therefore, after the first switch determines the target network segment, it can set the gateway with the coefficient of the target network segment set to the predetermined value 1 as the second gateway.

[0103] Assuming that the smaller the coefficient value, the higher its priority, for example, if the first switch determines that the network segment corresponding to the message is IP-PREFIX1, the message will be sent to gateway 1 with a coefficient of 1 set to IP-PREFIX1. In the case of a failure of gateway 1, the message can be sent to gateway 3 with a coefficient of 2 set to IP-PREFIX1, and so on. After each gateway is configured with a network segment and the corresponding coefficient, it will send the network segment and the corresponding coefficient to the corresponding switch.

[0104] Figure 3 A flow chart of an embodiment of the flow control method provided by the present application is shown. The technical solution of the embodiment is executed by a first switch, and the first switch is any switch in the switch cluster. The method may include:

[0105] S301. Receive a message.

[0106] S302: Send the message to the first gateway in the gateway cluster in a load balancing manner.

[0107] The first gateway is used to identify the control object information in the message and determine the gateway configuration parameters corresponding to the control object information based on the pre-configuration information.

[0108] S303: Receive a message and gateway configuration parameters returned by the first gateway.

[0109] As an optional method, different gateways in a gateway cluster are pre-bound to different network segments; the pre-configuration information may include network segments corresponding to different control object information, one control object information corresponds to only one network segment, and one network segment may correspond to one or more control object information; the gateway configuration parameter may be a target URL selected from the target network segment corresponding to the control object information, wherein the target URL may be added to a target field in the message; receiving the message returned by the first gateway and the gateway configuration parameter may be implemented as follows: receiving the message returned by the first gateway; parsing the target URL from the target field of the message; determining the target network segment where the target URL is located, and the second gateway corresponding to the target network segment; and forwarding the message to the second gateway.

[0110] As another optional method, different gateways in a gateway cluster are pre-bound to different network segments; the pre-configuration information may include different network segments pre-bound to different gateways in the gateway cluster; the gateway configuration parameter may be a target URL that matches the object identifier of the control object determined from an address set consisting of different network segments corresponding to the gateway cluster; the target URL is used to be added to the target field in the message; then receiving the message returned by the first gateway and the gateway configuration parameter can be implemented as follows: receiving the message returned by the first gateway; parsing the target URL from the target field of the message; determining the target network segment where the target URL is located, and the second gateway corresponding to the target network segment.

[0111] As another optional method, the pre-configuration information may include gateway identifiers corresponding to different object identifiers, where one object identifier corresponds to only one gateway identifier, and one gateway identifier may correspond to one or more object identifiers; the gateway configuration parameter may be a gateway identifier determined based on the object identifier of the control object, and the gateway identifier may also be added to a target field in the message; then receiving the message returned by the first gateway and the gateway configuration parameter may be implemented as follows: receiving the message returned by the first gateway; parsing the target field of the message to obtain the gateway identifier; and determining the second gateway corresponding to the gateway identifier.

[0112] The above process of receiving the message returned by the first gateway and the gateway configuration parameters is similar to Figure 2 The relevant process is the same as in , and will not be repeated here.

[0113] S304: forward the message to the corresponding second gateway according to the gateway configuration parameters.

[0114] The second gateway may be used to forward the message and perform flow control on the message flow corresponding to the control object information.

[0115] As described above, the first switch can determine the corresponding gateway according to the target network segment, so optionally, the above method may further include: receiving the network segment information corresponding to each gateway sent by each gateway in the gateway cluster.

[0116] Optionally, each gateway can be configured with different coefficients corresponding to different network segments, and the coefficient of the network segment to which it is bound is a predetermined value; receiving the network segment information of its bound network segment sent by each gateway in the gateway cluster can be implemented as follows: receiving the different coefficients set for different network segments sent by each gateway in the gateway cluster; determining the target network segment where the target URL is located, and the second gateway corresponding to the target network segment includes: determining the target network segment where the target URL is located; and finding the second gateway that sets the coefficient of the target network segment to a predetermined value.

[0117] Optionally, the coefficients corresponding to different network segments configured by each gateway correspond to different priorities, and the priority corresponding to the predetermined value is the highest; the above method also includes: determining whether the second gateway fails; if so, determining a target coefficient whose priority is lower than the priority corresponding to the predetermined value; finding a third gateway that sets the target network segment as the target coefficient; and forwarding the message to the third gateway. That is, when it is determined that the second gateway fails, the message can be sent to the third gateway whose priority of the target network segment is slightly lower than that of the second gateway.

[0118] In addition, when the gateway and the switch use the BGP protocol for routing, the ASPATH attribute can be configured for each network segment, and the coefficient value corresponding to each network segment can refer to the set AS PATH attribute value.

[0119] Figure 4 A flow chart of an embodiment of the flow control method provided by the present application is shown. The technical solution of this embodiment is executed by the second gateway, and the method may include:

[0120] S401: Receive a message sent by a first switch.

[0121] The message is sent by the first switch according to the second gateway corresponding to the gateway configuration parameter; the gateway configuration parameter is determined by the first gateway receiving the message in a load balancing manner according to the control object information in the message.

[0122] The gateway configuration parameter may be a gateway identifier corresponding to the second gateway or a target network segment corresponding to the second gateway or any URL of the target network segment corresponding to the second gateway.

[0123] The first gateway and the first switch process the message in detail. Figure 2 or Figure 3 As described in the illustrated embodiment, details will not be repeated here.

[0124] S402: Identify the control object information in the message.

[0125] The control objects include tenants who rent cloud computing resources or services provided to tenants.

[0126] S403: Count the message traffic corresponding to the received control object information.

[0127] It is understandable that, since the bandwidth is specified relative to the speed at which traffic passes through the gateway, it is necessary to count the message traffic corresponding to the control object in real time.

[0128] S404: Perform flow control on the control object identified by the control object information according to the message flow.

[0129] Optionally, performing flow control on the control object identified by the control object information according to the message flow may be implemented by: performing rate limiting processing on the message flow based on a target bandwidth. The target bandwidth may be a bandwidth corresponding to the control object information.

[0130] Of course, the flow control of the control object may not be limited to the speed limit processing. For example, the message flow corresponding to the control object may be simply counted and reported to the control end in real time.

[0131] Optionally, as an optional method, the speed limit processing of the control object according to the target bandwidth can be implemented as follows: determining whether the message flow exceeds the target bandwidth; if so, discarding the excess flow exceeding the target bandwidth;

[0132] As another optional method, speed limiting the control object according to the target bandwidth can be achieved by: determining whether the message traffic exceeds the target bandwidth; if so, determining the cost information of the excess traffic according to a predetermined billing method, that is, the bandwidth required for the excess traffic can be billed separately according to the agreed method.

[0133] As another optional method, speed limiting the control object according to the target bandwidth can be implemented as follows: determining whether the message traffic exceeds the target bandwidth; if so, sending a traffic alarm message for the control object to the control system to prompt the tenant whether the message traffic exceeds the target bandwidth.

[0134] When the message flow does not exceed the target bandwidth, the process may return to S403 to continue the execution.

[0135] Whether the message flow exceeds the target bandwidth can be determined by collecting real-time statistics of the real-time bandwidth of the message flow and comparing the real-time bandwidth with the target bandwidth.

[0136] It is understandable that in order to provide tenants with a better experience, the above-mentioned speed limit processing methods can be combined. When the real-time bandwidth is greater than the target bandwidth, the traffic alarm information can be sent first, and the billing result of the excess traffic exceeding the target bandwidth can be sent to the tenant; thereby allowing the tenant to determine whether to pay additional fees to ensure that all traffic passes through the gateway, thereby providing the tenant with a better user experience. If the tenant does not respond to the traffic alarm information within a period of time, the traffic exceeding the target bandwidth can be dropped.

[0137] Of course, there may be other ways to perform speed limit processing on the control object, and the processing method of speed limit processing is not limited here.

[0138] Optionally, the above method also includes: determining that the second gateway configures different coefficients for different network segments, and the coefficients corresponding to the bound network segments are predetermined values; sending the coefficients corresponding to different network segments to at least one switch; wherein the coefficients corresponding to different network segments set by any gateway are used to determine the network segments to which they are bound.

[0139] As can be seen from the above description, when the gateway configuration parameter is the target URL, the first switch will determine the target network segment according to the target URL, and then determine the corresponding second gateway. However, due to the possibility of failure of the second gateway, the message returned by the first gateway to the first switch may not be forwarded to the second gateway. In order to improve the control reliability, in some embodiments, since multiple gateways in the gateway cluster correspond to different network segments, different coefficients can be configured for different network segments for each gateway, wherein the coefficient corresponding to the network segment bound to each gateway can be set to a predetermined value.

[0140] In the embodiment of the present application, the comprehensive bandwidth of the control object in the gateway cluster is detected at the same gateway, and the target bandwidth of the real-time control object is compared. When the comprehensive bandwidth exceeds the real-time bandwidth, the gateway that forwards the traffic is speed-limited, thereby ensuring that the bandwidth passing through the gateway does not exceed the target bandwidth, thereby achieving precise speed limiting.

[0141] For ease of understanding, the following Figure 5 The flow control scenario diagram shown in the figure introduces the technical solution of the present application in a practical application. The gateway cluster includes three gateways as an example. The target network segment can be pre-selected and divided into three network segments: PREFIX1, IP-PREFIX2, and IP-PREFIX3; the coefficients configured for the three network segments in each gateway can be:

[0142] Gateway 502: IP-PREFIX1 coefficient is 1, IP-PREFIX2 coefficient is 2, and IP-PREFIX3 coefficient is 3;

[0143] Gateway 503: IP-PREFIX1 coefficient is 3, IP-PREFIX2 coefficient is 1, and IP-PREFIX3 coefficient is 2;

[0144] Gateway 504: IP-PREFIX1 coefficient is 2, IP-PREFIX2 coefficient is 3, and IP-PREFIX3 coefficient is 1.

[0145] After receiving the message, the first switch 501 distributes the message to the first gateway, which is assumed to be gateway 504, in a load balancing manner; gateway 504 can parse the message to obtain an object identifier to determine the control object targeted by the message, and based on the control object, the unique corresponding target network segment can be determined according to the technical solution of the present application, which is assumed to be IP-PREFIX2; then the first switch 501 can randomly select a website from the network segment IP-PREFIX2 as the target website, and replace the target network segment with the destination address in the destination address field in the message, and then gateway 504 returns the message to the first switch 501. It should be noted that the arrows in the figure are used to indicate the flow direction of the message. Each switch and each gateway will establish a routing connection.

[0146] The first switch 501 can obtain the target website address by parsing the destination address field in the message, and then determine the determined network segment IP-PREFIX2. Since the first switch 501 stores the coefficients set by different gateways for different network segments, the second gateway, i.e., gateway 503, which sets the coefficient of network segment IP-PREFIX2 to a predetermined value of 1, can be determined, so that the message can be sent to gateway 503.

[0147] Since according to the above method, the control object only corresponds to the network segment IP-PREFIX2, the destination address in the message for the control object will be modified to a website address randomly selected from the network segment IP-PREFIX2, so that the message for the control object will be sent to the gateway 503; the gateway 503 can perform traffic statistics on the message of the control object, and compare it with the target bandwidth corresponding to the control object to determine whether it exceeds the target bandwidth and implement speed limit processing.

[0148] In addition, the first switch 501 can sense whether the link between each gateway is faulty. Therefore, after the first switch 501 receives the message returned by the gateway 504 and determines the corresponding second gateway 503, if it is determined that the link with the gateway 503 is faulty, a fault notification can be sent to the gateway 504. The gateway 504 can determine that the link between the gateway 503 and the first switch 501 is faulty according to the fault notification; then the message can be sent to the second switch 505 for forwarding. The second switch 505 can be any switch in the same switch cluster as the first switch 501.

[0149] Among them, due to the possibility of failure of the second gateway 503, the message returned by the gateway 504 to the first switch 501 through the BGP algorithm may not be forwarded to the second gateway 503, and it is necessary to find a gateway to replace the second gateway 503 for message forwarding. Assuming that the smaller the coefficient of the network segment, the higher the priority, you can find a gateway in the gateway cluster whose IP-PREFIX2 coefficient has a priority slightly lower than that of the gateway 503, that is, the gateway 502, so that the first switch 501 can send the message to the gateway 502 for forwarding.

[0150] In this embodiment, after the first switch distributes the received message to the first gateway in a load balancing manner, the first gateway identifies the control object from the message, determines the gateway configuration parameters corresponding to the control object from the pre-configuration information, and then returns the message and the gateway configuration parameters to the first switch; the first switch can determine the second gateway that uniquely corresponds to the control object according to the gateway configuration parameters, and then distributes the message to the second gateway, which forwards the message and counts the message traffic of the control object to perform traffic control. The present application can forward the traffic forwarded by the same control object through the gateway cluster through one gateway, so that when performing traffic control, the gateway can perform traffic statistics and perform traffic control without borrowing third-party equipment, effectively improving the efficiency of traffic control, realizing real-time control, and saving detection costs. In the event of a link failure between the second gateway and the first switch, the first gateway is promptly notified to forward the message to the second switch. In addition, in the event of a failure in the second gateway, the third gateway is determined according to the coefficient of the network segment bound to the second gateway of the plurality of gateways in the gateway cluster, so that the first switch forwards the message to the third gateway in a timely manner. In the event of a failure in the second gateway or a link failure between the second gateway and the first switch, the embodiment of the present application can forward the message to the correct switch or gateway in a timely manner, thereby greatly improving the convergence speed.

[0151] Figure 6 A schematic diagram of the structure of an embodiment of a flow control device provided by the present application is shown, which is applied to a first gateway, such as Figure 6 The device includes: a receiving module 61, an identifying module 62, a determining module 63 and a returning module 64.

[0152] The receiving module 61 is used to receive a message sent by the first switch, where the message is distributed by the first switch in a load balancing manner.

[0153] The identification module 62 is used to identify the control object information in the message, wherein the control object information is used to identify the control object.

[0154] The determination module 63 is used to determine the gateway configuration parameters corresponding to the control object information from the pre-configuration information.

[0155] The return module 64 is used to return the message and the gateway configuration parameters to the first switch; the gateway configuration parameters are used to determine the second gateway that uniquely corresponds to the control object, so as to forward the message to the second gateway; the second gateway is used to forward the message and perform flow control on the message flow corresponding to the control object.

[0156] Optionally, the pre-configuration information includes network segments corresponding to different control object information; wherein different gateways in the gateway cluster are pre-configured with different network segments; the determination module 63 is specifically used to: determine the target network segment corresponding to the control object information from the pre-configuration information, and select the target URL from the target network segment.

[0157] Optionally, the pre-configuration information includes pre-configuring different network segments for different gateways in the gateway cluster; the determination module 63 is specifically used to: determine a matching target URL from an address set consisting of different network segments corresponding to the gateway cluster according to an object identifier of the control object in the message;

[0158] Optionally, the pre-configuration information includes gateway identifiers corresponding to different control object information and network segment information of multiple gateways in the gateway cluster; the determination module 63 is specifically used to: determine the gateway identifier corresponding to the control object information from the pre-configuration information; obtain the network segment information of the gateway corresponding to the gateway identifier; determine the target network segment to which the gateway is bound based on the network segment information; and select any URL in the target network segment as the target URL.

[0159] Optionally, the determination module 63 is further specifically used to: add the target URL to the target field in the message, and return the message containing the target URL to the first switch; the target field is used by the first switch to parse the target URL; the target network segment where the target URL is located is used to determine the corresponding second gateway.

[0160] Optionally, the determining module 63 is further specifically configured to:

[0161] The destination address corresponding to the destination address field in the message is modified using the target website address.

[0162] Optionally, the above device further includes: a judgment module, configured to judge whether a link between the second gateway and the first switch is faulty;

[0163] Optionally, the sending module is further configured to send the message and the gateway configuration parameter to the second switch.

[0164] Optionally, the determination module 63 is further configured to determine different coefficients configured for different network segments, and the coefficients corresponding to the bound network segments are predetermined values;

[0165] Optionally, the sending module is further used to send coefficients corresponding to different network segments to at least one switch; wherein the coefficients corresponding to different network segments set by any gateway are used to determine the network segment to which it is bound.

[0166] Figure 6 The flow control device can perform Figure 2 The implementation principle and technical effect of the flow control method described in the embodiment are not described in detail. The specific way in which each module and unit performs operations in the flow control device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0167] Figure 7 FIG. 1 shows a schematic diagram of a structure of an embodiment of a flow control device provided by the present application, which is applied to a first switch, such as Figure 7 The device may include: a receiving module 71 , a sending module 72 , and a forwarding module 73 .

[0168] The receiving module 71 is used to receive a message; receive the message and the gateway configuration parameters returned by the first gateway;

[0169] A sending module 72, configured to send the message to a first gateway in a gateway cluster in a load balancing manner; the first gateway is configured to identify the control object information in the message and determine a gateway configuration parameter corresponding to the control object information based on pre-configuration information;

[0170] The forwarding module 73 is used to forward the message to the corresponding second gateway according to the gateway configuration parameters; the second gateway is used to perform flow control on the message flow corresponding to the received control object information.

[0171] Optionally, the pre-configuration information includes network segments corresponding to different control object information; the gateway configuration parameter is a target URL selected from the target network segment corresponding to the control object information, and the target URL is used to be added to the target field in the message; wherein different gateways in the gateway cluster are pre-bound to different network segments; the receiving module 71 is used to: receive the message returned by the first gateway; parse the target URL from the target field of the message; determine the target network segment where the target URL is located, and the second gateway corresponding to the target network segment; and forward the message to the second gateway.

[0172] Optionally, the pre-configuration information includes different network segments pre-bound for different gateways in the gateway cluster; the gateway configuration parameter is a target URL that matches the object identifier of the control object determined from the address set consisting of different network segments corresponding to the gateway cluster; the target URL is used to be added to the target field in the message; the receiving module 71 is specifically used to: receive the message returned by the first gateway; parse the target URL from the target field of the message; determine the target network segment where the target URL is located, and the second gateway corresponding to the target network segment;

[0173] Optionally, the receiving module 71 is further used to: receive the network segment information corresponding to each gateway sent by each gateway in the gateway cluster;

[0174] Optionally, each gateway is configured with different coefficients corresponding to different network segments, and the coefficients of the network segments to which it is bound are predetermined values; the receiving module 71 is further used to: receive different coefficients set for different network segments sent by each gateway in the gateway cluster; the receiving module 71 is specifically used to:

[0175] Determine the target network segment where the target website is located; and search for a second gateway that sets a coefficient of the target network segment to the predetermined value.

[0176] Optionally, the coefficients corresponding to different network segments configured by each gateway correspond to different priorities, and the priority corresponding to the predetermined value is the highest; the above-mentioned device also includes: a judgment module, used to judge whether the second gateway fails; a determination module, used to determine a target coefficient with a priority lower than the priority corresponding to the predetermined value if so; a search module, used to find a third gateway that sets the target network segment as the target coefficient; and a forwarding module 73, further used to forward the message to the third gateway.

[0177] Figure 7 The flow control device can perform Figure 3 The implementation principle and technical effect of the flow control method described in the embodiment are not described in detail. The specific way in which each module and unit performs operations in the flow control device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0178] Figure 8 A schematic diagram of the structure of an embodiment of the flow control device provided by the present application is shown, which is applied to the second gateway, such as Figure 8 The device may include: a receiving module 81 , an identification module 82 , a statistics module 83 and a control module 84 .

[0179] The receiving module 81 is used to receive a message sent by the first switch; the message is sent by the first switch according to the second gateway corresponding to the gateway configuration parameter; the gateway configuration parameter is determined by the first gateway receiving the message in a load balancing manner according to the control object information in the message;

[0180] An identification module 82, used to identify the control object information in the message;

[0181] A statistics module 83, used for counting the message flow corresponding to the received control object information;

[0182] The control module 84 is used to perform flow control on the control object identified by the control object information according to the message flow.

[0183] Optionally, the control module 84 is specifically configured to: perform rate limiting processing on the message flow based on a target bandwidth corresponding to the control object.

[0184] Optionally, the control module 84 is further specifically used to: determine whether the message traffic exceeds the target bandwidth; if so, discard the excess traffic that exceeds the target bandwidth, or determine the cost information of the excess traffic according to a predetermined billing method, or send traffic alarm information for the control object to the control system.

[0185] Optionally, the determination module is also used to: determine that the second gateway configures different coefficients for different network segments, and the coefficients corresponding to the bound network segments are predetermined values; optionally, the above-mentioned device also includes: a sending module, used to send the coefficients corresponding to different network segments to at least one switch; wherein, the coefficients corresponding to different network segments set by any gateway are used to determine the network segments to which they are bound.

[0186] Figure 8 The flow control device can perform Figure 4 The implementation principle and technical effect of the flow control method described in the embodiment are not described in detail. The specific way in which each module and unit performs operations in the flow control device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0187] The present application embodiment also provides a gateway, such as Fig. 9 As shown, the gateway may include a storage component 901 and a processing component 902;

[0188] The storage component stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 902 to implement Figure 2 and / or Figure 4 The flow control method described.

[0189] Of course, the gateway may also include other components, such as input / output interfaces, display components, communication components, etc.

[0190] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0191] The processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0192] The storage component 901 is configured to store various types of data to support operations at the terminal. The storage component 901 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0193] The present application also provides a switch, such as Fig.10 As shown, the switch may include a storage component 901 and a processing component 1002;

[0194] The storage component stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 1002 to implement Figure 3 The flow control method described.

[0195] Of course, the switch may also include other components, such as input / output interfaces, display components, communication components, etc.

[0196] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0197] The processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0198] The storage component 1001 is configured to store various types of data to support operations at the terminal. The storage component 1001 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0199] It should be noted that the above computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. It can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device.

[0200] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 2 or Figure 3 or Figure 4 The flow control method described. The computer readable medium may be included in the corresponding device described in the above embodiment; or it may exist independently without being assembled into the computing device.

[0201] The present application also provides a computer program product, which includes a computer program carried on a computer-readable storage medium. When the computer program is executed by a computer, the above-mentioned Figure 2 or Figure 3 or Figure 4 In such an embodiment, the computer program may be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a processor, various functions defined in the system of the present application are executed.

[0202] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0203] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A flow control method, characterized in that: Applied to a first gateway, the method includes: receiving a message sent by the first switch, where the message is allocated by the first switch in a load balancing manner; Identifying control object information in the message; Determine the gateway configuration parameters corresponding to the control object information from the pre-configuration information; The message and the gateway configuration parameters are returned to the first switch; the gateway configuration parameters are used to determine the second gateway that uniquely corresponds to the control object identified by the control object information, so as to forward the message to the second gateway; the second gateway is used to forward the message and perform flow control on the message flow corresponding to the control object; wherein the first gateway and the first switch use the BGP protocol for routing; The method further comprises: Determine different coefficients configured for different network segments; wherein the coefficient corresponding to the bound network segment is a predetermined value, and the coefficient value corresponding to each network segment is an AS PATH attribute value; The coefficients corresponding to different network segments are sent to at least one switch; wherein the coefficients corresponding to different network segments set by any gateway are used to determine the network segment to which it is bound.

2. The method according to claim 1, characterized in that The pre-configuration information includes network segments corresponding to different control object information respectively; wherein different gateways in the gateway cluster are pre-configured with different network segments; and determining the gateway configuration parameters corresponding to the control object information from the pre-configuration information includes: Determine the target network segment corresponding to the control object information from the pre-configured information, and select the target website from the target network segment; The returning the message and the gateway configuration parameter to the first switch comprises: The target website address is added to the target field in the message, and the message containing the target website address is returned to the first switch; the target field is used by the first switch to parse and obtain the target website address; the target network segment where the target website address is located is used to determine the corresponding second gateway.

3. The method according to claim 2, characterized in that Also includes: When the target network segment is the network segment configured by the first gateway, forward the message, count the message flow corresponding to the control object obtained by receiving, and perform flow control on the control object according to the message flow; Performing flow control on the control object according to the message flow; The selecting a target website from the target network segment comprises: When the target network segment is not a network segment configured for the first gateway, a target URL is selected from the target network segment.

4. The method according to claim 1, characterized in that: The pre-configuration information includes different network segments pre-configured by different gateways in the gateway cluster; the determining, from the pre-configuration information, the gateway configuration parameters corresponding to the control object information includes: According to the object identifier in the message, determine a matching target URL from an address set consisting of different network segments corresponding to the gateway cluster; The returning the message and the gateway configuration parameter to the first switch comprises: The target website address is added to the target field in the message, and the message containing the target website address is returned to the first switch; the target field is used by the first switch to parse and obtain the target website address; the target network segment where the target website address is located is used to determine the corresponding second gateway.

5. The method according to claim 2, characterized in that: Also includes: When the target website is located in the network segment configured by the first gateway, forward the message, count the message flow corresponding to the control object obtained by receiving, and perform flow control on the control object according to the message flow; The adding the target website address to the target field in the message comprises: In the case that the target website address is not located in the network segment configured by the first gateway, the target website address is added to the target field in the message.

6. The method according to claim 2 or 4, characterized in that: The adding the target website address to the target field in the message comprises: The destination address corresponding to the destination address field in the message is modified using the target website address.

7. The method according to claim 1, characterized in that The method further comprises: Determine whether a link between the second gateway and the first switch is faulty; In the event of a link failure between the second gateway and the first switch, the message and the gateway configuration parameters are sent to the second switch.

8. A flow control method, characterized in that: Applied to a first switch, the method includes: Receive messages; Allocate the message to a first gateway in a gateway cluster in a load balancing manner; the first gateway is used to identify the control object information in the message and determine the gateway configuration parameters corresponding to the control object information based on pre-configuration information; receiving the message and the gateway configuration parameters returned by the first gateway; forwarding the message to a corresponding second gateway according to the gateway configuration parameters; the second gateway is used to perform flow control on the message flow corresponding to the received control object information; Among them, different gateways in the gateway cluster are pre-bound to different network segments; the gateway configuration parameter is a target URL selected from the target network segment corresponding to the control object information or a target URL matched with the object identifier determined from an address set consisting of different network segments corresponding to the gateway cluster; The receiving the message and the gateway configuration parameter returned by the first gateway includes: receiving the message returned by the first gateway; Parsing the target URL from the target field of the message; Determine the target network segment where the target website is located, and a second gateway corresponding to the target network segment; forwarding the message to the second gateway; Each gateway is configured with different coefficients corresponding to different network segments, and the coefficient of the network segment to which it is bound is a predetermined value; The method further comprises: Receive different coefficients set for different network segments sent by each gateway in the gateway cluster; The determining the target network segment where the target website is located and the second gateway corresponding to the target network segment includes: Determine the target network segment where the target website is located; Find a second gateway that sets the coefficient of the target network segment to the predetermined value.

9. The method according to claim 8, characterized in that The coefficients corresponding to different network segments configured by each gateway correspond to different priorities, and the priority corresponding to the predetermined value is the highest; and further comprising: Determining whether the second gateway fails; If so, determining a target coefficient having a priority lower than the predetermined value; Finding a third gateway that sets the target network segment as the target coefficient; The message is forwarded to the third gateway.

10. A flow control method, characterized in that: Applied to the second gateway, the method includes: receiving a message sent by a first switch; the message is sent by the first switch according to a second gateway corresponding to a gateway configuration parameter; the gateway configuration parameter is determined by the first gateway receiving the message in a load balancing manner according to control object information in the message; wherein the first gateway and the first switch use the BGP protocol for routing; Wherein, the first gateway is also used to determine different coefficients configured for different network segments; wherein the coefficient corresponding to the bound network segment is a predetermined value, and the coefficient value corresponding to each network segment is an AS PATH attribute value; the coefficients corresponding to different network segments are sent to at least one switch; wherein the coefficients corresponding to different network segments set by any gateway are used to determine the network segment to which it is bound; Identifying the control object information in the message; Counting the message flow corresponding to the received control object information; The flow rate of the control object identified by the control object information is controlled according to the message flow rate.

11. The method according to claim 10, characterized in that The performing flow control on the control object identified by the control object information according to the message flow comprises: Determining whether the message flow exceeds the target bandwidth; If so, the excess traffic exceeding the target bandwidth is subjected to packet loss processing, or the fee information of the excess traffic is determined according to a predetermined billing method, or traffic alarm information for the control object is sent to the control system.

12. A gateway, characterized in that: It comprises a storage component and a processing component; the storage component stores one or more computer program instructions; the one or more computer program instructions are called and executed by the processing component to implement the flow control method as described in any one of claims 1-7 and / or the flow control method as described in any one of claims 8-9.

13. A switch, characterized in that: It comprises a storage component and a processing component; the storage component stores one or more computer program instructions; the one or more computer program instructions are called and executed by the processing component to implement the flow control method as described in any one of claims 8-9.

14. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, the flow control method according to any one of claims 1 to 7, the flow control method according to any one of claims 9 to 12, or the flow control method according to any one of claims 8 to 9 is implemented.