Flow control method and device, equipment, storage medium and program product

The flow control method using dual token buckets addresses DPU-related performance and stability issues in cloud networks by prioritizing business messages, ensuring efficient and stable network operation.

CN119094456APending Publication Date: 2024-12-06DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411365373.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The integration of DPU in cloud networks leads to performance and stability issues due to simultaneous detection and business message traffic, causing interference and affecting network efficiency.

Method used

A flow control method utilizing dual token buckets, specifically a service token bucket and a shared token bucket, to manage and prioritize different types of network messages based on their types, ensuring stable transmission by comparing token counts with message lengths and performing flow control accordingly.

Benefits of technology

The method ensures stable transmission of business messages by prioritizing them over detection messages, maintaining network performance and stability by preventing interference between different types of network traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094456A_ABST
    Figure CN119094456A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of networks, and discloses a flow control method and device, equipment, a storage medium and a program product, and the method comprises the steps: obtaining a target message and the type of the target message; determining a corresponding target token bucket based on the type of the target message, wherein the target token bucket comprises at least one of a service token bucket and a shared token bucket; comparing the number of tokens in the target token bucket with the length of the target message to obtain a comparison result; and performing flow control on the target message based on the comparison result and the target token bucket. The target token buckets corresponding to the different types of target messages are set, the length of the target message is conveniently compared with the number of tokens in the target token buckets, so that whether flow control is performed on the target message based on the target token buckets or not is determined, the flow of each type of target message can be ensured, the priority of the target message can be set, and the flow control efficiency of the target message is improved. And the traffic of the specific target message is not influenced by other types of messages, so that the stability of the network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network technology, and in particular to a flow control method, device, equipment, storage medium and program product. Background Art

[0002] Cloud network is an efficient, flexible and secure network infrastructure. It uses virtualization technology to dynamically allocate and expand network resources, and meets the changing needs of users through sharing and elastic characteristics. At the same time, cloud network also inherits the advantages of cloud computing, such as self-service and on-demand supply, providing users with more convenient and efficient services, and plays an important role in the development of cloud computing. DPU (Data Processing Unit) is a processor dedicated to data processing, focusing on data processing to achieve more efficient data processing and computing. The introduction of DPU can significantly improve the performance of cloud network and meet the growing business needs. By real-time detection of network traffic, network performance bottlenecks can be accurately identified to ensure the stable operation of the network. As the core component of the network, the performance status of DPU directly affects the overall performance of the network. Therefore, real-time detection of DPU is the key to ensure high-performance operation of the network. When business messages and detection messages query consumption tokens at the same time, detection traffic may affect business traffic, causing a series of performance and stability problems. Summary of the invention

[0003] In view of this, the present disclosure provides a flow control method, apparatus, device, storage medium and program product to ensure the stability of business flow.

[0004] In a first aspect, the present disclosure provides a flow control method, the method comprising:

[0005] Obtaining a target message and the type of the target message;

[0006] Determine a corresponding target token bucket based on the type of the target message, wherein the target token bucket includes at least one of a service token bucket and a shared token bucket;

[0007] Compare the number of tokens in the target token bucket with the length of the target message to obtain a comparison result;

[0008] The target message is subjected to flow control based on the comparison result and the target token bucket.

[0009] In a second aspect, the present disclosure provides a flow control device, the device comprising:

[0010] A message acquisition module, used to acquire a target message and the type of the target message;

[0011] A token bucket determination module, configured to determine a corresponding target token bucket based on the type of the target message, wherein the target token bucket includes at least one of a service token bucket and a shared token bucket;

[0012] A length comparison module, used for comparing the number of tokens in the target token bucket with the length of the target message to obtain a comparison result;

[0013] A flow control module is used to perform flow control on the target message based on the comparison result and the target token bucket.

[0014] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0015] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0016] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0017] The flow control method provided by the present disclosure first determines the type corresponding to the target message after obtaining the target message, determines the corresponding target token bucket according to the type of the target message, compares the number of tokens in the target token bucket with the length of the target message, obtains a comparison result, and performs flow control on the target message based on the comparison result and the target token bucket. Setting target token buckets corresponding to different types of target messages facilitates comparing the length of the target message with the number of tokens in the target token bucket based on the type of the target message, thereby determining whether to perform flow control on the target message based on the target token bucket, which can ensure the flow of target messages of various types, and can also set the priority of the target message to ensure that the flow of a specific target message is not affected by messages of other types, thereby improving the stability of the network. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 is a diagram of a DPU network processing architecture according to an embodiment of the present disclosure;

[0020] Figure 2 is a flow chart of a flow control method according to an embodiment of the present disclosure;

[0021] Figure 3 is a flow chart of another flow control method according to an embodiment of the present disclosure;

[0022] Figure 4 is a schematic diagram of a process for producing tokens according to an embodiment of the present disclosure;

[0023] Figure 5 is a schematic diagram of a process of consuming tokens according to an embodiment of the present disclosure;

[0024] Figure 6 is a structural block diagram of a flow control device according to an embodiment of the present disclosure;

[0025] Figure 7 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0027] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.

[0028] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.

[0029] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0030] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.

[0031] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.

[0032] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.

[0033] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0034] As the core component of the network, the performance of the DPU directly affects the overall performance of the network. Therefore, real-time detection of the DPU is the key to ensuring high-performance operation of the network. Figure 1 As shown in the DPU network processing architecture diagram, if the host Virtio (an I / O semi-virtualization solution) DMA (Direct Memory Access) sends out 200G of traffic, these flows will go through the flow table matching query table items during the forwarding process, that is, flow processing (a way to process asynchronous data streams). The flow table is a data structure used in network devices (such as switches and routers) to determine the data packet forwarding path. According to the rules in the flow table, the data packets will be classified and assigned different processing strategies. During the flow table matching process, the system will copy specific messages as detection traffic as needed. These detection traffic messages are used to collect information such as network status and performance data for network detection and management. All messages (including business traffic messages and detection traffic messages) need to be processed by the QoS (Quality of Service) module. The QoS module is responsible for ensuring that the traffic in the network is transmitted according to the predetermined priority and quality. The present disclosure adopts a dual token bucket strategy to ensure the transmission of business traffic.

[0035] According to an embodiment of the present disclosure, a flow control method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] In this embodiment, a flow control method is provided. Figure 2 is a flow chart of a flow control method according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:

[0037] Step S101, obtaining a target message and the type of the target message.

[0038] When a network device receives messages from the network, these messages will first be received by the network device and prepared for QoS processing, according to different types of messages transmitted by different link types, where network devices can include switches, routers, DMA and other devices. The target message refers to the message entering the QoS module, and the specific field in the message can indicate the type of the message, and the type of the message is identified according to the specific field of the message.

[0039] Step S102: determining a corresponding target token bucket based on the type of the target message.

[0040] The types of target messages can include business messages, detection messages, etc. Business messages refer to the data traffic generated by the operation of various application systems in the network. These traffic may come from various sources such as OA systems, server access, and user online activities. Business traffic is the actual traffic during terminal use, which reflects the network users' demand for and use of network services. Detection messages refer to the traffic data generated during the network detection process. These traffic are mainly used for the operation and data transmission of the network detection system to support real-time detection and management of network status, performance, security, etc.

[0041] In this embodiment, different types of target messages can consume tokens in different token buckets. Each target message has its corresponding target token bucket. A specific type of target message can correspond to one or more target token buckets, and the target token bucket includes at least one of a business token bucket and a shared token bucket.

[0042] Step S103, comparing the number of tokens in the target token bucket with the length of the target message to obtain a comparison result.

[0043] After determining the target token bucket corresponding to the target message, count the number of tokens in the target token bucket corresponding to the target message, use the number of tokens in the target token bucket as the number threshold, and compare the length of the target message with the number threshold, so as to facilitate subsequent flow control. There may be a situation where the target message corresponds to more than one target token bucket. For this, the sum of the number of tokens in all corresponding target token buckets can be calculated, and the sum of the number of tokens can be used as the number threshold to compare with the length of the target message.

[0044] Step S104: performing flow control on the target message based on the comparison result and the target token bucket.

[0045] After the comparison result is obtained, the token is consumed from the target token bucket according to the comparison result. Specifically, when the comparison result meets a certain preset condition, the token is consumed from the target token bucket, thereby performing flow control. When the target message corresponds to multiple target token buckets, priorities can be set for the multiple target token buckets, and tokens are consumed from the target token bucket with a high priority. If the number of tokens in the target token bucket with a high priority is insufficient or the consumption condition is not met, tokens are consumed from other target token buckets. When the target message has only one corresponding target token bucket, tokens are consumed from the target token bucket. Before consuming tokens, the number of tokens in the target token bucket can also be counted to determine whether the conditions for consuming tokens are met. If the conditions are met, tokens are consumed, thereby performing flow control on the corresponding target message.

[0046] The flow control method provided in this embodiment, after obtaining the target message, first determines the type corresponding to the target message, determines the corresponding target token bucket according to the type of the target message, compares the number of tokens in the target token bucket with the length of the target message, obtains a comparison result, and performs flow control on the target message based on the comparison result and the target token bucket. Setting target token buckets corresponding to different types of target messages facilitates comparing the length of the target message with the number of tokens in the target token bucket based on the type of the target message, thereby determining whether to perform flow control on the target message based on the target token bucket, which can ensure the flow of each type of target message, and can also set the priority of the target message to ensure that the flow of a specific target message is not affected by messages of other types, thereby improving the stability of the network.

[0047] In this embodiment, a flow control method is provided. Figure 3 is a flow chart of a flow control method according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes the following steps:

[0048] Step S201, obtain the target message and the type of the target message. Figure 2 Step S101 of the illustrated embodiment will not be described in detail here.

[0049] Step S202: determine the corresponding target token bucket based on the type of the target message.

[0050] Specifically, the above step S202 includes:

[0051] Step S2021: If the type of the target message is a service message, the target token bucket includes a service token bucket and a shared token bucket;

[0052] Step S2022: If the type of the target message is a non-service message, the target token bucket includes a shared token bucket.

[0053] In this embodiment, the target messages are classified, and the types may include business messages and non-business messages, and non-business messages may include detection messages. Business messages refer to the data traffic generated by the operation of various application systems in the network. These traffic may come from various sources such as server access and user online activities. Business traffic is the actual traffic during the use of the terminal, which reflects the network users' demand for and use of network services. Detection messages refer to the traffic data generated during the network detection process. These traffic are mainly used for the operation and data transmission of the network detection system to support real-time detection and management of network status, performance, security, etc.

[0054] If the type of the target message is a business message, the target token bucket corresponding to the business message is set to include a business token bucket and a shared token bucket; if the type of the target message is a non-business message, the target token bucket corresponding to the non-business message is set to include a shared token bucket. Specifically, in this embodiment, a dual token bucket algorithm is adopted, including a business token bucket and a shared token bucket. Among them, the business token bucket is a token bucket mechanism specific to a certain business or application, and its parameters can be set for a specific business, and the traffic characteristics of the business can be finely controlled. It is suitable for scenarios where each business message needs to be independently controlled and managed. A shared token bucket allows multiple businesses or applications to share the same token bucket, allowing tokens to be dynamically allocated and shared between multiple types of messages.

[0055] Step S203, compare the number of tokens in the target token bucket with the length of the target message to obtain a comparison result. Figure 2 Step S103 of the illustrated embodiment will not be described in detail here.

[0056] Step S204: flow control is performed on the target message based on the comparison result and the target token bucket. Figure 2 Step S104 of the illustrated embodiment will not be described in detail here.

[0057] The flow control method provided in this embodiment sets the target token bucket of the business message to include the business token bucket and the shared token bucket, and the target token bucket of the non-business message to include the shared token bucket. The non-business message cannot consume tokens from the business token bucket, which can guarantee the bandwidth of the business message to a certain extent.

[0058] In some optional implementations, if the type of the target message is a service message, the above step S104 includes the following steps:

[0059] S301: If the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket, the priority of each target token bucket corresponding to the service message is obtained.

[0060] When the type of the target message is a business message, its corresponding target token bucket includes a business token bucket and a shared token bucket, and the number of tokens in the target token bucket is the sum of the number of tokens in the business token bucket and the shared token bucket. When the comparison result indicates that the length of the target message is less than the sum of the number of tokens in the business token bucket and the shared token bucket, it means that tokens can be consumed from the target token bucket. Since when the type of the target message is a business message, there is more than one corresponding target token bucket, and the priority of each token bucket needs to be considered when consuming tokens. The priority of each token bucket can be set according to the actual application.

[0061] If the comparison result indicates that the length of the target message is greater than or equal to the number of tokens in the target token bucket, the target message is not processed. The message is discarded, re-queued or marked according to the actual application scenario, without specific limitation.

[0062] In some optional implementations, the priority of the shared token bucket is higher than that of the service token bucket.

[0063] S302: Determine a target token bucket for flow control based on the priorities of the token buckets corresponding to the service messages.

[0064] The target token bucket for flow control is determined in descending order of priority. The number of tokens in the high-priority token bucket is first counted to determine whether the token bucket is available. If it is not available, the low-priority token bucket is used.

[0065] Specifically, the above step S302 includes the following steps:

[0066] Step S3021, checking whether the number of tokens in the shared token bucket is not less than the length of the service message.

[0067] Since the priority of the shared token bucket is higher than that of the service token bucket, it is first checked whether the number of tokens in the shared token bucket is not less than the length of the service message, so as to determine whether the tokens in the shared token bucket are sufficient.

[0068] Step S3022: If the number of tokens in the shared token bucket is not less than the length of the service message, the target token bucket is determined to be a shared token bucket.

[0069] When the number of tokens in the shared token bucket is not less than the length of the service message, it means that the number of tokens in the shared token bucket is sufficient, and the target token bucket is determined as the shared token bucket.

[0070] Step S3023: If the number of tokens in the shared token bucket is less than the length of the service message, the target token bucket is determined to be the service token bucket.

[0071] When the number of tokens in the shared token bucket is less than the length of the service message, it means that the number of tokens in the shared token bucket is insufficient, and tokens are consumed from the service token bucket, and the target token bucket is determined as the service token bucket.

[0072] S303: Perform flow control on the target message based on the target token bucket.

[0073] After determining the target token bucket, the consumption token is queried from the target token bucket to control the flow of the target message. If the number of tokens in the target token bucket is insufficient, the target message is not processed. Depending on the actual application scenario, the message is discarded, re-queued, or marked, etc., without specific restrictions.

[0074] In this embodiment, when the type of the target message is a business message, and when the length of the target message is less than the number of tokens in the target token bucket, the priority of each target token bucket corresponding to the business message is obtained, thereby determining the target token bucket for flow control. The priority of the shared token bucket is higher than that of the business token bucket. First, it is detected whether the number of tokens in the shared token bucket is not less than the length of the business message. If the number of tokens in the shared token bucket is not less than the length of the business message, the target token bucket is determined to be a shared token bucket. Otherwise, the target token bucket is determined to be a business token bucket. That is, the business message can consume tokens from the business token bucket and the shared token bucket, and consumes tokens from the shared token bucket first, which guarantees the stability of the business message flow to a certain extent.

[0075] In some optional implementations, if the type of the target message is a non-business message, the above step S104 includes: if the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket, flow control is performed on the target message based on the shared token bucket.

[0076] When the type of the target message is a non-business message, the corresponding target token bucket is a shared token bucket, and the non-business message can be a detection message. After comparison, if the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket, it means that the number of tokens in the shared token bucket is sufficient, and tokens can be consumed from it, thereby performing flow control on the target message.

[0077] In this embodiment, the target token bucket corresponding to the non-business message is set to a shared token bucket. When the length of the target message is less than the number of tokens in the target token bucket, tokens are consumed from the shared token bucket to ensure that the non-business message can only consume the shared token bucket and will not affect the business message, thereby ensuring the stability of the business message transmission.

[0078] In this embodiment, a flow control method is provided, which includes the following steps:

[0079] Step S401, generating a token based on a committed information rate.

[0080] Specifically, the above step S401 includes:

[0081] Step S4011, calculating the token production time interval according to the committed information rate;

[0082] Step S4012, generating a token based on a token generation time interval.

[0083] In this embodiment, two token buckets are designed, one is the business token bucket and the other is the shared token bucket. When the token configuration starts, the token production can begin. First, the committed information rate (CIR) is determined, which is the maximum data transmission rate that the system or interface is willing to provide continuously, indicating the number of bits or bytes transmitted per second. The token production time interval is calculated based on the committed information rate, and the calculation formula is: token production time interval = 1 / CIR. After calculating the token production time interval, tokens are produced according to the time interval, and each token represents a data unit that can be transmitted.

[0084] Step S402: If the number of tokens in the business token bucket is less than a preset number, the produced tokens are stored in the business token bucket.

[0085] The depth of the business token bucket and shared token bucket can be configured according to the actual traffic situation. The preset number refers to the maximum number of tokens that the business token bucket can store. When the number of tokens in the business token bucket is less than the preset number, it means that the business token bucket is not full. After the token is produced, it will be stored in the business token bucket.

[0086] Step S403: If the number of tokens in the service token bucket is equal to the preset number, the produced tokens are stored in the shared token bucket.

[0087] When the number of tokens in the business token bucket is equal to the preset number, it means that the business token bucket is full, and the tokens produced at this time are stored in the shared token bucket.

[0088] The flow control method provided in this embodiment preferentially stores tokens in a service token bucket. If the service token bucket is full, tokens overflow from the service bucket to the shared token bucket.

[0089] In this embodiment, a specific flow control method is provided, which includes two parts: generating tokens and consuming tokens. The process of generating tokens is as follows: Figure 4 As shown, tokens are generated according to the committed information rate, and the tokens are preferentially stored in the business token bucket. When the business token bucket is full, the tokens are stored in the shared token bucket.

[0090] The process of consuming tokens is as follows Figure 5 As shown, taking the case where the target message includes a detection message and a business message as an example, the business type of the target message is first determined. When the business type is a business message, it is further determined whether the sum of the number of tokens in the business token bucket and the shared token bucket (token_b+token_s) is greater than the length of the business message (pkt.len). If the determination result is no, the business message is abandoned; if the determination result is yes, the shared token bucket is consumed first. If the number of tokens in the shared token bucket is less than the length of the business message, the tokens are consumed from the business token bucket. If the number of tokens in the shared token bucket is greater than or equal to the length of the business message, the tokens are consumed from the shared token bucket. When the business type is not a business message, it is determined whether it is a detection message. If the determination result is yes, it is further determined whether the number of tokens in the shared token bucket (token_s) is greater than the length of the detection message (pkt.len). If the determination result is no, the business message is abandoned; if the determination result is yes, the tokens in the shared token bucket are consumed.

[0091] The flow control method provided in this embodiment uses dual token buckets to protect business flow, so that business flow has priority in using bandwidth on the basis of achieving the committed bandwidth, and detection flow will not affect business flow.

[0092] In this embodiment, a flow control device is also provided, which is used to implement the above-mentioned embodiments and implementation methods, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0093] This embodiment provides a flow control device, such as Figure 6 As shown, including:

[0094] The message acquisition module 501 is used to acquire the target message and the type of the target message;

[0095] A token bucket determination module 502, configured to determine a corresponding target token bucket based on the type of the target message, wherein the target token bucket includes at least one of a service token bucket and a shared token bucket;

[0096] The length comparison module 503 is used to compare the number of tokens in the target token bucket with the length of the target message to obtain a comparison result;

[0097] The flow control module 504 is used to perform flow control on the target message based on the comparison result and the target token bucket.

[0098] In some optional implementations, the token bucket determination module 502 includes:

[0099] A first token bucket determining unit, configured to, if the type of the target message is a service message, determine that the target token bucket includes the service token bucket and a shared token bucket;

[0100] The second token bucket determining unit is configured to determine that, if the type of the target message is a non-service message, the target token bucket includes the shared token bucket.

[0101] In some optional implementations, if the type of the target message is a service message, the flow control module 504 includes:

[0102] A priority determination unit, configured to obtain the priority of each target token bucket corresponding to the service message if the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket;

[0103] A service message token bucket determining unit, configured to determine a target token bucket for flow control based on the priorities of the token buckets corresponding to the service messages;

[0104] The first flow control unit is used to perform flow control on the target message based on the target token bucket.

[0105] In some optional implementations, the priority determination unit includes a priority of a shared token bucket being higher than that of the service token bucket.

[0106] In some optional implementations, the service message token bucket determining unit includes:

[0107] A length detection subunit, used to detect whether the number of tokens in the shared token bucket is not less than the length of the service message;

[0108] A shared token bucket determining subunit, configured to determine that the target token bucket is the shared token bucket if the number of tokens in the shared token bucket is not less than the length of the service message;

[0109] The service token bucket determining subunit is used to determine that the target token bucket is the service token bucket if the number of tokens in the shared token bucket is less than the length of the service message.

[0110] In some optional implementations, if the type of the target message is a non-service message, the flow control module 504 includes:

[0111] The non-service message control unit performs flow control on the target message based on the shared token bucket if the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket.

[0112] In some optional embodiments, the device further comprises:

[0113] A token generation module, for generating tokens based on a committed information rate;

[0114] A first storage module, configured to store the produced tokens into the business token bucket if the number of tokens in the business token bucket is less than a preset number;

[0115] The second storage module is used to store the produced tokens into the shared token bucket if the number of tokens in the business token bucket is equal to the preset number.

[0116] In some optional embodiments, the token generation module includes:

[0117] A time interval calculation unit, used for calculating a token production time interval according to a committed information rate;

[0118] The token generation unit is used to generate tokens based on a token generation time interval.

[0119] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0120] The flow control device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0121] The present disclosure also provides a computer device having the above Figure 6 Flow control device shown.

[0122] See also Figure 7 , Figure 7 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0123] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0124] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0125] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0127] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0128] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0129] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0130] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A flow control method, It is characterized in that The method comprises: Obtaining a target message and the type of the target message; Determine a corresponding target token bucket based on the type of the target message, wherein the target token bucket includes at least one of a service token bucket and a shared token bucket; Compare the number of tokens in the target token bucket with the length of the target message to obtain a comparison result; The target message is subjected to flow control based on the comparison result and the target token bucket.

2. The method according to claim 1, It is characterized in that The determining a corresponding target token bucket based on the type of the target message includes: If the type of the target message is a service message, the target token bucket includes the service token bucket and a shared token bucket; If the type of the target message is a non-service message, the target token bucket includes the shared token bucket.

3. The method according to claim 1, It is characterized in that If the type of the target message is a service message, the flow control of the target message based on the comparison result and the target token bucket includes: If the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket, obtaining the priority of each target token bucket corresponding to the service message; Determining a target token bucket for flow control based on the priority of each token bucket corresponding to the service message; The target message is subjected to flow control based on the target token bucket.

4. The method according to claim 3, It is characterized in that The priority of the shared token bucket is higher than that of the service token bucket.

5. The method according to claim 4, It is characterized in that The determining, based on the priority of each token bucket corresponding to the service message, a target token bucket for flow control, comprises: Detecting whether the number of tokens in the shared token bucket is not less than the length of the service message; If the number of tokens in the shared token bucket is not less than the length of the service message, determining that the target token bucket is the shared token bucket; If the number of tokens in the shared token bucket is less than the length of the service message, the target token bucket is determined to be the service token bucket.

6. The method according to claim 1, It is characterized in that If the type of the target message is a non-business message, the flow control of the target message based on the comparison result and the token bucket includes: If the comparison result indicates that the length of the target message is less than the number of tokens in the target token bucket, flow control is performed on the target message based on the shared token bucket.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: Produce tokens based on committed information rate; If the number of tokens in the business token bucket is less than a preset number, the produced tokens are stored in the business token bucket; If the number of tokens in the business token bucket is equal to the preset number, the produced tokens are stored in the shared token bucket.

8. The method according to claim 7, It is characterized in that The token generation based on the committed information rate comprises: Calculate the token production time interval based on the committed information rate; Tokens are generated based on a token generation interval.

9. A flow control device, It is characterized in that The device comprises: A message acquisition module, used to acquire a target message and the type of the target message; A token bucket determination module, configured to determine a corresponding target token bucket based on the type of the target message, wherein the target token bucket includes at least one of a service token bucket and a shared token bucket; A length comparison module, used for comparing the number of tokens in the target token bucket with the length of the target message to obtain a comparison result; A flow control module is used to perform flow control on the target message based on the comparison result and the target token bucket.

10. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the flow control method according to any one of claims 1 to 8 by executing the computer instructions.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the flow control method according to any one of claims 1 to 8.

12. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the flow control method according to any one of claims 1 to 8.