Message speed limiting method, gateway device, intelligent network card, product and storage medium

By offloading the speed limiting operations of the gateway device to the Smart NIC, efficient utilization of gateway device resources is achieved, overall performance is improved, and the development cost and compatibility requirements of the Smart NIC are reduced.

CN120658682APending Publication Date: 2025-09-16HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410310805.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

When gateway devices transmit large amounts of data, resource competition leads to overall performance degradation. Existing technologies are unable to effectively solve resource occupation and compatibility issues.

Method used

The speed limit operation of the gateway device is offloaded to the smart network card. Through the collaborative method of software and hardware, the smart network card performs speed limit control according to the target speed limit identifier. The gateway device does not need to perform speed limit operations, reducing resource usage.

Benefits of technology

It improves the overall performance of gateway devices, reduces the development cost and compatibility requirements of smart network cards, and makes them more versatile.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658682A_ABST
    Figure CN120658682A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message speed limiting method, gateway equipment, an intelligent network card, a product and a storage medium. In the message speed limiting method, gateway equipment can provide a message and a corresponding target speed limiting identifier for an intelligent network card according to an information interaction format agreed with the intelligent network card; and the intelligent network card can identify the target speed limit identifier according to the information interaction format and perform speed limit control on the message. On the basis, the speed limiting operation in the gateway equipment is unloaded into the intelligent network card, so that when the gateway equipment receives the message, the speed limiting operation of the message does not need to be executed, occupation of resources of the gateway equipment is reduced, the gateway equipment can execute other functions by utilizing more resources, and the overall performance of the gateway equipment is improved. Besides, the gateway device instead of the intelligent network card performs query operation of the service speed limit information on the received message, so that the development cost of the intelligent network card can be effectively reduced, and the compatibility requirement of the intelligent network card on the service speed limit information of different formats can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message rate limiting method, a gateway device, a smart network card, a product, and a storage medium. Background Art

[0002] A gateway is a device that connects networks using different protocols. Acting as a gateway within a network, a gateway determines whether to forward user traffic outside the local network based on the IP (Internet Protocol) address of the device being used. It also receives and forwards traffic destined for devices within the local network.

[0003] When a gateway device transmits a large amount of data, it needs to use a lot of resources to perform traffic forwarding and traffic rate limiting operations. This resource competition leads to a decrease in the overall performance of the gateway device. Therefore, a new solution is needed. Summary of the Invention

[0004] Multiple aspects of the present application provide a message rate limiting method, gateway device, smart network card, product and storage medium for performing flow control in a software and hardware collaborative manner to improve the performance of the gateway device.

[0005] An embodiment of the present application provides a message rate limiting method applicable to a gateway device, comprising: receiving a message to be forwarded; querying preset service rate limit information based on the message to obtain a target rate limit identifier corresponding to the message; and providing the message and the target rate limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card, so that the smart network card performs rate limit control on the message according to the target rate limit identifier.

[0006] Optionally, the message and the target speed limit identifier are provided to the smart network card according to the information interaction format agreed upon with the smart network card, including: generating metadata information according to the target speed limit identifier and the attributes of the message and the information interaction format agreed upon between the gateway device and the smart network card; adding the metadata information to the header of the message, and sending the added message to the smart network card.

[0007] Optionally, the method further includes: obtaining externally provided speed limit configuration data; updating the preset service speed limit information according to the speed limit rules in the speed limit configuration data; and / or sending the correspondence between at least one speed limit identifier and speed limit parameters in the speed limit configuration data to the smart network card; wherein the speed limit parameters corresponding to any speed limit identifier include: committed burst size and committed information rate.

[0008] Optionally, before adding the target speed limit identifier to the message, it also includes: calculating the resource occupancy rate of the gateway device; if the resource occupancy rate of the gateway device is greater than a set threshold, determining that the smart network card performs a speed limit control operation on the message, and providing the message and the target speed limit identifier to the smart network card.

[0009] Optionally, the method further includes: if the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtaining a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; and controlling the forwarding rate of the message according to the target speed limit parameter.

[0010] An embodiment of the present application also provides a message speed limiting method, which is applicable to a smart network card, including: receiving a message sent by a gateway device, the message carrying a target speed limit identifier; parsing the data to be identified according to the information interaction format agreed with the gateway device to obtain the target speed limit identifier corresponding to the message; obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between at least one speed limit identifier and the target speed limit parameter; and forwarding the message according to the target speed limit parameter.

[0011] Optionally, before obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between at least one speed limit identifier and the target speed limit parameter, it also includes: receiving the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway, and the target speed limit parameter includes: committed burst size and committed information rate.

[0012] Optionally, forwarding the message according to the target speed limit parameter includes: determining a token bucket, the capacity of the token bucket corresponding to the committed burst size in the target speed limit parameter; putting tokens into the token bucket according to the committed information rate in the target speed limit identifier; judging whether the number of remaining tokens in the token bucket is greater than or equal to the length of the message; if so, sending the message; if not, caching the message until the number of remaining tokens in the token bucket is greater than or equal to the length of the message, and then sending the message; wherein, when the message is sent, the tokens in the token bucket are reduced by the amount of data in the message.

[0013] An embodiment of the present application also provides a gateway device, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to execute the message rate limiting method provided in an embodiment of the present application.

[0014] An embodiment of the present application also provides a smart network card, including: a communication module for receiving a message sent by a gateway device, the message carrying a target speed limit identifier; a hardware speed limit module for obtaining a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forwarding the message according to the target speed limit parameter.

[0015] The embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the message rate limiting method provided in the embodiment of the present application.

[0016] An embodiment of the present application further provides a computer program product, including: a computer program / instruction, which, when executed by a processor, can implement the message rate limiting method provided in the embodiment of the present application.

[0017] In the message speed limiting method provided in the embodiment of the present application, the gateway device can provide the message and the corresponding target speed limit identifier to the smart network card according to the information interaction format agreed with the smart network card; the smart network card can identify the target speed limit identifier according to the information interaction format and perform speed limit control on the message. Based on this, the speed limit operation in the gateway device is offloaded to the smart network card, and then the gateway device does not need to perform the speed limit operation of the message when receiving the message, which reduces the resource occupation of the gateway device, so that the gateway device can use more resources to perform other functions and improve the overall performance of the gateway device. In addition, the query operation of the service speed limit information on the received message is performed by the gateway device instead of the smart network card, which can effectively reduce the development cost of the smart network card, and can reduce the compatibility requirements of the smart network card for service speed limit information in different formats, making the smart network card more universal. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 Schematic diagram of the method for implementing message rate limiting for this gateway device;

[0020] Figure 2 A flow chart of a method for limiting the message rate provided by an exemplary embodiment of the present application when executed by a gateway device;

[0021] Figure 3 A schematic diagram of an information exchange format of metadata of a message provided by an exemplary embodiment of the present application;

[0022] Figure 4A flow chart of a method for limiting the message rate provided by an exemplary embodiment of the present application when executed by a gateway device;

[0023] Figure 5 A schematic diagram of a flow chart of a method for limiting message speed provided by another exemplary embodiment of the present application when executed by a gateway device;

[0024] Figure 6 A schematic diagram of the structure and interaction of a gateway system provided for an exemplary embodiment of the present application;

[0025] Figure 7 A schematic diagram of the structure of a gateway device provided in an exemplary embodiment of the present application;

[0026] Figure 8 A schematic diagram of the structure of a smart network card provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0028] The terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The singular forms "a," "the," and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. "A plurality" generally includes at least two, but does not exclude the inclusion of at least one.

[0029] It should be understood that the term "and / or" as used herein is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0030] It should also be noted that the terms "include," "comprises," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the product or system comprising the element.

[0031] When the amount of data transmitted by the gateway device is large, the gateway device needs to occupy a large amount of resources to perform traffic forwarding operations and traffic rate limiting operations. Figure 1 As shown, after the network card receives the message, it can distribute the message to the gateway device. The gateway device can use the query software running therein to query the service speed limit table and obtain the target speed limit identifier of the message. The gateway device can use the speed limit software running therein to limit the speed of the message according to the target speed limit identifier of the message. When determining to forward the message, the message is forwarded to the network card through the driver component, and the message is sent to the physical network via the network card. In the above process, the query software and the speed limit software need to occupy a large amount of resources in the CPU (Central Processing Unit) of the gateway device, resulting in the gateway device using limited resources to perform operations such as protocol conversion, security anti-attack, firewall, address translation, etc., which in turn leads to a decrease in the overall performance of the gateway device.

[0032] In one solution, the software program and service rate limit table used for traffic rate limiting on the gateway device can be offloaded to the hardware network interface card (NIC). Upon receiving a packet, the NIC can query the local service rate limit table to obtain the target rate limit parameters and then rate limit the packet accordingly. However, the service rate limit table formats used in different application scenarios vary. For hardware NICs, compatibility with different service rate limit table formats requires complex design, resulting in limited scalability and versatility.

[0033] In response to the above technical problems, a solution is provided in some embodiments of the present application. The technical solutions provided in each embodiment of the present application are described in detail below with reference to the accompanying drawings.

[0034] Figure 2 This is a flow chart of a message rate limiting method provided by an exemplary embodiment of the present application. When the method is executed on the gateway device side, it may include the following steps: Figure 2 Steps shown:

[0035] Step 201: Receive a message to be forwarded.

[0036] Step 202: Query preset service speed limit information according to the message to obtain a target speed limit identifier corresponding to the message.

[0037] Step 203: Provide the message and the target speed limit identifier to the smart network card according to the information exchange format agreed upon with the smart network card, so that the smart network card performs speed limit control on the message according to the target speed limit identifier.

[0038] The message to be forwarded may be forwarded by a message forwarding device such as an intelligent network card, a switch, or a router connected to the gateway device. After receiving the message, the message forwarding device may forward the message to the gateway device according to preset routing information.

[0039] The gateway device can query preset service speed limit information based on the message. In this embodiment, the preset service speed limit information is primarily used to describe the speed limit rules of the gateway device. In some embodiments, the preset service speed limit information can be described using a service speed limit table. The service speed limit table can describe the correspondence between the message identification identifier, speed limit conditions, and target speed limit identifier. The message identification identifier may include at least one of the message's IP address, port number, and the physical address of the device to which the message corresponds. The speed limit conditions may include at least one of the user tag, the type of network the message requests to access (e.g., public or private network), the type of service the message requests to access, and the time the message is sent. The service speed limit table can describe the target speed limit identifiers corresponding to messages with different identification identifiers under different speed limit conditions. For example, a message with an IP address of 001 accessing the public network will have a speed limit ID of 1001. For example, when a packet with IP address 002 accesses service A during off-peak hours (e.g., 23:00-06:00), the corresponding rate limit ID is 1002.

[0040] The gateway device can run query software that queries the preset service rate limit information based on the message's identification identifier to obtain the target rate limit identifier corresponding to the message. In some embodiments, after receiving the message, the gateway device can use the SmartNIC to perform rate limiting operations on the message to reduce the gateway device's own resource utilization. In this embodiment, the gateway device can provide the target rate limit identifier and the message to the SmartNIC.

[0041] Optionally, when the gateway device provides the message and the target speed limit identifier to the smart network card, it may generate metadata information according to the target speed limit identifier and the attributes of the message, in accordance with the information interaction format agreed upon by the gateway device and the smart network card. The attributes of the message may include at least one of: whether the speed limit control of the message is effective, the length of the message, the number of speed limit IDs corresponding to the message, and the version number. The version number refers to the version of the executable program running in the smart network card. As the functions of the smart network card evolve, the executable program in the smart network card can be continuously iterated and updated. The gateway device may specify the version of the executable program in the smart gateway used to process the message in the metadata information. One message may correspond to multiple speed limit IDs, so as to perform multi-level speed limit operations on the message.

[0042] Among them, the information exchange format agreed upon by the gateway device and the smart network card is used to agree on the field organization method and the meaning of different fields in the metadata, so that the smart network card can understand the structured information in the metadata information, thereby ensuring compatibility and interoperability between the gateway device and the smart network card.

[0043] Figure 3 A method for realizing the information exchange format is shown as follows: Figure 3 As shown, the information exchange format can specify the organization of the ID field, num field, Ver field, pkt length field, and meter_id field, as well as the number of bytes each field occupies. The ID field is used to indicate whether metadata is valid. If rate limiting is required for the message, the ID field can be set to the specified value. Ver is used to describe the version number. The num field is used to describe the number of rate limit IDs. The pkt length field is used to describe the message length. The meter_id field is used to describe the rate limit ID and can be extended to describe multiple rate limit IDs.

[0044] After the gateway device generates the metadata information, it can send the message and the metadata information to the smart network card. In some optional embodiments, the gateway device can add the generated metadata information to the end or head of the message, or can add the metadata information to a specified field in the message, which is not limited in this embodiment.

[0045] The smart network card is a device connected to a gateway device and used to forward messages sent from the gateway device. The smart network card can control the forwarding rate of the message according to the target rate limit parameter corresponding to the target rate limit identifier.

[0046] In this implementation, the speed limit operation in the gateway device is offloaded to the smart network card. As a result, when the gateway device receives a message, it does not need to perform the speed limit operation on the message, which reduces the resource usage of the gateway device. As a result, the gateway device can use more resources to perform other functions, improving the overall performance of the gateway device. In addition, the query operation of service speed limit information on the received message by the gateway device instead of the smart network card can effectively reduce the development cost of the smart network card and reduce the compatibility requirements of the smart network card for service speed limit information in different formats, making the smart network card more universal.

[0047] In some optional embodiments, the gateway device may also be used to obtain dynamically updated speed limit configuration data. Optionally, in this manner, the gateway device may obtain speed limit configuration data provided externally. The externally provided configuration data may be obtained from a specified network service through the smart network card, or may be manually imported into the local gateway device by the user, and this embodiment does not impose any restrictions. Optionally, if the speed limit configuration data includes updated speed limit rules, the gateway device may update the service speed limit information in the network card according to the speed limit rules in the speed limit configuration data. Optionally, if the speed limit configuration data includes an updated correspondence between at least one speed limit identifier and a speed limit parameter, the gateway device may send the correspondence between at least one speed limit identifier and a speed limit parameter in the speed limit configuration data to the smart network card.

[0048] The target rate limit parameters may include: Committed Burst Size (CBS) and Committed Information Rate (CIR). The CBS represents the maximum amount of data the network can tolerate in a burst, measured in kbit / s. The CIR refers to the information transmission rate under normal conditions on a specific virtual circuit (VC) reserved by the network, measured in kbit / s.

[0049] Based on this implementation, the gateway device can dynamically obtain speed limit configuration data, thereby flexibly meeting the speed limit requirements in different application scenarios.

[0050] In some optional embodiments, the gateway device may determine whether to transfer the speed limit operation to the smart network card for execution based on its own resource idleness. Optionally, the gateway device may calculate the resource occupancy rate of the gateway device before adding the target speed limit identifier to the message. The resource occupancy rate may be obtained by weighted calculation based on at least one of the CPU occupancy rate, memory occupancy rate, disk occupancy rate, IO resource occupancy rate and packet loss rate of the gateway device. Optionally, if the resource occupancy rate of the gateway device is greater than a set threshold, it may be determined that the smart network card performs a speed limit control operation on the message, and the message and the target speed limit identifier may be provided to the smart network card. The set threshold may be an empirical value, such as 80%, 85% or 90% or other optional thresholds.

[0051] In some optional embodiments, if the resource utilization of the gateway device is less than or equal to the set threshold, the gateway device may obtain the target rate limit parameter corresponding to the target rate limit identifier from the service rate limit information and control the message forwarding rate based on the target rate limit parameter. The forwarding rate describes the amount of message data forwarded by the gateway device per unit time. In other words, when the gateway device has relatively idle resources, it does not need to transfer the rate limit operation to the SmartNIC. The gateway device can use the locally running rate limit program to perform the rate limit operation on the message.

[0052] In this implementation, the gateway device can flexibly choose to execute the message rate limit operation locally or by the smart network card based on its own resource availability. In particular, during certain high-incidence periods, the gateway device can process the rate limit operation for a portion of messages when the resource utilization rate is low. If the rate limit operation for these messages causes the resource utilization rate to exceed the set threshold, the gateway device can offload the rate limit operation for subsequent messages received to the smart network card for execution. Furthermore, the gateway device and the smart network card can divert the load pressure generated by the rate limit operation, ensuring that both the network card and the gateway device have good performance.

[0053] In addition to the aforementioned embodiments, an embodiment of the present application further provides a message rate limiting method executed by a smart network card, which will be described below with reference to the accompanying drawings.

[0054] Figure 4 This is a flow chart of a message rate limiting method provided by another exemplary embodiment of the present application. When the method is executed on the smart network card side, it may include the following steps: Figure 4 Steps shown:

[0055] Step 401: Receive a message sent by a gateway device, where the message carries data to be identified.

[0056] Step 402: Parse the data to be identified according to the information exchange format agreed upon with the gateway device to obtain a target speed limit identifier corresponding to the message.

[0057] Step 403: From the correspondence between at least one speed limit identifier and a target speed limit parameter, obtain a target speed limit parameter corresponding to the target speed limit identifier.

[0058] Step 404: Forward the message according to the target rate limit parameter.

[0059] In this embodiment, a Smart NIC refers to a NIC that includes a programmable chip. For example, in some embodiments, the Smart NIC may include at least one of a programmable logic controller (PLC), a single-chip microcomputer, a field programmable gate array (FPGA), a digital signal processor (DSP), a single-chip microcomputer, and an advanced RISC machine (ARM). By programming the programmable chip in the Smart NIC, the rate limiting operation originally performed by the gateway device can be offloaded to the Smart NIC.

[0060] The SmartNIC is connected to a gateway device, receiving messages forwarded by the gateway device and forwarding them to the target device in the physical network. In this embodiment, the message carries data to be identified. This data can be located in the message header or footer, or in other agreed-upon fields. The SmartNIC parses this data according to the information exchange format agreed upon with the gateway device to obtain the target speed limit identifier corresponding to the message.

[0061] In some optional embodiments, the data to be identified is located in the header of the message, which is used to store metadata information required for communication between the gateway device and the smart network card in the information exchange format agreed upon by the gateway device and the smart network card. The metadata information includes the target speed limit identifier. The format and field description of the metadata information can be referred to Figure 3 The Smart NIC can parse the metadata information based on this information exchange format to obtain the target speed limit identifier. In addition to the target speed limit identifier, the Smart NIC can also parse the metadata information to obtain information such as the number of speed limit identifiers, the length of the message, and the version number.

[0062] The target speed limit identifier is determined by the gateway device by querying the preset service speed limit information and added to the message. For details, please refer to the description of the aforementioned embodiment. Based on the speed limit identifier, the smart network card can perform speed limit operations on the message during the process of forwarding the message. The smart network card pre-stores a correspondence between at least one speed limit identifier and a speed limit parameter. The correspondence can be issued by the gateway device, or can be obtained by the smart network card from a designated service in the network. For example, in some optional embodiments, before obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between at least one speed limit identifier and the target speed limit parameter, the smart network card can receive the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway device. The correspondence between the at least one speed limit identifier and the speed limit parameter can be obtained by the gateway device from the speed limit configuration data provided externally. For details, please refer to the description of the aforementioned embodiment. In this embodiment, the target speed limit parameters may include: committed burst size and committed information rate.

[0063] The smart network card can obtain the speed limit parameter corresponding to the target speed limit identifier from the correspondence between the at least one speed limit identifier and the target speed limit parameter as the target speed limit parameter. After obtaining the target speed limit parameter, the smart network card can perform a speed limit control operation on the message according to the target speed limit parameter.

[0064] In some optional embodiments, when forwarding a message according to the target rate limit parameter, the smart network card uses a fixed window to control the forwarding rate corresponding to the message. In this embodiment, the smart network card can set a fixed time window and set the maximum amount of data sent within the time window. The maximum amount of data is determined according to the length of the time window and the committed information rate. When a message arrives, if the amount of data sent within the time window where the message arrives is equal to the maximum amount of data, the smart network card can add the message to the waiting queue and wait for the next time window to arrive. In each time window, a message packet with a data volume less than or equal to the maximum data volume corresponding to the time window can be taken out from the waiting queue, and the taken-out message packet can be forwarded.

[0065] In other optional embodiments, when forwarding packets according to the target rate limit parameters, the SmartNIC may employ a token bucket algorithm to control the forwarding rate corresponding to the packet. The SmartNIC may determine a token bucket whose capacity corresponds to the committed burst size (CBS) in the target rate limit parameters. The SmartNIC may add tokens to the token bucket based on the committed information rate (CIR) corresponding to the target rate limit identifier. When a packet is sent, the token bucket is decremented by a token corresponding to the amount of data in the packet. In this embodiment, one token may correspond to one byte of data. That is, each byte of data forwarded by the SmartNIC consumes one token from the token bucket. Based on this, when a packet arrives, the SmartNIC may determine whether the number of remaining tokens in the token bucket is greater than or equal to the length of the packet. If the number of remaining tokens in the token bucket is greater than or equal to the length of the packet, the SmartNIC may send the packet. If the number of remaining tokens in the token bucket is less than the length of the packet, the SmartNIC may buffer the packet until the number of remaining tokens in the token bucket is greater than or equal to the length of the packet, at which point the packet may be sent.

[0066] The following will take the implementation of the smart network card as an FPGA network card as an example for illustrative description. The FPGA-based smart network card may include: Figure 5 The hardware rate limiting module shown in the figure includes a token generator, a token bucket, and a message controller. The token generator can be implemented based on a timer or counter in an FPGA. The token generator generates tokens at a fixed frequency based on an input clock signal and places the tokens into a token bucket. The fixed frequency corresponds to the committed information rate (CIR) in the rate limit parameters. For example, if the token generator is implemented as a counter, a token is generated when the counter reaches a specific value corresponding to the CIR. After the generated token is added to the token bucket, the counter is reset and continues counting until the counter reaches the specific value, generating the next token. In the smart network card, the token bucket can be implemented based on a data table in the static random access memory (SRAM) in the FPGA. The token bucket corresponding to any rate limit identifier stores tokens generated for that rate limit identifier based on the data table and limits the total number of tokens corresponding to that rate limit identifier based on the CRS to prevent the upper limit from being exceeded. The message controller can be implemented based on the programmable logic unit in the FPGA. The message controller is primarily responsible for obtaining the length of the input message and controlling the transmission of the message data packets based on the number of tokens. When a packet is ready to be sent, the packet controller checks whether there are enough tokens in the token bucket. If there are enough tokens, the packet is forwarded and the token bucket is decremented by the corresponding number of tokens. If there are insufficient tokens, the packet is blocked or dropped until more tokens are generated.

[0067] In this implementation, the Smart NIC can determine the target speed limit parameters corresponding to the target speed limit identifier based on the target speed limit identifier carried in the message, and perform message flow control based on the target speed limit parameters. This effectively reduces the load on the gateway device. Furthermore, the Smart NIC does not need to query service speed limit information. When the service speed limit information is implemented as a service speed limit table, the Smart NIC does not need to be compatible with service speed limit tables in different formats, thereby reducing the development cost of the Smart NIC and lowering the compatibility requirements of the Smart NIC with service speed limit information in different formats, making the Smart NIC more versatile.

[0068] The following will be combined Figure 6 The above embodiments of the present application are further illustrated. Figure 6 A schematic diagram of a gateway processing system provided by an exemplary embodiment of the present application is shown in FIG. Figure 6 As shown, the gateway processing system includes a gateway device and an FPGA network card. Figure 6 As shown in the figure, the FPGA network card can perform packet receiving and distribution operations, that is, receiving messages sent from the outside and forwarding the messages to the gateway device. The gateway device can query the service speed limit information to obtain the speed limit ID corresponding to the message and write the speed limit ID into the message. After that, the driver component in the gateway device can forward the message to the FPGA network card. Figure 6 As shown in Figure 1, the function of the software speed limit module in the gateway device is offloaded to the hardware speed limit module in the FPGA network card. Then, the FPGA network card can obtain the speed limit ID from the message and perform the hardware speed limit operation. Figure 6 As shown, the gateway device also includes a speed limit configuration module, which is used to obtain speed limit configuration data, update the service speed limit information in the gateway device according to the speed limit configuration data, and send the correspondence between the speed limit identifier and the speed limit parameter in the speed limit configuration data to the hardware speed limit module in the FPGA network card.

[0069] based on Figure 6 The gateway processing system shown in the figure offloads the rate limiting operation in the gateway device to the smart network card. Therefore, when the gateway device receives a message, it does not need to perform the rate limiting operation of the message, which reduces the resource occupation of the gateway device. The gateway device can use more resources to perform other functions and improve the overall performance of the gateway device.

[0070] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 401 to 403 can be device A; for another example, the execution entity of steps 401 and 402 can be device A, and the execution entity of step 403 can be device B; and so on.

[0071] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 401, 402, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.

[0072] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0073] Figure 7 The schematic diagram of the structure of a gateway device provided by an exemplary embodiment of the present application is shown, and the gateway device is applicable to the message rate limiting method provided by the above embodiment. Figure 7 As shown, the gateway device includes: a memory 701 , a processor 702 and a communication component 703 .

[0074] The memory 701 is used to store computer programs and can be configured to store various other data to support operations on the gateway device. Examples of such data include instructions for any application or method operating on the gateway device.

[0075] The processor 702 is coupled to the memory 701 and is configured to execute a computer program in the memory 701 to: control the communication component 703 to receive a message to be forwarded; query preset service speed limit information based on the message to obtain a target speed limit identifier corresponding to the message; and control the communication component 703 to provide the message and the target speed limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card, so that the smart network card performs speed limit control on the message according to the target speed limit identifier.

[0076] Optionally, when the processor 702 provides the message and the target speed limit identifier to the smart network card according to the information interaction format agreed upon with the smart network card, it is specifically used to: generate metadata information according to the target speed limit identifier and the attributes of the message and in accordance with the information interaction format agreed upon between the gateway device and the smart network card; add the metadata information to the header of the message, and send the added message to the smart network card.

[0077] Optionally, the processor 702 is further used to: obtain externally provided speed limit configuration data; update the preset service speed limit information according to the speed limit rules in the speed limit configuration data; and / or send the correspondence between at least one speed limit identifier and speed limit parameters in the speed limit configuration data to the smart network card; wherein the speed limit parameters corresponding to any speed limit identifier include: committed burst size and committed information rate.

[0078] Optionally, before adding the target speed limit identifier to the message, the processor 702 is also used to: calculate the resource occupancy rate of the gateway device; if the resource occupancy rate of the gateway device is greater than a set threshold, determine that the smart network card performs a speed limit control operation on the message, and provide the message and the target speed limit identifier to the smart network card.

[0079] Optionally, the processor 702 is further configured to: if the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtain a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; and control the forwarding rate of the message according to the target speed limit parameter.

[0080] Further, if Figure 7 As shown, the gateway device also includes: a power supply component 704 and other components. Figure 7 Only some components are shown schematically, which does not mean that the gateway device only includes Figure 7 Components shown.

[0081] Among them, the memory 701 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0082] The communication component 703 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as Wi-Fi (wireless network communication technology), 2G (such as Global System for Mobile Communications (GSM)), 3G (such as Wideband Code Division Multiple Access (WCDMA), 4G (such as Long Term Evolution (LTE)), 4G+ (such as upgraded version of Long Term Evolution (LTE-Advanced, LTE-A)), or 5G (fifth generation mobile communication technology), or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, Infrared Data Association (IDA) technology, or a combination thereof. It can be realized by using rDA (Ultra Wide Band, UWB) technology, Bluetooth (Bluetooth, BT) technology and other technologies.

[0083] The power supply component 704 is used to provide power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0084] In this embodiment, the rate limiting operation in the gateway device is offloaded to the smart network card, so that when the gateway device receives the message, it does not need to perform the rate limiting operation of the message, which reduces the resource occupation of the gateway device. The gateway device can then use more resources to perform other functions and improve the overall performance of the gateway device.

[0085] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by the gateway device in the above method embodiment.

[0086] Accordingly, an embodiment of the present application further provides a computer program product, comprising: a computer program / instruction, which, when executed by a processor, can implement the steps that can be executed by the gateway device in the above embodiment.

[0087] Figure 8 The structure diagram of the smart network card provided by an exemplary embodiment of the present application is shown as follows. Figure 8 As shown, the intelligent network includes:

[0088] The communication module 801 is configured to receive a message sent by a gateway device, the message carrying data to be identified; parse the data to be identified according to an information exchange format agreed upon with the gateway device, and obtain a target speed limit identifier corresponding to the message.

[0089] The hardware speed limit module 802 is configured to obtain a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forward the message according to the target speed limit parameter.

[0090] Optionally, before the hardware speed limit module 802 obtains the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between at least one speed limit identifier and the target speed limit parameter, the communication module 801 is further used to: receive the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway, and the target speed limit parameter includes: committed burst size and committed information rate.

[0091] Optionally, the hardware rate limiting module 802 includes: a token generator 803 , a token bucket 804 and a message controller 805 .

[0092] The token generator 803 may include a counter or a timer. The token bucket 804 may include a memory, such as a table in a static random access memory. The message controller 805 may include a programmable logic unit and execution logic running therein.

[0093] Optionally, when the hardware rate limiting module 802 forwards the message according to the target rate limiting parameter, the above components are respectively configured to perform the following operations:

[0094] Token bucket 804 is used to provide token storage space, and the capacity of token bucket 804 corresponds to the committed burst size in the target speed limit parameter. Token generator 803 is used to add tokens to token bucket 804 based on the committed information rate in the target speed limit identifier. Message controller 805 is used to determine whether the number of remaining tokens in token bucket 804 is greater than or equal to the length of the message; if so, send the message; if not, cache the message until the number of remaining tokens in token bucket 804 is greater than or equal to the length of the message, at which point the message is sent. When the message is sent, token bucket 804 is decremented by the amount of tokens in the message.

[0095] In this embodiment, the Smart NIC can determine the target speed limit parameters corresponding to the target speed limit identifier based on the target speed limit identifier carried in the message, and perform flow control on the message based on the target speed limit parameters. This effectively reduces the load on the gateway device. Furthermore, the Smart NIC does not need to query service speed limit information. When the service speed limit information is implemented as a service speed limit table, the Smart NIC does not need to be compatible with service speed limit tables in different formats, thereby reducing the development cost of the Smart NIC and lowering the compatibility requirements of the Smart NIC for service speed limit information in different formats, making the Smart NIC more versatile.

[0096] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by the smart network card in the above method embodiment.

[0097] Accordingly, an embodiment of the present application further provides a computer program product, including: a computer program / instruction, which, when executed by a processor, can implement the steps that can be executed by the smart network card in the above embodiment.

[0098] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, etc.) containing computer-usable program code.

[0099] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0100] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0102] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0103] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0104] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0105] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0106] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A message rate limiting method, applicable to a gateway device, characterized in that: include: Receive messages to be forwarded; Querying preset service speed limit information according to the message to obtain a target speed limit identifier corresponding to the message; According to the information exchange format agreed upon with the smart network card, the message and the target speed limit identifier are provided to the smart network card, so that the smart network card performs speed limit control on the message according to the target speed limit identifier.

2. The method according to claim 1, characterized in that Providing the message and the target speed limit identifier to the smart network card according to the information exchange format agreed upon with the smart network card includes: Generate metadata information according to the target speed limit identifier and the attributes of the message and in accordance with the information exchange format; The metadata information is added to the header of the message, and the message after the addition is sent to the smart network card.

3. The method according to claim 1, characterized in that Also includes: Obtain externally provided rate limit configuration data; updating the preset service speed limit information according to the speed limit rules in the speed limit configuration data; and / or, sending a correspondence between at least one speed limit identifier and a speed limit parameter in the speed limit configuration data to the smart network card; The speed limit parameters corresponding to any speed limit identifier include: committed burst size and committed information rate.

4. The method according to any one of claims 1 to 3, characterized in that Before adding the target speed limit identifier to the message, the method further includes: Calculating resource occupancy of the gateway device; If the resource occupancy rate of the gateway device is greater than a set threshold, it is determined that the smart network card performs a rate limit control operation on the message, and the message and the target rate limit identifier are provided to the smart network card.

5. The method according to claim 4, characterized in that The method further comprises: If the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtaining a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; The forwarding rate of the message is controlled according to the target rate limit parameter.

6. A message rate limiting method, applicable to smart network cards, characterized in that: include: receiving a message sent by a gateway device, wherein the message carries data to be identified; Parsing the data to be identified according to the information exchange format agreed upon with the gateway device to obtain a target speed limit identifier corresponding to the message; Obtaining a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter; The message is forwarded according to the target rate limit parameter.

7. The method according to claim 6, characterized in that Before obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between the at least one speed limit identifier and the target speed limit parameter, the method further includes: A correspondence between the at least one rate limit identifier and target rate limit parameters sent by the gateway is received, where the target rate limit parameters include: a committed burst size and a committed information rate.

8. The method according to claim 7, characterized in that Forwarding the message according to the target rate limit parameter includes: Determine a token bucket, wherein the capacity of the token bucket corresponds to the committed burst size in the target rate limit parameter; Putting tokens into the token bucket according to the committed information rate in the target speed limit identifier; Determine whether the number of remaining tokens in the token bucket is greater than or equal to the length of the message; If yes, then send the message; If not, the message is cached until the number of remaining tokens in the token bucket is greater than or equal to the length of the message and the message is sent; When the message is sent, the token bucket is reduced by the token amount corresponding to the data volume of the message.

9. A gateway device, characterized in that: include: memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to perform the steps of the method according to any one of claims 1 to 5.

10. A smart network card, characterized in that: include: A communication module, configured to receive a message sent by a gateway device, wherein the message carries a target speed limit identifier; The hardware speed limit module is configured to obtain a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forward the message according to the target speed limit parameter.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it can implement the message rate limiting method described in any one of claims 1 to 8.

12. A computer program product, characterized in that include: A computer program / instruction, which, when executed by a processor, can implement the message rate limiting method according to any one of claims 1 to 8.