Transmission rate control method and device, program product and electronic equipment
By identifying and adjusting the message queue occupancy rate in the data path, the data packet blocking problem between the hardware circuit and the virtual switch in the smart network card is solved, ensuring the stability and efficiency of data transmission.
Patent Information
- Application Number
- CN202410984569.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-15
AI Technical Summary
In smart network cards, the data path between the hardware circuit and the virtual switch is blocked due to a large number of data packets, affecting data forwarding performance and efficiency.
By identifying the message queue from the hardware circuit to the virtual switch in the data path, the message occupancy rate is calculated, and when the threshold is reached, the data transmission rate of the hardware circuit to the virtual switch is adjusted to avoid packet blocking.
It effectively alleviates the data path congestion between the hardware circuit and the virtual switch, ensuring the normal operation and data packet forwarding performance of the smart network card.
Smart Images

Figure CN118784569A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a transmission rate control method, device, program product and electronic device. Background Art
[0002] In the field of cloud computing, the virtual switch in the smart network card is an important part of the network infrastructure in the current cloud data center. The data path of the virtual switch usually consumes a lot of CPU computing resources in the process of completing the task of packet forwarding. As the data scale increases, the requirements for data forwarding performance are getting higher and higher. In order to reduce resource consumption and break through performance bottlenecks, a hardware circuit (such as ASIC or FPGA, etc.) is set in the smart network card to offload the packet forwarding function from the virtual switch to the hardware circuit, and use the high-speed execution effect of the hardware circuit to achieve fast forwarding of data packets.
[0003] However, when the data packet to be forwarded is an unrecorded type of data packet, the hardware circuit cannot determine the exact forwarding path, and needs to send the data packet to the virtual switch through the data path, use the virtual switch to determine the specific forwarding path of the data packet, and further use the hardware circuit to forward the data packet after determining the specific forwarding path. When the number of data packets received by the smart network card within a certain period of time is large, a large number of data packets are blocked in the data path between the hardware circuit and the virtual switch, slowing down the rate at which the virtual switch reads the uploaded data packets through the data path, and also increasing the time for the hardware circuit to obtain the data packet forwarding path from the virtual switch, affecting the overall work efficiency of the smart network card. Summary of the invention
[0004] In view of this, the present application provides a transmission rate control method, device, program product and electronic device, the main purpose of which is to improve the technical problem that when there are too many data packets in the data path between the hardware circuit and the virtual switch, the data path is blocked, affecting the execution of the smart network card forwarding data packet function.
[0005] In a first aspect, the present application provides a transmission rate control method, comprising:
[0006] Identify a message queue of a first direction in a data path, the first direction representing a data transmission direction from a hardware circuit in the smart network card to a virtual switch, the hardware circuit being used for hardware unloading of operation data in the virtual switch;
[0007] Calculating the message occupancy rate in the message queue;
[0008] If the message occupancy rate reaches a first threshold, the data transmission rate of the hardware circuit to the virtual switch is adjusted.
[0009] In a second aspect, the present application provides a transmission rate control device, comprising:
[0010] an identification module, configured to identify a message queue of a first direction in a data path, wherein the first direction represents a data transmission direction from a hardware circuit in the smart network card to a virtual switch, wherein the hardware circuit is used for hardware unloading of operation data in the virtual switch;
[0011] A calculation module, used to calculate the message occupancy rate in the message queue;
[0012] The adjustment module is used to adjust the data transmission rate of the hardware circuit to the virtual switch if the message occupancy rate reaches a first threshold.
[0013] In a third aspect, the present application provides a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the transmission rate control method described in the first aspect.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the transmission rate control method described in the first aspect.
[0015] In a fifth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the transmission rate control method described in the first aspect when executing the computer program.
[0016] By means of the above technical scheme, the present application provides a transmission rate control method, device, program product and electronic device. When the smart network card receives a large number of data packets, causing the path between the hardware circuit and the virtual network card to be blocked, the content of the present application can first identify the message queue of the first direction in the data path, the first direction represents the data transmission direction from the hardware circuit in the smart network card to the virtual switch, and the hardware circuit is used for hardware unloading of the operation data in the virtual switch; then calculate the message occupancy rate in the message queue; finally, if the message occupancy rate reaches the first threshold, adjust the data transmission rate of the hardware circuit to the virtual switch. In the technical scheme of the present application, when the smart network card receives a large number of data packets, the number of data packets that need to be transmitted to the virtual switch increases, blocking the communication line between the hardware circuit and the virtual switch. The technical scheme of the present application calculates the message occupancy rate of the message queue transmitted in the communication line, so that when the message occupancy rate reaches a certain number, the data transmission rate between the hardware circuit and the virtual switch can be adjusted to avoid the problem of data packet blocking in the data transmission direction from the hardware circuit to the virtual switch, thereby ensuring the normal operation of the smart network card.
[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A schematic diagram of a flow chart of a transmission rate control method provided in an embodiment of the present application is shown;
[0021] Figure 2 A schematic diagram of a data packet forwarding process of a smart network card provided in an embodiment of the present application is shown;
[0022] Figure 3 A schematic structural diagram of a transmission rate control device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0024] In order to improve the technical problem that when there are too many data packets in the data path between the hardware circuit and the virtual switch, the data path is blocked, which affects the execution of the smart network card forwarding data packet function. This embodiment provides a transmission rate control method, such as Figure 1 As shown, the method includes:
[0025] Step 101, identifying a message queue of a first direction in a data path, where the first direction represents a data transmission direction from a hardware circuit to a virtual switch, and the hardware circuit in the smart network card supports hardware offloading of operating data in the virtual switch.
[0026] In the smart network card, there is a certain data flow forwarding function. Specifically, the data forwarding function supports the forwarding function of the data packet. When the data packet is transmitted to the smart network card, specifically, through its internal hardware circuit, the hardware circuit quickly reads the data packet because the processing speed is much higher than the processing speed of the virtual switch, determines the forwarding path of the data packet and further performs the forwarding of the data packet. In other words, in the process of forwarding conventional data packets, the forwarding speed of the data packet can be accelerated by relying on the fast processing capability of the hardware circuit itself, that is, the hardware unloading technology. However, when the data packet cannot determine the specific forwarding path, the hardware circuit cannot directly forward the data packet. The hardware circuit forwards the data packet to the virtual switch, so that the virtual switch further identifies the forwarding path corresponding to the data packet. In the process of the hardware circuit transmitting the data packet to the virtual switch, the data packet is transmitted in the data path. Specifically, its data transmission direction is represented as the first direction. At the same time, when the number of data packets is large, the number of data packets with unclear forwarding paths received in the hardware circuit is also increasing. Data packets received in different receiving modes are continuously added to the data path, and a message queue is formed to be sent to the virtual switch in an orderly manner.
[0027] Step 102, calculating the message occupancy rate in the message queue.
[0028] The data transmission capacity of the data path is limited, that is, within a period of time, the data path can be used to transmit the message queue transmission capacity is limited. The longer the message queue, the higher the message occupancy rate of the message queue in the data path.
[0029] The processing time for the hardware circuit to identify that the forwarding path of the data packet is unclear and send the data packet is much shorter than the processing time for the virtual switch to receive the data packet and determine the forwarding path of the data packet. At the same time, when the hardware circuit identifies the data packet with an unclear forwarding path, it continuously forwards the data packet through the data path, causing the message queue in the data path waiting for the virtual switch to process to continue to grow.
[0030] When the number of data packets transmitted by the data path through the first direction exceeds the number of data packets that the virtual switch can receive in the same time period, the message queue formed by the data packets continuously occupies the available space of the data path. Therefore, the maximum occupiable space of the message queue can be used to represent the data space of the data path. When the message occupancy rate of the message queue reaches 100%, it can be considered that the data path cannot be blocked in the first direction and the data transmission function cannot be performed. In addition, when the first direction and the second direction of the data path are dynamically adjusted, the data path cannot perform the transmission of data from the virtual switch to the hardware circuit. In other words, even if the virtual switch identifies the forwarding path of the data packet, it cannot feed back the determined forwarding path to the hardware circuit. The hardware circuit cannot forward the data packet, and the entire smart network card is completely blocked.
[0031] Step 103: If the message occupancy rate reaches a first threshold, adjust the data transmission rate of the hardware circuit to the virtual switch.
[0032] The content of this embodiment proposes to adjust the transmission rate when the message occupancy rate reaches a certain threshold. When the smart network card receives a large number of data packets, some of these data packets cannot be quickly forwarded by the hardware circuit because the forwarding path is unclear. The data packets need to be forwarded to the virtual switch to specifically identify the forwarding path corresponding to the data packets. However, due to the difference in processing speed between the hardware circuit and the virtual circuit, the time taken by the virtual switch to identify the path is relatively long. When a large number of data packets need to determine the forwarding path, the data packets forwarded by the hardware circuit are blocked in the data path, resulting in the virtual switch being unable to feed back the identified forwarding path to the hardware circuit even if it identifies the forwarding path of the data packet. At the same time, the blocked message queue will occupy the storage space of the virtual switch, slowing down the processing time of the virtual switch to identify the forwarding path.
[0033] After the data packets are continuously transmitted to the data path, a message queue is formed in the data path. The virtual switch reads the data packets according to the sorting order of the data packets in the message queue and further determines its forwarding path. When the message queue accounts for too high a proportion in the data path, the content of this embodiment proposes to adjust the data transmission rate. More specifically, adjusting the transmission rate can be expressed as reducing the data transmission rate. By reducing the data transmission rate, the rate of uploading data packets from the hardware circuit can be reduced, and the rate of transmitting data packets in the data path can be reduced.
[0034] After adjusting the data transmission rate from the hardware circuit to the virtual switch, the problem of uneven data packet processing speed between the virtual switch and the hardware circuit can be alleviated. By reducing the transmission rate, the number of data packets transmitted from the hardware circuit to the virtual switch can be reduced, so that the time occupied by the virtual switch in the process of processing data packets, that is, the process of identifying the transmission path corresponding to the data packet according to its own identification logic, is less than the time for each data packet to be uploaded to the message queue in the data path. The message queue is a queue in the data path that can be used to store data packets waiting to be processed by the virtual switch. When the number of data packets in the message queue continues to decrease, the occupancy rate of the message queue continues to decrease, and the intelligent network card will not be unable to perform data packet forwarding work normally due to data jam between the hardware circuit and the virtual switch.
[0035] In the technical solution of this embodiment, when the smart network card receives a large number of data packets, the number of data packets that need to be transmitted to the virtual switch increases, blocking the communication line between the hardware circuit and the virtual switch. The technical solution of this application calculates the message occupancy rate of the message queue transmitted in the communication line, so that when the message occupancy rate reaches a certain number, it can adjust the data transmission rate from the hardware circuit to the virtual switch to avoid the problem of data packet blocking in the data transmission direction from the hardware circuit to the virtual switch, thereby ensuring the normal operation of the smart network card.
[0036] In a possible embodiment, adjusting the data transmission rate of the hardware circuit to the virtual switch includes:
[0037] The data transmission rate of the hardware circuit to the virtual switch is adjusted to a preset rate value, where the preset rate value is a minimum data transmission rate; the message occupancy rate in the message queue is monitored; and the data transmission rate is increased according to the attenuation coefficient of the message occupancy rate.
[0038] In the content of this embodiment, it is proposed that when the message occupancy rate in the message queue reaches the first threshold, the data transmission rate of the data path from the hardware circuit to the virtual switch is adjusted. This allows the data path to avoid communication jams caused by excessive occupancy of the message queue. By reducing the data transmission rate, the smart network card can provide the virtual switch with buffer time to identify the forwarding path when receiving more data packets or when it is at the peak of data forwarding. Therefore, when the message occupancy rate reaches the first threshold, the first threshold can be expressed as the risk threshold of the smart network card jam. When the first threshold is exceeded, the smart network card may be at risk of data forwarding jam. Therefore, the content of this embodiment proposes that when performing data adjustment, the data transmission rate is set to the minimum data transmission rate. In a feasible embodiment, the minimum data transmission rate can be 0.
[0039] At the same time, this embodiment further proposes a process of dynamically adjusting the data transmission rate, proposes monitoring the message occupancy rate, and adjusting the data transmission rate according to the monitoring result. It can be understood that since the preset rate value is the minimum data transmission rate of the data path. Therefore, in the process of the message occupancy rate continuously decreasing, the data transmission rate can be increased so that the data transmission rate returns to normal.
[0040] In a feasible embodiment, the software module of the data path rate adjustment device that performs data transmission rate adjustment is a carrier, and the data path rate adjustment algorithm is executed in accordance with the principle of "high speed limit, low recovery", that is, when the message occupancy rate is high, the data transmission rate is limited, and when the message occupancy rate is low, the data transmission rate is restored. The carrier is integrated in the virtual switch. When the virtual switch throws an exception due to the excessively high message occupancy rate in the data path of the first direction, the carrier will capture the exception and configure the hardware module of the data path rate adjustment device through the PCI BAR space. The hardware module will control the smart network card hardware circuit to immediately lower the uplink transmission rate of the data path and the transmission rate in the data path. The carrier then monitors the message occupancy rate, and gradually restores the data transmission rate when the message occupancy rate decreases until it is restored to the rate level before the exception is thrown (unlimiting the speed).
[0041] By way of example, a specific feasible method is listed for the content of this embodiment, and the first threshold value can be expressed as any value between 75% and 100%. When the first threshold value is between 75% and 100%, the adjusted data transmission rate can be one-fourth of the normal data transmission rate; when the message occupancy rate in the message queue continues to decrease and reaches any value between 25% and 75%, the data transmission rate is adjusted again, and the adjusted data transmission rate is half of the normal data transmission rate; when the message occupancy rate in the message queue reaches any value between 0 and 25%, the data transmission rate is restored to the normal data transmission rate.
[0042] In the present embodiment, the data transmission rate in the first direction of the data path is controlled by continuous monitoring, real-time configuration, etc., so as to shield the data processing rate difference between the hardware circuit in the smart network card and the virtual switch. The data path congestion caused by the data processing rate difference between the hardware circuit in the smart network card and the virtual switch can be quickly cleared, and a stable operating environment can be provided for the virtual switch, thereby improving the performance stability of the smart network card without occupying additional physical resources.
[0043] In a possible embodiment, before identifying the message queue of the first direction in the data path, the method further includes:
[0044] Identify characteristic data of a data packet to be processed; search for the characteristic data in a first flow table stored in the hardware circuit; if the characteristic data does not exist in the first flow table, upload the data packet to be processed to a message queue in a data path between the hardware circuit and the virtual switch.
[0045] Before executing the step of uploading the data packet to the data path for transmission to the virtual network card, this embodiment further proposes a process of identifying the data packet in the hardware circuit.
[0046] When the hardware circuit receives a data packet, it treats the data packet as a data packet to be processed, and first identifies the characteristic data of the data packet to be processed. The characteristic data is used to represent some characteristics of the data packet to be processed, such as attribute information such as the data packet type and size. By identifying the characteristic data, the overall information of the data packet can be determined. Specifically, the hardware circuit includes a flow table as a first flow table. The first flow table at least includes the correspondence between the characteristic data of the data packet and the forwarding path. When the characteristic data of the data packet to be processed corresponds to the characteristic data in the first flow table, as shown in an embodiment, after searching the characteristic data in the first flow table stored in the hardware circuit, the method also includes:
[0047] If the characteristic data exists in the first flow table, the data packet to be processed is forwarded according to the forwarding path corresponding to the characteristic data.
[0048] The hardware circuit can directly read the corresponding forwarding path based on the characteristic data, and the hardware circuit executes the forwarding steps of the data packet to be processed. At the same time, since the data packet reception, path reading and forwarding process are executed by the hardware circuit, and the hardware circuit executes at a high speed, the smart network card can quickly forward the data packet by unloading the data packet forwarding process to the hardware circuit part.
[0049] However, when the characteristic data of the data packet to be processed does not exist in the first flow table, at this time, the data packet to be processed is the first packet received by the smart network card, that is, the data packet of the type received for the first time. The hardware circuit cannot confirm the forwarding path of the data packet. The content of this embodiment further proposes uploading the data packet to be processed through the data path and using the virtual switch to perform the forwarding path determination process.
[0050] In the content of this embodiment, during the process of the intelligent network card quickly forwarding data packets, taking into account the emergence of new types of data packets, the data packets to be processed are transmitted to other components used to determine the forwarding path to prevent the hardware circuit from being unable to execute the data packet forwarding steps when encountering new types of data packets, thereby improving the reliability of the intelligent network card in executing data packet forwarding.
[0051] In a possible embodiment, after adjusting the data transmission rate of the hardware circuit to the virtual switch, the method further includes:
[0052] According to the adjusted data transmission rate, the data packet to be processed is transmitted to the virtual switch; the characteristic type of the data packet to be processed is determined according to the characteristic data; based on the forwarding path in the second flow table of the virtual switch, the target forwarding path for the characteristic type is determined; through the data path from the virtual switch to the hardware circuit, the target forwarding path is transmitted to the first flow table.
[0053] In the content of this embodiment, after uploading the data packet to be processed through the data path between the hardware circuit and the virtual switch, after the virtual switch obtains the data packet to be processed, the virtual switch further processes the data packet to be processed according to the characteristic type of the data packet to be processed, and completes the processing of the data packet to be processed according to its own program logic or configuration content (such as forwarding path, NAT (Network Address Translation), referring to network address translation, etc.). When completing the processing of the data packet to be processed, the corresponding relationship between the existing forwarding path and the characteristic type in the second flow table of the virtual switch itself can be directly read, or it can be adjusted and generated based on the existing corresponding relationship, or it can be manually controlled and input. After determining the target forwarding path of the data packet to be processed, the target forwarding path is fed back to the hardware circuit through the data path of the second direction. When the hardware circuit reads the target forwarding path, it relies on its own fast processing capability to realize the fast forwarding of the data packet to be processed. Furthermore, when the target forwarding path is fed back to the hardware circuit, it is directly fed back to the first flow table of the hardware circuit to realize the fast and accurate identification of the target forwarding path.
[0054] In a possible embodiment, after transmitting the target forwarding path to the first flow table, the method includes:
[0055] Extracting a target forwarding path; establishing a corresponding relationship between the target forwarding path and the characteristic data; and storing the corresponding target forwarding path and the characteristic data in a first flow table.
[0056] In the content of this embodiment, after forwarding the data packet to be processed using the target forwarding path, the content of this embodiment further indicates that the correspondence between the target forwarding path and the characteristic data is stored in the second flow table. When the subsequent hardware circuit receives a subsequent data packet with the same characteristic data as the data packet to be processed, the data packet does not need to be sent to the virtual switch again to determine its forwarding path. The hardware circuit can rely on the forwarding path in the first flow table to forward the data packet, thereby improving the forwarding rate of the data packet and reducing the workload of the virtual switch. For example, Figure 2 As shown, Figure 2A schematic diagram of a data packet forwarding process of an intelligent network card is disclosed. The intelligent network card includes a virtual switch and a hardware circuit, wherein the hardware circuit can be in the form of an FPGA (field programmable gate array) / ASIC (application-specific integrated circuit). When the data packet to be processed is transmitted to the hardware circuit, the hardware circuit cannot determine and forward the path according to its own flow table (first flow table). At this time, the data packet to be processed is used as the first packet. The hardware circuit sends the first packet to the virtual switch through the data path of the first direction. The virtual switch connects the data path between the received first packet and its own flow table (second flow table), determines the forwarding path of the first packet according to the storage path or path determination logic in the flow table, and feeds the data packet and its forwarding path back to the hardware circuit, so that the hardware circuit relies on the forwarding path fed back by the virtual switch to realize the forwarding of the first packet. At the same time, the data packet type and forwarding path corresponding to the first packet are stored in the first flow table, and the hardware circuit can quickly realize the rapid forwarding of subsequent data packets of the same type (subsequent packets) according to the corresponding relationship between the data packet type and the forwarding path stored in the first flow table.
[0057] Further, as Figure 1 The specific implementation of the method shown in this embodiment is as follows Figure 3 As shown, a schematic diagram of the structure of a transmission rate control device is provided, including: an identification module 31, a calculation module 32, and an adjustment module 33;
[0058] An identification module 31 is used to identify a message queue of a first direction in a data path, where the first direction represents a data transmission direction from a hardware circuit to a virtual switch, and the hardware circuit in the smart network card supports hardware unloading of operation data in the virtual switch;
[0059] A calculation module 32, used to calculate the message occupancy rate in the message queue;
[0060] The adjustment module 33 is configured to adjust the data transmission rate of the hardware circuit to the virtual switch if the message occupancy rate reaches a first threshold.
[0061] In a possible embodiment, the adjustment module 33 is specifically configured to:
[0062] Adjusting the data transmission rate of the hardware circuit to the virtual switch to a preset rate value, wherein the preset rate value is a minimum data transmission rate;
[0063] Monitoring the message occupancy rate in the message queue;
[0064] The data transmission rate is increased according to the attenuation coefficient of the message occupancy rate.
[0065] In a possible embodiment, the identification module 31 is further configured to:
[0066] Identify characteristic data of the data packet to be processed;
[0067] Searching for the characteristic data in a first flow table stored in the hardware circuit;
[0068] If the characteristic data does not exist in the first flow table, the data packet to be processed is uploaded to a message queue in the data path between the hardware circuit and the virtual switch.
[0069] In a possible embodiment, the identification module 31 is further configured to:
[0070] If the characteristic data exists in the first flow table, the data packet to be processed is forwarded according to a forwarding path corresponding to the characteristic data.
[0071] In a possible embodiment, the adjustment module 33 is further used for:
[0072] According to the adjusted data transmission rate, transmitting the to-be-processed data packet to the virtual switch;
[0073] Determining a characteristic type of the data packet to be processed according to the characteristic data;
[0074] Determining a target forwarding path for the feature type based on the forwarding path in the second flow table of the virtual switch;
[0075] The target forwarding path is transmitted to the first flow table through a data path from the virtual switch to the hardware circuit.
[0076] In a possible embodiment, the adjustment module 33 is specifically configured to:
[0077] Extracting the target forwarding path;
[0078] Establishing a corresponding relationship between the target forwarding path and the characteristic data;
[0079] The corresponding target forwarding path and the characteristic data are stored in the first flow table.
[0080] It should be noted that for other corresponding descriptions of the functional units involved in the transmission rate control device provided in this embodiment, reference can be made to Figure 1 The corresponding description will not be repeated here.
[0081] Based on the above Figure 1 The method shown in the embodiment also provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 The method shown.
[0082] Based on the above Figure 1 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 The method shown.
[0083] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0084] Based on the above Figure 1 The method shown, and Figure 3 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, such as a smart phone, a tablet computer, a drone, a smart robot and other smart terminals, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The method shown.
[0085] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0086] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0087] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0088] Through the description of the above implementation methods, the technicians in this field can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the scheme of this embodiment, the message queue of the first direction in the data path can be first identified, and the first direction represents the data transmission direction from the hardware circuit to the virtual switch; then the message occupancy rate in the message queue is calculated; finally, if the message occupancy rate reaches the first threshold, the data transmission rate of the hardware circuit to the virtual switch is adjusted. In the technical scheme of the present application, when the smart network card receives a large number of data packets, the number of data packets that need to be transmitted to the virtual switch increases, blocking the communication line between the hardware circuit and the virtual switch. The technical scheme of the present application calculates the message occupancy rate of the message queue transmitted in the communication line, so that when the message occupancy rate reaches a certain number, the data transmission rate between the hardware circuit and the virtual switch can be adjusted to avoid the problem of data packet blocking in the data transmission direction from the hardware circuit to the virtual switch, thereby ensuring the normal operation of the smart network card.
[0089] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0090] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. A transmission rate control method, characterized in that: include: Identify a message queue of a first direction in a data path, the first direction representing a data transmission direction from a hardware circuit in the smart network card to a virtual switch, the hardware circuit being used for hardware unloading of operation data in the virtual switch; Calculating the message occupancy rate in the message queue; If the message occupancy rate reaches a first threshold, the data transmission rate of the hardware circuit to the virtual switch is adjusted.
2. The method according to claim 1, characterized in that The adjusting the data transmission rate of the hardware circuit to the virtual switch includes: Adjusting the data transmission rate of the hardware circuit to the virtual switch to a preset rate value, wherein the preset rate value is a minimum data transmission rate; Monitoring the message occupancy rate in the message queue; The data transmission rate is increased according to the attenuation coefficient of the message occupancy rate.
3. The method according to claim 1, characterized in that Prior to identifying the message queue of the first direction in the data path, the method further includes: Identify characteristic data of the data packet to be processed; Searching for the characteristic data in a first flow table stored in the hardware circuit; If the characteristic data does not exist in the first flow table, the data packet to be processed is uploaded to a message queue in the data path between the hardware circuit and the virtual switch.
4. The method according to claim 3, characterized in that After searching the first flow table stored in the hardware circuit for the characteristic data, the method further includes: If the characteristic data exists in the first flow table, the data packet to be processed is forwarded according to a forwarding path corresponding to the characteristic data.
5. The method according to claim 3, characterized in that: After adjusting the data transmission rate of the hardware circuit to the virtual switch, the method further includes: According to the adjusted data transmission rate, transmitting the to-be-processed data packet to the virtual switch; Determining a characteristic type of the data packet to be processed according to the characteristic data; Determining a target forwarding path for the feature type based on the forwarding path in the second flow table of the virtual switch; The target forwarding path is transmitted to the first flow table through a data path from the virtual switch to the hardware circuit.
6. The method according to claim 5, characterized in that The transmitting the target forwarding path to the first flow table includes: Extracting the target forwarding path; Establishing a corresponding relationship between the target forwarding path and the characteristic data; The corresponding target forwarding path and the characteristic data are stored in the first flow table.
7. A transmission rate control device, characterized in that: include: an identification module, configured to identify a message queue of a first direction in a data path, wherein the first direction represents a data transmission direction from a hardware circuit in the smart network card to a virtual switch, wherein the hardware circuit is used for hardware unloading of operation data in the virtual switch; A calculation module, used to calculate the message occupancy rate in the message queue; The adjustment module is used to adjust the data transmission rate of the hardware circuit to the virtual switch if the message occupancy rate reaches a first threshold.
8. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
