WO2020019743A1 - 流量控制方法及装置 - Google Patents
流量控制方法及装置 Download PDFInfo
- Publication number
- WO2020019743A1 WO2020019743A1 PCT/CN2019/079388 CN2019079388W WO2020019743A1 WO 2020019743 A1 WO2020019743 A1 WO 2020019743A1 CN 2019079388 W CN2019079388 W CN 2019079388W WO 2020019743 A1 WO2020019743 A1 WO 2020019743A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- tokens
- client
- service
- pending
- server
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000012545 processing Methods 0.000 claims abstract description 20
- 230000001960 triggered effect Effects 0.000 claims abstract description 9
- 239000013589 supplement Substances 0.000 claims abstract description 7
- 230000006735 deficit Effects 0.000 claims description 8
- 238000004891 communication Methods 0.000 abstract description 14
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000006870 function Effects 0.000 description 17
- 238000013461 design Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000000047 product Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000007493 shaping process Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/215—Flow control; Congestion control using token-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Definitions
- the present application relates to the field of communication technologies, and in particular, to a method and a device for controlling flow.
- providing more accurate flow control is beneficial to avoid a tenant occupying excessive storage system resources and maintain the performance of the storage system.
- Each node collects local flow control data, such as collecting local current traffic, and broadcasting the collected local traffic data to all nodes except itself, and then each node according to the global flow Control target and flow control data obtained from other nodes, calculate its own flow control target, and realize local flow control.
- the storage system resources that the same tenant needs to access are likely to be distributed on different nodes. Therefore, traffic shaping needs to be performed between these different nodes.
- the traffic data and other nodes need to be transmitted between nodes, and the traffic data and other nodes must be strictly synchronized, which results in large communication overhead between nodes and affects the overall performance of the storage system.
- the application provides a flow control method and device to reduce communication overhead between nodes in a storage system.
- the present application provides a flow control method, which includes:
- the client When the client receives the service request sent by the terminal and determines that the number of tokens required by the pending service is greater than the number of locally available tokens and the number of tokens required by the pending service does not exceed the local overdraft token limit, the client processes For pending business, when a preset condition is triggered, multiple tokens are applied to the server. Among them, the service request is used to indicate the number of tokens required by the pending service, the number of tokens required by the pending service is associated with the traffic of the pending service, and the token is used to control the amount of traffic of the pending service. Multiple tokens are used to supplement tokens overdrawn by pending services.
- the flow control method in the embodiment of the present invention when there is a pending service, if the client determines the token required for the pending service If the number is greater than the number of locally available tokens and does not exceed the limit of the local overdraft token, the client processes the pending business.
- the client applies for multiple tokens from the server.
- the client can limit the traffic of the pending business to the traffic that can be supported by the local overdraft token, and the token related to the traffic restriction in the client originates from the server. In other words, the client only needs to perform token interaction with the server, and does not need to grasp the traffic data of other clients, which reduces the communication overhead between clients, thereby reducing the overall performance overhead of the flow control system.
- the preset condition may be a preset period, that is, the client may apply for a token from the server every preset period.
- the foregoing preset condition may be that the locally available token of the client is insufficient to support the current service request. In this way, when the client has few locally available tokens, it is not necessary to wait for the next preset period to arrive, and it can directly apply for tokens to the server to supplement the missing tokens.
- the client processes the pending service.
- the client discards the pending transaction or caches the pending transaction.
- the client sends a query request to the server to learn that there are allocable tokens in the server and the number of allocable tokens is greater than or equal to the number of tokens required for other pending transactions and the local availability order If the number of cards is different, the client applies for a token from the server. That is, after the client caches the pending business, the client can apply for a token from the server, process the pending business, and resume the terminal business.
- the client processing the pending service may be specifically implemented as follows: the client sends instruction information to the terminal to instruct the terminal to access resources associated with the client.
- the client processes the pending service, which may also be specifically implemented as follows: the client instructs the terminal to access the resources associated with the client.
- the client processing a pending service means that the client feeds back the webpage content to the terminal, so that the user can browse the required webpage content.
- the present application provides a flow control device, which includes a receiving module, a processing module, an application module, a buffer, and a sending module.
- the receiving module is configured to receive a service request sent by the terminal.
- the service request is used to indicate the number of tokens required for the pending service, and the number of tokens required for the pending service is associated with the traffic of the pending service.
- a processing module configured to determine that the number of tokens required for the pending business is greater than the number of locally available tokens and the number of tokens required for the pending business does not exceed the local overdraft token limit; Used to control the amount of traffic to be processed.
- An application module is configured to apply for multiple tokens from the server when a preset condition is triggered, and the applied multiple tokens are used to supplement tokens that are overdrawn by the pending business.
- the processing module is configured to process pending services, and includes: sending instruction information to the terminal to instruct the terminal to access resources associated with the device.
- a sending module configured to send a query request to the server to learn that there are allocable tokens in the server and the number of allocable tokens is greater than or equal to the difference between the number of tokens required for other pending services and the number of locally available tokens value.
- the application module is further configured to apply for a token from the server according to the query result of the sending module.
- the resources associated with the client include an object bucket, a file block, a file system, and a database.
- the number of multiple tokens applied by the client to the server is greater than or equal to the deficit value, and the deficit value is the number of tokens required for the pending business and The difference between the number of locally available tokens.
- some tokens in the locally available token can be used to make up for the overdraft of the previous service request or the token required for this business request.
- the card can be used to support service requests from other terminals or to support the next service request from the same terminal.
- the present application provides a flow control device having the function of implementing the method of any one of the above aspects.
- This function can be realized by hardware, and can also be implemented by hardware executing corresponding software.
- the hardware or software includes one or more modules corresponding to the above functions.
- a flow control device including: a processor and a memory; the memory is configured to store a computer execution instruction, and when the flow control device is running, the processor executes the computer execution instruction stored in the memory so that The flow control device executes the flow control method according to any one of the above aspects.
- a flow control device including: a processor; the processor is coupled to the memory and reads instructions in the memory, and then executes the flow control method according to any one of the above aspects according to the instructions.
- a computer-readable storage medium stores instructions that, when run on a computer, enable the computer to execute the flow control method of any of the above aspects.
- a computer program product containing instructions which when run on a computer, enables the computer to execute the flow control method of any one of the above aspects.
- a circuit system including a processing circuit configured to execute the flow control method according to any one of the above aspects.
- the technical effects brought by any one of the design methods in the second aspect to the eighth aspect can refer to the technical effects brought by the different design methods in the aspect, and are not repeated here.
- FIG. 1 is a system architecture diagram provided by an embodiment of the present invention
- FIG. 2 is an interaction diagram of a flow control method according to an embodiment of the present invention.
- FIG. 3 is a schematic structural diagram of a flow control device according to an embodiment of the present invention.
- first and “second” in the specification of the present application and the drawings are used to distinguish different objects, or to distinguish different processes on the same object, rather than to describe a specific order of the objects.
- the terms “including” and “having” as well as any variations of them mentioned in the description of the present application are intended to cover non-exclusive inclusion.
- a process, method, system, product, or device that contains a series of steps or units is not limited to the listed steps or units, but optionally also includes other steps or units not listed, or optionally also Include other steps or units inherent to these processes, methods, products, or equipment.
- words such as “exemplary” or “for example” are used as examples, illustrations, or descriptions.
- the flow control method provided by the embodiment of the present invention is applied to a flow control system.
- FIG. 1 it is a structural diagram of a flow control system according to an embodiment of the present invention.
- the flow control system includes a client, a server, and a terminal.
- the terminal (only one is shown as an example in the figure) can communicate with the client.
- the terminal applies for a token from at least one client associated with the service request to ensure the normal operation of the service.
- the entire system cluster is divided into several sub-cluster, each sub-cluster contains a preset number of clients, and the service traffic requested by one service of the terminal is associated with the preset number of clients
- each client can share at least part of the traffic of the service traffic, and achieve traffic balance between the clients.
- there are three clients in the system cluster The cluster consisting of three clients is divided into two sub-clusters, and two clients form a sub-cluster.
- the two clients of the sub-cluster The terminal provides services to the terminal.
- the terminals involved in the embodiments of the present invention include various handheld devices, wearable devices, computing devices, or other devices connected to a wireless modem with communication functions; they may also include cellular phones, smart phones (smart phone), wireless data card, personal digital assistant (PDA) computer, tablet computer, handheld device, laptop computer, machine type communication (MTC) Terminal, user equipment (UE), mobile station (MS), terminal device, etc.
- PDA personal digital assistant
- MTC machine type communication
- UE user equipment
- MS mobile station
- the client is used to obtain a token from the server, and when the terminal has a business need, it issues a certain number of tokens to the terminal to meet the business needs of the terminal. Among them, the client updates the number of remaining tokens locally after issuing a token to the terminal each time. In other words, after the client issues the token for the terminal this time, the number of local remaining tokens is the difference between the number of local remaining tokens before the token is issued and the number of tokens issued.
- the client in the embodiment of the present invention may be a device such as a server or a computer, or a device having similar functions to the server or the computer.
- the server is used to manage at least one client, and issues a token to the managed client.
- a token bucket is set in the server, and a preset number of tokens are generated every preset time for the client to apply for.
- the server can generate a token every 0.1ms, or the server can generate 3 tokens every 0.3ms. How long the server generates tokens at intervals and the number of tokens generated each time can be set according to actual business requirements, which is not limited in the embodiment of the present invention.
- FIG. 1 three servers are shown in FIG. 1.
- the server in the solid line box is the main server
- the two servers shown in the dashed box are backup servers.
- the server in the embodiment of the present invention may be an independent device, such as a server, a computer, or may be integrated as a functional module in the client.
- resources can be resources in object buckets, file systems, databases, and so on.
- FIG. 1 an exemplary process of allocating a token of a resource in an object bucket to a client by a main server is exemplarily shown.
- the traffic of a pending service is associated with a preset number of clients, and each client shares at least part of the traffic of the pending service.
- the following embodiments are mainly described from the perspective of one client among a preset number of clients, which will be collectively described herein, and will not be described in detail below.
- the flow control method according to the embodiment of the present invention includes the following steps:
- the terminal sends a service request to the client.
- the client receives a service request sent by the terminal.
- the service request is used to request processing of a pending service and indicates the number of tokens required for the pending service, and the number of tokens required for the pending service is associated with the traffic of the pending service. Specifically, the larger the traffic of the unprocessed service, the more tokens required by the unprocessed service, the smaller the traffic of the unprocessed service, and the fewer tokens required by the unprocessed service.
- the pending service indicated by the service request is a data packet with a size of 100M. Assume that the number of tokens required for each 10M data packet is 1. The number of required tokens is 10.
- the client determines whether the number of tokens required by the pending service is greater than the number of locally available tokens. If the number of tokens required by the pending service is less than or equal to the number of locally available tokens, S204 is performed. If the number of required tokens is greater than the number of locally available tokens, S203 is performed.
- the locally available tokens on the client are the tokens remaining on the client.
- tokens are used to control the volume of traffic to be processed.
- the client judges whether the number of tokens required by the pending service exceeds the upper limit of the local overdraft token. If the number of tokens required by the pending service exceeds (that is, greater than) the upper limit of the local overdraft token, S206 is executed. If the number of tokens required for the pending service does not exceed (ie, is less than or equal to) the upper limit of the local overdraft token, step S204 is performed.
- the client processes the pending service.
- the processing of the pending service by the client refers to the client sending a resource associated with the client to the terminal.
- the manner in which the client sends resources to the terminal is as follows:
- Manner 1 The client sends instruction information to the terminal to instruct the terminal to access resources associated with the client.
- the client processes pending services according to method 1:
- Scenario 1 The number of tokens remaining locally on the client meets the current service request, that is, the number of tokens required for the pending service is less than or equal to the number of tokens remaining locally on the client.
- the client processes the pending service according to Mode 1, that is, the client sends instruction information to the terminal to indicate that the pending service application is successful, and feeds back to the terminal the resources to be accessed and associated with the client.
- the resources associated with the client include object buckets, file blocks, file systems (FS), and databases.
- the object bucket is a storage structure for storing objects.
- the client manages the object bucket through an Application Programming Interface (API), including the read operation and the write operation of the object bucket.
- the file block may be a block of a file in a distributed storage system.
- the file block may be a block in a Hadoop Distributed File System (Hadoop Distributed File System, HDFS).
- a file system can be software for managing and storing data.
- a database can be a warehouse that organizes, stores, and manages data according to a data structure. For example, common databases include MySQL, oracle, and so on.
- the database contains at least one data table, and each data table contains at least one data.
- the resources associated with the client can also be evolved versions of file systems, object buckets, etc., or resources generated using the evolved technology, or other resources that can provide access services. This is not restricted.
- object buckets, file blocks, file systems, databases, etc. may be located on the client, or may be located on other independent storage devices. For example, they may be located on HDFS devices. This embodiment of the present invention does not limit this. .
- the client when the number of tokens required for the pending service is less than or equal to the number of tokens remaining locally on the client, the client sends instructions to the terminal to indicate the success of the pending service application, and feeds back to the terminal Data of data table 1 in database 1.
- Scenario 2 The number of tokens remaining locally on the client is insufficient to support the current service request, and the number of tokens required for the pending service does not exceed the upper limit of the client's local overdraft token.
- the client processes the to-be-processed service according to the above manner 1. For example, in a period of time, 100 tokens are required to support the terminal for web browsing services. There are 60 available tokens in the client, which is not sufficient to support the current web browsing services.
- the client's local overdraft token limit (110 ) Is greater than the number of tokens required for the currently pending service (100), the client sends instructions to the terminal to indicate the success of the web browsing service application, and sends the web content to the terminal, so that the user can browse the web content through the terminal browser .
- Manner 2 The client directly instructs the terminal to access a resource associated with the client.
- Mode 2 the client no longer sends instruction information to the terminal, but directly sends the associated resources to the terminal, which can save some link resources and reduce packet congestion on the link. The probability.
- scenario 1 and scenario 2 the client can process pending services according to method 2.
- the client can process pending services according to method 2.
- the specific process of processing the to-be-processed services in scenario 1 and scenario 2 according to method 2 refer to the process of processing the to-be-processed services in scenario 1 and scenario 2 according to method 1, and details are not described herein again.
- the preset conditions may include the following two types:
- the preset condition is a preset period, that is, the client applies for a token from the server every preset period.
- the preset period can be set according to the actual application situation, which is not limited in the embodiment of the present invention.
- the preset period may be 10 ms, and the client applies for a token from the server every 10 ms.
- S205 is performed before, after, or at the same time as S201 to S204 or S206.
- the embodiment of the present invention does not limit the execution timing of S205.
- the client's local remaining tokens are insufficient to support the current service request and the number of tokens required for the current pending service is less than or equal to the client's local overdraft token limit, first execute S205, that is, the client sends The server applies for a token and determines whether there is an allocable token in the server. If an allocable token exists in the server, the client obtains a certain number of tokens from the server and executes S204 to process the pending business. .
- the client discards or caches pending transactions. Or, if there is no distributable token in the server, the client starts a timer. If the timeout expires and a new distributable token is newly generated in the server, the client obtains the token from the server and processes the pending business. If there is no distributable token in the server until the timer expires, the client discards or caches the pending business.
- the timer timeout time can be set according to service requirements. For services that are sensitive to delay, the timer timeout time can be set to a smaller value. For services that do not require high delay, the timer timeout time can be set to a relatively small value. Big value.
- the number of tokens applied by the client to the server each time can be determined according to the actual application scenario, and each time the client applies for tokens to the server, the number of locally available tokens is updated, and the updated tokens Used to support service requests from the terminal.
- the preset condition is that the number of locally available tokens on the client is insufficient to support the current service request.
- the number of multiple tokens applied by the client to the server is greater than or equal to the deficit difference, and the deficit difference is the difference between the number of tokens required for the pending business and the number of locally available tokens. value.
- the token applied by the client can not only supplement the tokens that were overdrawn due to the previous service request or the current service request, the excess tokens can also be used to support the next service request of the terminal or to support the service requests of other terminals.
- N tokens For example, in a period of time, 100 tokens are required to support the terminal for web browsing services.
- the client has 60 available tokens, which is not enough to support the current web browsing services.
- the client's local overdraft token limit (110) More than the number of tokens required for web browsing business.
- the client is triggered to apply for N tokens to the server. 40 tokens out of these N tokens are used to make up for the overdraft of 40 (that is, the required order)
- the difference between the token and the locally available tokens) tokens, and N-40 tokens out of the N tokens can be used to respond to and support service requests from other terminals.
- the number of tokens applied by the client may also be determined according to the current service request. Specifically, the number of tokens applied by the client and the tokens required by the pending service, the allocable tokens in the server, a preset number of clients for sharing the pending service, and the client's The number of historical application tokens and the upper limit of the total traffic of multiple clients used to share the pending services are associated.
- the number of tokens applied by the client can be expressed by the following formula:
- TokenAdv and TokenDem in formula (1) can be expressed by formula (2) and formula (3), respectively:
- TokenAdv Min [2 * requireToken, Max (requireToken, ceiling (remainToken / NodeNum))]
- TokenDem (QosClientDemand / MaxLimit) * remainToken
- allocToken is the number of tokens applied by a client to the server, and can also be considered as the number of tokens allocated by the server to a client.
- TokenAdv is the number of tokens allocated by the server to the client according to a preset algorithm.
- TokenDem is the number of tokens allocated by the server to the client based on business requirements
- r is a weighting factor greater than or equal to
- requireToken is the number of tokens required for a pending business, which is a positive integer
- Min is the demand
- Max is the function of obtaining the maximum value
- ceiling is the function of rounding up
- remainingToken is the number of tokens remaining in the token bucket of the server, which is an integer greater than or equal to 0
- NodeNum is used for sharing
- the number of clients for the pending service traffic is an integer greater than 0
- QosClientDemand is the number of historical application tokens for the client obtained based on empirical values or statistical information, which is a positive integer
- MaxLimit is used to share the pending business
- the upper limit of the total traffic of multiple clients of the traffic which is a positive number.
- the traffic cap refers to the upper limit of the traffic expected to be received by the client.
- the upper limit of the traffic of the client is set to 100M.
- the communication network usually needs to carry high traffic, and there may be burst traffic. Therefore, although the expected client traffic limit is 100M, in order to improve the access success rate of terminal services, when the service traffic is slightly greater than the client traffic limit, the client can receive and process business traffic that exceeds 100M, that is, The client can overdraw a certain number of tokens for the terminal.
- the client discards the pending service, or the client caches the pending service.
- the client limits the flow of pending services. There are two ways for the client to limit pending service traffic:
- Method 1 Discard the pending services.
- the client sends a first message to the terminal to indicate that the terminal's pending service application fails. And, the client discards the pending service.
- the client may first send a first message to the terminal, and then discard the pending service, so that the user learns that the pending service application fails as soon as possible.
- the client may also discard the pending service before sending the first message to the terminal.
- the execution order of the two steps of sending the first message and discarding the pending service in the embodiment of the present invention is not limited.
- Method 2 The client caches pending services.
- the client sends a second message to the terminal to indicate that the status of the terminal's pending services is the pending status.
- the client caches pending services.
- the embodiment of the present invention does not limit the execution order of the two steps of sending the second message and buffering the pending service.
- the client includes a cache structure, such as a cache queue and a cache stack.
- the client can push the pending service into the stack or queue when the pending service traffic is high.
- the client sends a query request to the server to query the number of tokens in the server.
- the number of allocable tokens is greater than or equal to the difference between the number of tokens required for the cached pending business and the number of locally available tokens, the The client applies for a token from the server and processes the cached pending business.
- the client sets priorities for multiple pending services and prioritizes high priority pending services.
- the client cache has three pending services, which are, in order of priority, pending services 2, pending services 1, and pending services 3.
- the client periodically applies for a token from the server.
- the token data in the client is sufficient to support pending service 2 after a token application
- the client processes the pending service 2.
- the client processes pending service 1.
- the client can process pending services3.
- the client can also preferentially process pending services with a small number of required tokens.
- the number of tokens required for service 1 is 20, the number of tokens required for service 2 is 50, and the number of tokens required for service 1 is 200.
- the number of tokens updated in the client is 100, and the client preferentially processes the pending business1. After that, if there are sufficient tokens remaining in the client, the client processes the pending business. 2. Similarly, the client processes pending business 3.
- the client can also determine the processing order of each to-be-processed service according to the two indicators of the priority of the to-be-processed service and the required number of tokens.
- the client may also determine the processing order of the pending services according to other indicators or according to the actual scenario, which is not limited in the embodiment of the present invention.
- the flow control method in the embodiment of the present invention when there is a pending service, if the client determines the token required for the pending service If the number is greater than the number of locally available tokens and does not exceed the limit of the local overdraft token, the client processes the pending business.
- the client applies for multiple tokens from the server.
- the client can limit the traffic of the pending business to the traffic that can be supported by the local overdraft token, and the token related to the traffic restriction in the client originates from the server. In other words, the client only needs to exchange tokens with the server, and does not need to grasp the traffic data of other clients, which reduces the communication link overhead between clients, thereby reducing the overall performance overhead of the flow control system.
- the flow control device includes a hardware structure and / or a software module corresponding to each function.
- the flow control device includes a hardware structure and / or a software module corresponding to each function.
- the functional modules of the flow control device may be divided according to the foregoing method example.
- each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
- the above integrated modules may be implemented in the form of hardware or software functional modules. It should be noted that the division of the modules in the embodiments of the present invention is schematic, and is only a logical function division. In actual implementation, there may be another division manner.
- FIG. 3 shows a possible structural schematic diagram of the flow control device involved in the foregoing embodiment.
- the flow control apparatus 300 may include a receiving module 301, a processing module 302, an application module 303, and a sending module 304.
- the receiving module 301 is configured to support the flow control apparatus 300 to execute the process S201 in FIG. 2.
- S201 may be performed by the transceiver in the flow control device.
- the processing module 302 is configured to support the flow control device 300 to execute the processes S202, S203, S204, and S206 in FIG. 2.
- the processors in the flow control device can execute the processes S202, S203, S204, and S206 in FIG. 2.
- the application module 303 is configured to support the flow control device 300 to execute the process S205 in FIG. 2.
- the processor in the flow control device may execute the process S205 in FIG. 2.
- the sending module 304 is used to support the flow control device to send a query request to the server to learn the number of tokens in the server.
- the transceiver in the flow control device may send a query request to the server.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer And Data Communications (AREA)
Abstract
本申请提供一种流量控制方法及装置,涉及通信技术领域,能够解决现有技术中节点间的通信开销大,系统性能较低的问题。该方法包括:客户端接收终端发送的业务请求,确定待处理业务所需的令牌的数目大于本地可用令牌的数目且待处理业务所需令牌的数目不超过本地可透支令牌上限时,客户端处理待处理业务,当预设条件触发时,向服务端申请多个令牌。其中,业务请求用于指示待处理业务所需的令牌的数目,待处理业务所需令牌的数目与待处理业务的流量相关联,申请的多个令牌用于补充被待处理业务透支的令牌。该方法应用在对终端进行流量控制的过程中。
Description
本申请涉及通信技术领域,尤其涉及一种流量控制方法及装置。
在分布式存储系统中,提供较精准的流量控制,有利于避免某个租户占用过多的存储系统资源,维持存储系统的性能。
目前,业界存在一种流量控制方法,每一节点采集本地流控数据,例如采集本地当前流量,并将采集的本地流量数据广播至除自身之外的其他全部节点,进而每一节点根据全局流控目标和从其他节点获取的流控数据,计算自身的流控目标,实现本地流量控制。
然而,随着存储系统规模的不断扩大,同一租户需访问的存储系统资源很可能分布在不同的节点上,因此需要在这些不同节点之间做流量整形。由于节点之间需传输流量数据等,且需保证各节点间的流量数据等严格同步,导致节点之间的通信开销大,影响存储系统的整体性能。
发明内容
本申请提供一种流量控制方法及装置,以减小存储系统中节点之间的通信开销。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种流量控制方法,该方法包括:
客户端接收终端发送的业务请求,确定待处理业务所需的令牌的数目大于本地可用令牌的数目且待处理业务所需令牌的数目不超过本地可透支令牌上限时,客户端处理待处理业务,当预设条件触发时,向服务端申请多个令牌。其中,业务请求用于指示待处理业务所需的令牌的数目,待处理业务所需令牌的数目与待处理业务的流量相关联,令牌用于控制待处理业务的流量大小,申请的多个令牌用于补充被待处理业务透支的令牌。
与现有技术中节点之间需频繁通信,导致通信链路开销较大相比,本发明实施例的流量控制方法,当存在待处理业务时,若客户端确定待处理业务所需的令牌数目大于本地可用令牌数目且不超过本地可透支令牌上限,则客户端处理待处理业务。并且,当预设条件触发时,客户端向服务端申请多个令牌。其中,客户端可将待处理业务的流量限制在本地可透支令牌能够支持的流量之内,并且,客户端中与流量限制相关的令牌来源于服务端。也就是说,该客户端仅需与服务端进行令牌交互,无需掌握其他客户端的流量数据,降低了客户端间的通信开销,从而降低流量控制系统的整体性能开销。
在一种可能的设计中,上述预设条件可以为预设周期,也就是说,客户端可每隔预设周期向服务端申请一次令牌。
或者,上述预设条件可以为客户端的本地可用令牌不足以支持当前的业务请求。这样,当客户端本地可用令牌较少时,不必等待下一预设周期到来,可直接向服务端申请令牌,以补充所欠缺的令牌。
在一种可能的设计中,在客户端接收终端发送的业务请求之后,还可以执行如下步骤:
若确定待处理业务所需的令牌的数目小于或等于本地可用令牌的数目,则客户端处理待处理业务。
在一种可能的设计中,在客户端接收终端发送的业务请求之后,还可以执行如下步骤:
确定待处理业务所需的令牌的数目大于本地可用令牌的数目且待处理业务所需令牌 的数目超过本地可透支令牌上限时,客户端丢弃待处理业务或者缓存待处理业务。
在一种可能的设计中,客户端向服务端发送查询请求以获知服务端中存在可分配令牌且可分配令牌的数目大于或等于其他待处理业务所需令牌的数目与本地可用令牌的数目的差值,则客户端向服务端申请令牌。也就是说,在客户端缓存待处理业务后,客户端可向服务端申请令牌,并处理待处理业务,恢复终端业务。
在一种可能的设计中,客户端处理待处理业务,具体可以实现为:客户端向终端发送指示信息以指示终端访问客户端关联的资源。
在一种可能的设计中,客户端处理待处理业务,具体还可以实现为:客户端指示终端访问客户端关联的资源。比如,在用户使用手机浏览器浏览网页的场景中,客户端处理待处理业务指的是客户端向终端反馈网页内容,这样,用户能够浏览所需的网页内容。
第二方面,本申请提供一种流量控制装置,该装置包括接收模块、处理模块、申请模块、缓存以及发送模块。
其中,接收模块,用于接收终端发送的业务请求,业务请求用于指示待处理业务所需的令牌的数目,待处理业务所需令牌的数目与待处理业务的流量相关联。处理模块,用于确定待处理业务所需的令牌的数目大于本地可用令牌的数目且待处理业务所需令牌的数目不超过本地可透支令牌上限时,处理待处理业务,令牌用于控制待处理业务的流量大小。申请模块,用于当预设条件触发时,向服务端申请多个令牌,申请的多个令牌用于补充被待处理业务透支的令牌。
在一种可能的设计中,处理模块用于处理待处理业务,包括:用于向终端发送指示信息以指示终端访问装置关联的资源。
在一种可能的设计中,缓存中保存有其他待处理业务。
发送模块,用于向服务端发送查询请求以获知服务端中存在可分配令牌且可分配令牌的数目大于或等于其他待处理业务所需令牌的数目与本地可用令牌的数目的差值。申请模块,还用于根据发送模块的查询结果向服务端申请令牌。
在第一方面或第二方面的一种可能的设计中,客户端关联的资源包括对象桶、文件块、文件系统、数据库。
在第一方面或第二方面的一种可能的设计中,客户端向服务端申请的多个令牌的数目大于或等于亏欠差值,亏欠差值为待处理业务所需令牌的数目与本地可用令牌的数目的差值。
这样,客户端更新本地可用令牌后,本地可用令牌中的部分令牌可用于补足前次业务请求所透支或者本次业务请求所需透支的令牌,本地可用令牌中的另一部分令牌可用于支持其他终端的业务请求或者用于支持同一终端的下次业务请求。
第三方面,本申请提供一种流量控制装置,该流量控制装置具有实现上述方面任一项的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第四方面,提供一种流量控制装置,包括:处理器和存储器;该存储器用于存储计算机执行指令,当该流量控制装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该流量控制装置执行如上述方面中任一项的流量控制方法。
第五方面,提供一种流量控制装置,包括:处理器;处理器用于与存储器耦合,并读取存储器中的指令之后,根据指令执行如上述方面中任一项的流量控制方法。
第六方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其 在计算机上运行时,使得计算机可以执行上述方面中任一项的流量控制方法。
第七方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述方面中任一项的流量控制方法。
第八方面,提供一种电路系统,该电路系统包括处理电路,处理电路被配置为执行上述方面任意一项所述的流量控制方法。
其中,第二方面至八方面中任一种设计方式所带来的技术效果可参见方面中不同设计方式所带来的技术效果,此处不再赘述。
图1为本发明实施例提供的系统架构图;
图2为本发明实施例提供的流量控制方法的交互图;
图3为本发明实施例提供的流量控制装置的结构示意图。
本申请的说明书以及附图中的术语“第一”和“第二”等是用于区别不同的对象,或者用于区别对同一对象的不同处理,而不是用于描述对象的特定顺序。此外,本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。需要说明的是,本发明实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本发明实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本发明实施例提供的流量控制方法应用于流量控制系统中,如图1所示,为本发明实施例的流量控制系统的架构图。如图1,该流量控制系统包括客户端、服务端以及终端。
其中,终端(图中仅示例性的示出一个)可与客户端进行通信,当终端有业务请求时,向业务请求所关联的至少一个客户端申请令牌,以确保业务正常进行。在如图1所示的系统中,将整个系统集群划分为数个子集群,每一子集群包含预设数目的客户端,并将终端的一个业务请求的业务流量关联到预设数目的客户端中,使得每一客户端均分担该业务流量的至少部分流量,实现客户端之间的流量均衡。举例来说,如图1所示系统集群中有3个客户端,将3个客户端组成的集群划分为两个子集群,由其中两个客户端组成一个子集群,该子集群的两个客户端为终端提供服务。
可选的,本发明实施例所涉及到的终端包括各种具有通信功能的手持设备、可穿戴设备、计算设备或连接到无线调制解调器的其它设备;还可以包括蜂窝电话(cellular phone)、智能电话(smart phone)、无线数据卡、个人数字助理(personal digital assistant,PDA)电脑、平板型电脑、手持设备(handheld)、膝上型电脑(laptop computer)、机器类型通信(machine type communication,MTC)终端、用户设备(user equipment,UE),移动台(mobile station,MS),终端设备(terminal device)等。
客户端用于从服务端获取令牌,并在终端有业务需求时,为终端下发一定数目的令牌,以满足终端的业务需求。其中,客户端在每次为终端下发令牌后更新本地剩余的令牌数目。也就是说,客户端本次为终端下发令牌后,本地剩余的令牌数目为下发令牌前本地剩余令牌数目与下发令牌数目的差值。
可选的,本发明实施例中的客户端可以为服务器、电脑等设备,或者与服务器、电脑具 备相似功能的设备。
服务端用于管理至少一个客户端,并向所管理的客户端下发令牌。其中,服务端中设置有令牌桶,并每隔预设时间产生预设数目的令牌,以供客户端申请使用。比如,服务端可以每隔0.1ms产生一个令牌,或者,服务端每隔0.3ms产生3个令牌。服务端间隔多长时间产生令牌以及每次产生令牌的数目可根据实际业务需求设定,本发明实施例对此不进行限制。
其中,图1中给出3个服务端,其中,实线框的服务端为主服务端,虚线框所示的两个服务端为备份服务端。
可选的,本发明实施例中的服务端可以为独立设备,例如为服务器,电脑,或者,还可作为功能模块集成在上述客户端中。
需要说明的是,可按照资源类型为不同资源设置不同数目的令牌,资源可为对象桶、文件系统、数据库等中的资源。如图1所示,示例性的示出主服务端将对象桶中资源的令牌分配给客户端的过程。
以下结合附图对本发明实施例的流量控制方法进行描述。其中,如上文描述,本发明实施例将一个待处理业务的流量关联到预设数目的客户端上,每个客户端分担待处理业务的至少部分流量。以下实施例主要从预设数目的多个客户端中的一个客户端的角度进行描述,在此统一说明,下文不再赘述。
如图2所示,本发明实施例的流量控制方法包括如下步骤:
S201、终端向客户端发送业务请求。
相应的,客户端接收终端发送的业务请求。
其中,所述业务请求用于请求处理待处理业务且指示待处理业务所需的令牌的数目,所述待处理业务所需令牌的数目与所述待处理业务的流量相关联。具体的,待处理业务的流量越大,待处理业务所需的令牌越多,待处理业务的流量越小,待处理业务所需的令牌越少。比如,用户在浏览网页时触发终端向客户端发送业务请求,业务请求指示的待处理业务为大小为100M的数据包,假定每10M数据包所需令牌数目为1,则该100M数据包所需的令牌数目为10。
S202、客户端判断待处理业务所需令牌的数目是否大于本地可用令牌数目,若待处理业务所需令牌的数目小于或等于本地可用令牌数目,则执行S204,若待处理业务所需令牌的数目大于本地可用令牌数目,则执行S203。
其中,客户端本地可用令牌为客户端当前本地剩余的令牌。
通常,令牌被用于控制待处理业务的流量大小,客户端本地可用令牌数目越多,意味着客户端能够接收并处理越多流量,客户端本地可用令牌数目越少,则接收、处理的流量越少。
S203、客户端判断待处理业务所需令牌的数目是否超过本地可透支令牌上限,若待处理业务所需令牌的数目超过(即大于)本地可透支令牌上限,则执行S206,若待处理业务所需令牌的数目不超过(即小于或等于)本地可透支令牌上限,则执行S204。
S204、所述客户端处理所述待处理业务。
作为可能的实现方式,客户端处理所述待处理业务指的是客户端向终端发送客户端所关联的资源。其中,客户端向终端发送资源的方式如下:
方式1:客户端向所述终端发送指示信息以指示所述终端访问所述客户端关联的资源。
在如下两种场景中,客户端按照方式1处理待处理业务:
场景1:客户端本地剩余的令牌数目满足当前业务请求,即待处理业务所需的令牌数目小于或等于客户端本地剩余的令牌数目。
在场景1中,客户端按照方式1处理待处理业务,即客户端向终端发送指示信息,以指示待处理业务申请成功,并向终端反馈需访问且客户端关联的资源。
其中,客户端关联的资源包括对象桶(bucket)、文件块(block)、文件系统(File System,FS)、数据库(Database)。对象桶为用于存储对象的一种存储结构,客户端通过应用程序编程接口(Application Programming Interface,API)来管理对象桶,包括对象桶的读操作、写操作等。文件块可以为分布式存储系统中文件的分块,例如,文件块可以为Hadoop分布式文件系统(Hadoop Distributed File System,HDFS)中的分块。文件系统可以为用于管理和存储数据的软件。数据库可以为按照数据结构来组织、存储和管理数据的仓库。例如,常见数据库包括MySQL、oracle等。数据库中包含至少一个数据表,每一数据表中包含至少一个数据。
当然,随着技术的演进,上述客户端关联的资源还可以为文件系统、对象桶等的演进版本或使用演进技术产生的资源,也可以为其他能够提供访问服务的资源,本发明实施例对此不进行限制。
需要说明的是,上述对象桶、文件块、文件系统、数据库等可位于客户端中,也可以位于其他独立的存储设备上,例如,可以位于HDFS设备上,本发明实施例对此不进行限制。
作为一个场景1的示例,当待处理业务所需令牌数目小于或等于客户端本地剩余的令牌数目时,客户端向终端发送用于指示待处理业务申请成功的指示信息,并向终端反馈数据库1中数据表1的数据。
场景2:客户端本地剩余的令牌数目不足以支持当前业务请求,并且待处理业务所需令牌数目不超过客户端本地可透支令牌上限。
在场景2中,客户端按照上述方式1处理待处理业务。比如,在一个时间段内需要100个令牌来支持终端进行网页浏览业务,客户端中有60个可用令牌,不足以支持当前的网页浏览业务,而客户端本地可透支令牌上限(110)大于当前待处理业务所需的令牌数目(100),客户端向终端发送用于指示网页浏览业务申请成功的指示信息,并向终端发送网页内容,从而用户通过终端浏览器可浏览网页内容。
方式2:客户端直接指示所述终端访问所述客户端关联的资源。
方式2与方式1的不同之处在于,方式2中,客户端不再向终端发送指示信息,而是直接向终端发送所关联的资源,可以节约部分链路资源,减缓链路中数据包拥塞的概率。
同样的,在场景1和场景2中,客户端均可按照方式2处理待处理业务。在场景1和场景2中按照方式2处理待处理业务的具体流程可参见在场景1、场景2中按照方式1处理待处理业务的流程,这里不再赘述。
S205、当预设条件触发时,客户端向服务端申请多个令牌。
其中,预设条件可以包括如下两种:
1、预设条件为预设周期,即客户端每隔预设周期向服务端申请令牌。预设周期可根据实际应用情况设定,本发明实施例对此不进行限制。比如,预设周期可以为10ms,客户端每隔10ms向服务端申请一次令牌。
由于客户端周期性的向服务端申请令牌,可以看出,S205以在S201至S204或S206之前、之后、或者同时进行,本发明实施例不对S205执行时机进行限制。
可选的,在客户端本地剩余令牌不足以支持当前业务请求且当前待处理业务所需令牌数目小于或等于客户端本地可透支令牌上限的情况下,先执行S205,即客户端向服务端申请令牌,并判断服务端中是否存在可分配令牌,若服务端中存在可分配令牌,则客户端从服务端中获取一定数目的令牌,并执行S204,处理待处理业务。
若服务端中不存在可分配令牌,则客户端丢弃或缓存待处理业务。或者,若服务端中不存在可分配令牌,则客户端启动定时器,若时器超之前,服务端中新产生可分配令牌,则客户端从服务端获取令牌并处理待处理业务,若直至定时器超时,服务端中始终不存在可分配令牌,则客户端丢弃或缓存待处理业务。
也就是说,在客户端的本地可用令牌不足以支持当前的业务请求的情况下,只有当客户端确定服务端中当前或者在定时器超时时段内存在足够的令牌时,才处理待处理业务。其中,定时器超时时间可根据业务需求设定,对时延较为敏感的业务,定时器超时时间可设置一个较小的数值,对于时延要求不高的业务,定时器超时时间可设置一个较大的数值。
可选的,在客户端本地剩余令牌不足以支持当前业务请求且当前待处理业务所需令牌数目小于或等于客户端本地可透支令牌上限的情况下,先执行S204,再执行S205,也就是客户端先处理待处理业务,再向服务端申请令牌以补足透支的令牌,可降低业务时延。
可以理解的是,客户端每次向服务端申请的令牌数目可根据实际应用场景确定,并且客户端每次向服务端申请令牌后,更新本地可用令牌的数目,更新后的令牌用于支持终端的业务请求。
2、预设条件为客户端本地可用令牌数目不足以支持当前的业务请求。
可选的,客户端向服务端申请的多个令牌的数目大于或等于亏欠差值,亏欠差值为所述待处理业务所需令牌的数目与所述本地可用令牌的数目的差值。这样一来,客户端所申请令牌不仅可以补充因之前业务请求或本次业务请求透支的令牌,多余的令牌还可用于支持该终端的下次业务请求或者支持其他终端的业务请求。
比如,在一个时间段内需要100个令牌来支持终端进行网页浏览业务,客户端中有60个可用令牌,不足以支持当前的网页浏览业务,客户端本地可透支令牌上限(110)大于网页浏览业务所需的令牌数目,此时触发客户端向服务端申请N个令牌,这N个令牌中的40个令牌用于补足客户端所透支的40(即所需令牌与本地可用令牌的差值)个令牌,N个令牌中的N-40个令牌可以用于响应并支持其他终端的业务请求。
如此,在客户端本地可用令牌数目较少时,不必等待下一个预设周期的到来,而是可以直接向服务端申请令牌,降低申请令牌的时延。
可选的,除了上述预先设定客户端每次向服务端申请的令牌数目,还可以根据当前业务请求确定客户端申请的令牌数目。具体的,客户端申请的令牌数目与所述待处理业务所需的令牌、所述服务端中的可分配令牌、用于分担所述待处理业务的客户端的预设数目、客户端的历史申请令牌数目以及用于分担所述待处理业务的多个客户端总的流量上限相关联。可选的,客户端申请的令牌数目可用如下公式表示:
公式(1):
allocToken=r*TokenAdv+(1-r)*TokenDem
其中,公式(1)中的TokenAdv、TokenDem可分别用公式(2)和公式(3)表示:
公式(2):
TokenAdv=Min[2*requireToken,Max(requireToken,ceiling(remainToken/NodeNum))]
公式(3):
TokenDem=(QosClientDemand/MaxLimit)*remainToken
allocToken为一个客户端向服务端申请的令牌数目,也可视为服务端向一个客户端分配的令牌数目,TokenAdv为按照预设算法得到的服务端向该客户端分配的令牌数目,TokenDem为按照业务需求得到的服务端向该客户端分配的令牌数目,r为大于或等于0的权重因子,requireToken为一个待处理业务所需的令牌数目,其为正整数,Min为求取最小值的函数,Max为求取最大值的函数,ceiling为向上取整函数,remainToken为服务端的令牌桶中剩余的令牌数目,其为大于或等于0的整数,NodeNum为用于分担该待处理业务流量的客户端数目,其为大于0的整数,QosClientDemand为根据经验值或者统计信息得到的该客户端的历史申请令牌数目,其为正整数,MaxLimit为用于分担该待处理业务流量的多个客户端总的流量上限,其为正数。流量上限指的是期待客户端所接收流量的上限。比如,由于该客户端的能力有限,设置该客户端的流量上限为100M,但是,由于通信网络通常需承载高流量,并且可能存在突发流量的情况。因此,虽然期待的客户端流量上限为100M,但是,为了提升终端业务的接入成功率,在业务流量稍大于客户端流量上限时,客户端接收并处理的业务流量可超过100M,也就是说客户端可为终端透支一定数目的令牌。
S206、客户端丢弃待处理业务,或者客户端缓存待处理业务。
可以理解的是,当待处理业务所需令牌数目大于客户端本地可用令牌数目,说明客户端本地剩余令牌不足以支持待处理业务,此时,若客户端经判断确定待处理业务所需令牌数目大于客户端本地可透支令牌上限,则为了维持系统的性能,客户端限制待处理业务的流量。其中,客户端限制待处理业务流量的方式包括如下两种:
方式1:丢弃待处理业务。
可选的,客户端向终端发送第一消息,以指示终端待处理业务申请失败。并且,客户端丢弃待处理业务。这里,客户端可以先向终端发送第一消息,再丢弃待处理业务,使得用户尽快得知待处理业务申请失败。客户端还可以先丢弃待处理业务,再向终端发送第一消息。本发明实施例发送第一消息和丢弃待处理业务这两个步骤的执行顺序不做限制。
方式2:客户端缓存待处理业务。
可选的,客户端向终端发送第二消息,以指示终端待处理业务的状态为待处理状态。并且,客户端缓存待处理业务。类似的,本发明实施例对发送第二消息和缓存待处理业务这两个步骤的执行顺序不做限制。
具体的,客户端包含缓存结构,例如缓存队列和缓存栈等。客户端可在待处理业务流量较高时将待处理业务入栈、入队列。
后续,随着客户端接收的待处理业务的增加,客户端的缓存结构中可能会保存有多个待处理业务。在本申请的一些实施例中,客户端向所述服务端发送查询请求,以查询服务端中的令牌数目。当获知所述服务端中存在可分配令牌且所述可分配令牌的数目大于或等于所述所缓存待处理业务所需令牌的数目与本地可用令牌的数目的差值,所述客户端向所述服务端申请令牌,并处理所缓存的待处理业务。
可选的,客户端为多个待处理业务设置优先级,并优先处理高优先级的待处理业务。比如,客户端缓存有3个待处理业务,按照优先级由高到低依次为待处理业务2、待处理业务1、待处理业务3。客户端周期性的向服务端申请令牌,当某次申请令牌后客户端中的令牌数据足够支持待处理业务2时,客户端处理待处理业务2。之后,当某次申请令牌后客户端中的令牌足够支持待处理业务1时,客户端处理待处理业务1。类似的, 客户端可处理待处理业务3。
或者,客户端也可优先处理所需令牌数目较少的待处理业务。举例来说,待处理业务1所需令牌数目为20、待处理业务2所需令牌数目为50、待处理业务1所需令牌数目为200。在某次向服务端申请令牌后客户端中更新的令牌数目为100,客户端优先处理待处理业务1,之后,若客户端中仍存在剩余的足够令牌,客户端处理待处理业务2,类似的,客户端处理待处理业务3。
当然,客户端也可以根据待处理业务的优先级和所需令牌数目两个指标确定各个待处理业务的处理顺序。另外,客户端还可以根据其他指标,或者根据实际场景确定待处理业务的处理顺序,本发明实施例对此不进行限制。
与现有技术中节点之间需频繁通信,导致通信链路开销较大相比,本发明实施例的流量控制方法,当存在待处理业务时,若客户端确定待处理业务所需的令牌数目大于本地可用令牌数目且不超过本地可透支令牌上限,则客户端处理待处理业务。并且,当预设条件触发时,客户端向服务端申请多个令牌。其中,客户端可将待处理业务的流量限制在本地可透支令牌能够支持的流量之内,并且,客户端中与流量限制相关的令牌来源于服务端。也就是说,该客户端仅需与服务端进行令牌交互,无需掌握其他客户端的流量数据,降低了客户端间的通信链路开销,从而降低流量控制系统的整体性能开销。
上述主要从流量控制装置工作过程的角度对本发明实施例提供的方案进行了介绍。可以理解的是,流量控制装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本发明实施例可以根据上述方法示例对流量控制装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图3示出了上述实施例中所涉及的流量控制装置的一种可能的结构示意图。流量控制装置300可以包括:接收模块301、处理模块302、申请模块303以及发送模块304。接收模块301用于支持流量控制装置300执行图2中的过程S201。作为另一种实现方式,当流量控制装置中设置有收发器时,可由流量控制装置中的收发器来执行S201。处理模块302用于支持流量控制装置300执行图2中的过程S202、S203、S204、S206。作为另一种实现方式,当流量控制装置中设置有处理器时,可由流量控制装置中的处理器执行图2中的过程S202、S203、S204、S206。申请模块303用于支持流量控制装置300执行图2中的过程S205。作为另一种实现方式,当流量控制装置中设置有处理器时,可由流量控制装置中的处理器执行图2中的过程S205。发送模块304用于支持流量控制装置向服务端发送查询请求,以获知服务端中的令牌数目。作为另一种实现方式,当流量控制装置中设置有收发器时,可由流量控制装置中的收发器向服务端发送查询请求。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能 描述,在此不再赘述。
本发明实施例尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (12)
- 一种流量控制方法,其特征在于,包括:客户端接收终端发送的业务请求,所述业务请求用于指示待处理业务所需的令牌的数目,所述待处理业务所需令牌的数目与所述待处理业务的流量相关联;确定所述待处理业务所需的令牌的数目大于本地可用令牌的数目且所述待处理业务所需令牌的数目不超过本地可透支令牌上限时,所述客户端处理所述待处理业务;当预设条件触发时,向服务端申请多个令牌,所述申请的多个令牌用于补充被所述待处理业务透支的令牌。
- 根据权利要求1所述的流量控制方法,其特征在于,所述客户端处理所述待处理业务,包括:所述客户端向所述终端发送指示信息以指示所述终端访问所述客户端关联的资源。
- 根据权利要求2所述的流量控制方法,其特征在于,所述客户端关联的资源包括对象桶、文件块、文件系统、数据库。
- 根据权利要求1所述的流量控制方法,其特征在于,所述客户端向所述服务端申请的多个令牌的数目大于或等于亏欠差值,所述亏欠差值为所述待处理业务所需令牌的数目与所述本地可用令牌的数目的差值。
- 根据权利要求1至4任意一项所述的流量控制方法,其特征在于,所述客户端包括缓存,所述缓存中保存有其他待处理业务,所述方法还包括:所述客户端向所述服务端发送查询请求以获知所述服务端中存在可分配令牌且所述可分配令牌的数目大于或等于所述其他待处理业务所需令牌的数目与本地可用令牌的数目的差值,则所述客户端向所述服务端申请令牌。
- 一种流量控制装置,其特征在于,所述装置包括:接收模块,用于接收终端发送的业务请求,所述业务请求用于指示待处理业务所需的令牌的数目,所述待处理业务所需令牌的数目与所述待处理业务的流量相关联;处理模块,用于确定所述待处理业务所需的令牌的数目大于本地可用令牌的数目且所述待处理业务所需令牌的数目不超过本地可透支令牌上限时,处理所述待处理业务;申请模块,用于当预设条件触发时,向服务端申请多个令牌,所述申请的多个令牌用于补充被所述待处理业务透支的令牌。
- 根据权利要求6所述的流量控制装置,其特征在于,所述处理模块用于处理所述待处理业务,包括:用于向所述终端发送指示信息以指示所述终端访问所述装置关联的资源。
- 根据权利要求7所述的流量控制装置,其特征在于,所述装置关联的资源包括对象桶、文件块、文件系统、数据库。
- 根据权利要求6所述的流量控制装置,其特征在于,所述装置向所述服务端申请的多个令牌的数目大于或等于亏欠差值,所述亏欠差值为所述待处理业务所需令牌的数目与所述本地可用令牌的数目的差值。
- 根据权利要求6至9任意一项所述的流量控制装置,其特征在于,所述装置还包括缓存、发送模块,所述缓存中保存有其他待处理业务;所述发送模块,用于向所述服务端发送查询请求以获知所述服务端中存在可分配令牌且所述可分配令牌的数目大于或等于所述其他待处理业务所需令牌的数目与本地可用令牌的数目的差值;所述申请模块,还用于根据所述发送模块的查询结果向所述服务端申请令牌。
- 一种电路系统,其特征在于,所述电路系统包括处理电路,所述处理电路被配置为执行如权利要求1至5任意一项所述的流量控制方法。
- 一种可读存储介质,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1至5所述的流量控制方法被实现。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810852104.3 | 2018-07-27 | ||
CN201810852104.3A CN110768913A (zh) | 2018-07-27 | 2018-07-27 | 流量控制方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020019743A1 true WO2020019743A1 (zh) | 2020-01-30 |
Family
ID=69182127
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/079388 WO2020019743A1 (zh) | 2018-07-27 | 2019-03-23 | 流量控制方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110768913A (zh) |
WO (1) | WO2020019743A1 (zh) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111858046A (zh) * | 2020-07-13 | 2020-10-30 | 海尔优家智能科技(北京)有限公司 | 服务请求的处理方法及装置、存储介质、电子装置 |
CN113489657A (zh) * | 2021-06-29 | 2021-10-08 | 中国银联股份有限公司 | 一种分布式流速控制系统及其运行方法 |
CN115174485A (zh) * | 2022-05-27 | 2022-10-11 | 中国经济信息社有限公司 | 播放控制管理方法和系统、设备及存储介质 |
CN115190078A (zh) * | 2022-06-28 | 2022-10-14 | 上海砾阳软件有限公司 | 一种访问流量控制方法、装置、设备以及存储介质 |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111309397B (zh) * | 2020-02-17 | 2024-01-09 | 北京达佳互联信息技术有限公司 | 数据分配方法、装置、服务器及存储介质 |
CN113067778B (zh) * | 2021-06-04 | 2021-09-17 | 新华三半导体技术有限公司 | 一种流量管理方法及流量管理芯片 |
CN115118671B (zh) * | 2022-05-30 | 2024-01-26 | 中国信息通信研究院 | 用于令牌环调度的方法及装置、电子设备、存储介质 |
CN115242722B (zh) * | 2022-06-14 | 2024-04-16 | 中盈优创资讯科技有限公司 | 一种基于api网关的高级流控实现方法 |
CN115442432B (zh) * | 2022-09-06 | 2024-06-07 | 上海浦东发展银行股份有限公司 | 一种控制方法、装置、设备及存储介质 |
CN115733805A (zh) * | 2022-10-27 | 2023-03-03 | 天地伟业技术有限公司 | 网络服务限速方法及电子设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1835447A (zh) * | 2005-03-16 | 2006-09-20 | 华为技术有限公司 | 一种数据流量约束控制的实现方法 |
CN101272346A (zh) * | 2008-04-29 | 2008-09-24 | 华为技术有限公司 | 一种对报文进行流量监管的方法和装置 |
US20110075558A1 (en) * | 2009-09-25 | 2011-03-31 | Telefonaktiebolaget Lm Ericsson (Publ) | Rate shaping triggered discontinuous transmission in wireless communications |
CN106713168A (zh) * | 2016-12-21 | 2017-05-24 | 上海艾融软件股份有限公司 | 一种流量控制方法及系统 |
CN106953812A (zh) * | 2016-01-07 | 2017-07-14 | 中兴通讯股份有限公司 | 一种数据报文传输控制方法和装置 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9055078B2 (en) * | 2013-01-10 | 2015-06-09 | International Business Machines Corporation | Token-based flow control of messages in a parallel computer |
-
2018
- 2018-07-27 CN CN201810852104.3A patent/CN110768913A/zh active Pending
-
2019
- 2019-03-23 WO PCT/CN2019/079388 patent/WO2020019743A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1835447A (zh) * | 2005-03-16 | 2006-09-20 | 华为技术有限公司 | 一种数据流量约束控制的实现方法 |
CN101272346A (zh) * | 2008-04-29 | 2008-09-24 | 华为技术有限公司 | 一种对报文进行流量监管的方法和装置 |
US20110075558A1 (en) * | 2009-09-25 | 2011-03-31 | Telefonaktiebolaget Lm Ericsson (Publ) | Rate shaping triggered discontinuous transmission in wireless communications |
CN106953812A (zh) * | 2016-01-07 | 2017-07-14 | 中兴通讯股份有限公司 | 一种数据报文传输控制方法和装置 |
CN106713168A (zh) * | 2016-12-21 | 2017-05-24 | 上海艾融软件股份有限公司 | 一种流量控制方法及系统 |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111858046A (zh) * | 2020-07-13 | 2020-10-30 | 海尔优家智能科技(北京)有限公司 | 服务请求的处理方法及装置、存储介质、电子装置 |
CN111858046B (zh) * | 2020-07-13 | 2024-05-24 | 海尔优家智能科技(北京)有限公司 | 服务请求的处理方法及装置、存储介质、电子装置 |
CN113489657A (zh) * | 2021-06-29 | 2021-10-08 | 中国银联股份有限公司 | 一种分布式流速控制系统及其运行方法 |
CN113489657B (zh) * | 2021-06-29 | 2022-09-09 | 中国银联股份有限公司 | 一种分布式流速控制系统及其运行方法 |
CN115174485A (zh) * | 2022-05-27 | 2022-10-11 | 中国经济信息社有限公司 | 播放控制管理方法和系统、设备及存储介质 |
CN115190078A (zh) * | 2022-06-28 | 2022-10-14 | 上海砾阳软件有限公司 | 一种访问流量控制方法、装置、设备以及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN110768913A (zh) | 2020-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020019743A1 (zh) | 流量控制方法及装置 | |
US10169060B1 (en) | Optimization of packet processing by delaying a processor from entering an idle state | |
CN109697122B (zh) | 任务处理方法、设备及计算机存储介质 | |
CN110602156A (zh) | 一种负载均衡调度方法及装置 | |
WO2019072162A1 (zh) | 虚拟网络映射方法、设备和存储介质 | |
WO2014022395A1 (en) | Priority driven channel allocation for packet transferring | |
CN110460534B (zh) | 一种请求消息上报方法、装置、设备及存储介质 | |
WO2024016596A1 (zh) | 容器集群调度的方法、装置、设备及存储介质 | |
KR20200017589A (ko) | 무선 통신 시스템에서 모바일 노드의 태스크를 오프로딩하기 위한 클라우드 서버 및 그의 동작 방법 | |
WO2019153702A1 (zh) | 一种中断处理方法、装置及服务器 | |
US8539089B2 (en) | System and method for vertical perimeter protection | |
Chen et al. | Latency minimization for mobile edge computing networks | |
US11316916B2 (en) | Packet processing method, related device, and computer storage medium | |
CN110727738B (zh) | 基于数据分片的全局路由系统、电子设备及存储介质 | |
CN118295937A (zh) | 用于网络接口卡的细粒度业务整形分流 | |
CN111857992A (zh) | 一种Radosgw模块中线程资源分配方法和装置 | |
CN112600761A (zh) | 一种资源分配的方法、装置及存储介质 | |
CN112799811B (zh) | 一种边缘网关的高并发线程池任务调度方法 | |
CN111131081B (zh) | 一种支持多进程的高性能单向传输的方法和装置 | |
CN113626221A (zh) | 一种消息入队方法及装置 | |
CN112148474A (zh) | 面向负载均衡的龙芯大数据一体机自适应任务分割方法及系统 | |
WO2017070869A1 (zh) | 一种内存配置方法、装置及系统 | |
CN114253733B (zh) | 一种内存管理方法、装置、计算机设备和存储介质 | |
US20190044872A1 (en) | Technologies for targeted flow control recovery | |
Han et al. | Multi-Tenancy-and Redundancy-Aware In-Network Aggregation using Programmable Switches |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19840474 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19840474 Country of ref document: EP Kind code of ref document: A1 |