Data Flow Control Method, Apparatus, Device, and Storage Medium

By introducing counters to monitor the available number of RDMA memory blocks at the sending and receiving ends, the congestion problem caused by the lack of flow control mechanism on the Ethernet is solved, and the network communication delay is reduced.

CN115665046BActive Publication Date: 2025-08-01SHENZHEN KINGDOM TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211158109.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2025-08-01
Estimated Expiration
2042-09-22

AI Technical Summary

Technical Problem

In the prior art, RDMA lacks a flow control mechanism on Ethernet, which causes the sender to be unable to know when the receiving end is congested, resulting in a sharp increase in communication delay and unable to meet the ultra-low communication delay requirements.

Method used

By introducing counters at the sending and receiving ends, monitoring the available number of RDMA memory blocks, controlling the transmission and update of data packets, and realizing flow control.

Benefits of technology

It effectively avoids congestion on the receiver, reduces the communication delay of network communication, and meets the demand for ultra-low communication delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665046B_ABST
    Figure CN115665046B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network communication technologies, and discloses a data flow control method, apparatus, device, and storage medium. The method includes: obtaining a first quantity, where the first quantity is the number of data packets that can be currently sent; determining whether the first quantity is greater than a first preset threshold; if so, sending a data packet to a receiving end, and performing real-time update on the first quantity when the data packet is successfully sent; when it is detected that the updated first quantity is less than or equal to the first preset threshold, suspending sending data packets to the receiving end. Compared with the prior art in which complex mechanisms with relatively high communication delays such as sliding windows and congestion queues are used for network communication, the above method of the present invention solves the problem in the prior art that network congestion during network communication leads to an increase in communication delay, thereby realizing the functions of congestion intervention and traffic control between network nodes, and further reducing the communication delay of network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technologies, and in particular, to a data flow control method, apparatus, device, and storage medium. Background Art

[0002] With the development of network communication technologies, people have higher and higher requirements for communication latency in the network communication process. At present, the industry mainly adopts the RDMA (Remote Direct Memory Access) technology to reduce the communication latency in the network communication process. This technology requires the receiving end to have available memory blocks pre-allocated in advance, and realizes it through mechanisms such as sliding windows and congestion queues.

[0003] However, RDMA does not have a flow control mechanism on Ethernet. When congestion occurs at the receiving end, the sending end is unaware. At this time, if the sending end has data to send, it will keep performing the sending action to the receiving end, resulting in increased congestion at the receiving end, a decline in the overall system processing performance, severe jitter, spikes, and a sharp increase in communication latency. In the absence of congestion, the communication latency is 10 - 20 us. If congestion occurs, the maximum communication latency will increase to more than 1 s, which is unacceptable for some industries that require ultra-low communication latency (such as nanosecond-level communication latency) to carry out work (such as the securities trading industry). Therefore, there is an urgent need in the industry for a simple and efficient data flow control method to solve the problem of increased communication latency caused by network congestion in the current network communication process.

[0004] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main object of the present invention is to provide a data flow control method, apparatus, device, and storage medium, aiming to solve the problem of increased communication latency caused by network congestion in the prior art during network communication.

[0006] To achieve the above object, the present invention provides a data flow control method, which is applied to a sending end. The method includes the following steps:

[0007] Obtain a first quantity, where the first quantity is the number of currently sendable data packets;

[0008] Determine whether the first quantity is greater than a first preset threshold;

[0009] If so, send a data packet to the receiving end, and update the first quantity in real time when the data packet is successfully sent;

[0010] When it is detected that the updated first quantity is less than or equal to the first preset threshold, suspend sending data packets to the receiving end.

[0011] Optionally, if so, send a data packet to the receiving end, and when the data packet is successfully sent, update the first quantity in real time, including:

[0012] If so, send a data packet to the receiving end, and the quantity of the data packet is less than or equal to the current first quantity;

[0013] When the data packet is successfully sent, subtract the quantity of the sent packets from the first quantity, where the quantity of the sent packets is the quantity of the data packets sent this time.

[0014] Optionally, after suspending sending data packets to the receiving end when it is detected that the updated first quantity is less than or equal to the first preset threshold, it further includes:

[0015] Add the updated first quantity to the second quantity of the receiving end, and use the added quantity as the new first quantity, where the second quantity is the quantity of data packets that can be updated currently;

[0016] When it is detected that the new first quantity is greater than the first preset threshold, continue to send data packets to the receiving end.

[0017] In addition, to achieve the above object, the present invention further provides a data flow control method, which is applied to the receiving end, and the method includes the following steps:

[0018] Receive the data packets sent by the sending end, and obtain the third quantity of the sending end from the data packets, where the third quantity is the quantity of RDMA memory blocks that can be increased currently;

[0019] Based on the third quantity, update the second quantity and the fourth quantity in real time, where the second quantity is the quantity of data packets that can be updated by the sending end currently, and the fourth quantity is the quantity of RDMA memory blocks currently;

[0020] When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, so that the sending end updates the first quantity based on the update data packet, where the first quantity is the quantity of data packets that the sending end can send.

[0021] Optionally, the real-time update of the second quantity and the fourth quantity based on the third quantity includes:

[0022] When the data packet is successfully received, update the fourth quantity to the sum of the currently stored fourth quantity locally and the third quantity corresponding to the current data packet, and add the received packet quantity to the second quantity, where the received packet quantity is the quantity of the data packet received this time.

[0023] Optionally, when it is detected that the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, send an update data packet to the sending end so that the sending end updates the first quantity based on the update data packet, including:

[0024] When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, where the update data packet contains the current third quantity, so that the sending end updates the first quantity to the sum of the currently stored first quantity locally and the current third quantity and adds 1 to the second quantity;

[0025] When the update data packet is successfully sent, set the third quantity to the third preset threshold.

[0026] In addition, to achieve the above object, the present invention also proposes a data flow control device applied to the sending end, and the data flow control device includes:

[0027] A data acquisition module for acquiring a first quantity, where the first quantity is the quantity of data packets that can be sent currently;

[0028] A data judgment module for judging whether the first quantity is greater than the first preset threshold;

[0029] A data sending module for, if so, sending a data packet to the receiving end and updating the first quantity in real time when the data packet is successfully sent;

[0030] A data control module for pausing to send data packets to the receiving end when it is detected that the updated first quantity is less than or equal to the first preset threshold.

[0031] In addition, to achieve the above object, the present invention also proposes a data flow control device applied to the receiving end, and the data flow control device includes:

[0032] A data receiving module for receiving a data packet sent by the sending end and acquiring the third quantity of the sending end from the data packet, where the third quantity is the quantity of RDMA memory blocks that can be increased currently;

[0033] A data update module, configured to update the second quantity and the fourth quantity in real time based on the third quantity, where the second quantity is the number of data packets that can be updated by the sending end currently, and the fourth quantity is the number of current RDMA memory blocks;

[0034] A data detection module, configured to send an update data packet to the sending end when it detects that the updated second quantity is greater than or equal to a second preset threshold and the fourth quantity is greater than a first preset threshold, so that the sending end updates the first quantity based on the update data packet, where the first quantity is the number of data packets that the sending end can send.

[0035] In addition, to achieve the above object, the present invention further provides a data flow control device, where the device includes: a memory, a processor, and a data flow control program stored on the memory and executable on the processor, and the data flow control program is configured to implement the steps of the data flow control method as described above.

[0036] In addition, to achieve the above object, the present invention further provides a storage medium, where a data flow control program is stored on the storage medium, and when the data flow control program is executed by a processor, it implements the steps of the data flow control method as described above.

[0037] The present invention obtains a first quantity, where the first quantity is the number of data packets that can be sent currently, determines whether the first quantity is greater than a first preset threshold. If so, it sends a data packet to the receiving end and updates the first quantity in real time when the data packet is successfully sent. When it detects that the updated first quantity is less than or equal to the first preset threshold, it suspends sending data packets to the receiving end. Compared with the prior art, where complex mechanisms with relatively high communication delays such as sliding windows and congestion queues are used for network communication, the above method of the present invention monitors the available quantity of RDMA memory blocks at the sending end and the receiving end during the network communication process by introducing a counter, and controls whether the sending end sends a data packet to the receiving end based on the quantity of the above RDMA memory blocks, solving the problem of increased communication delay caused by network congestion during network communication in the prior art, thereby realizing the functions of congestion intervention and traffic control between network nodes, and further reducing the communication delay of network communication. Description of the Drawings

[0038] Figure 1 It is a schematic structural diagram of a data flow control device for the hardware operating environment related to the solution of the embodiment of the present invention;

[0039] Figure 2 It is a schematic flowchart of the first embodiment of the data flow control method of the present invention;

[0040] Figure 3 It is a schematic flowchart of the second embodiment of the data flow control method of the present invention;

[0041] Figure 4 This is the first timing diagram of data transmission for the data flow control method of the present invention;

[0042] Figure 5 This is a schematic flowchart of the third embodiment of the data flow control method of the present invention;

[0043] Figure 6 This is the second timing diagram of data transmission for the data flow control method of the present invention;

[0044] Figure 7 This is a structural block diagram of the first embodiment of the data flow control device of the present invention;

[0045] Figure 8 This is a structural block diagram of the second embodiment of the data flow control device of the present invention.

[0046] The realization, functional features, and advantages of the objectives of the present invention will be further described with reference to the embodiments and the accompanying drawings. Specific embodiments

[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] Refer to Figure 1 , Figure 1 This is a schematic structural diagram of a data flow control device in the hardware operating environment related to the embodiment solution of the present invention.

[0049] As Figure 1 shown, the data flow control device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless-fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0050] Those skilled in the art can understand, Figure 1The structure shown does not constitute a limitation on the data flow control device, which may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0051] As Figure 1 shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and a data flow control program.

[0052] In Figure 1 the data flow control device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the data flow control device of the present invention may be arranged in the data flow control device, and the data flow control device calls the data flow control program stored in the memory 1005 through the processor 1001 and executes the data flow control method provided by the embodiments of the present invention.

[0053] Embodiments of the present invention provide a data flow control method. Referring to Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of the data flow control method of the present invention.

[0054] In this embodiment, the data flow control method includes the following steps:

[0055] Step S10: Obtain a first quantity, where the first quantity is the number of data packets that can be sent currently.

[0056] It should be noted that the execution subject of the method in this embodiment may be a computing service device with data processing, network communication, and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or other electronic devices that can implement the same or similar functions. This embodiment does not limit this. Here, a personal computer will be used as an example to illustrate the various embodiments of the data flow control method of the present invention.

[0057] It can be understood that the above-mentioned first quantity refers to the value obtained from the first counter, and the first counter is used to record the number of data packets that the sending end can send currently. It can be a synchronous counter or an asynchronous counter. This embodiment does not limit this.

[0058] It should be understood that the above-mentioned data packet refers to a data unit in network communication, which can be stored in an RDMA (Remote Direct Memory Access) memory block, and one memory block corresponds to one data packet.

[0059] Step S20: Determine whether the first quantity is greater than a first preset threshold.

[0060] It should be noted that the above first preset threshold does not have a practical meaning and is only used for comparing numerical magnitudes. The first preset threshold can be custom-set according to requirements. It can be 0 or any other natural number.

[0061] Step S30: If so, send a data packet to the receiving end, and update the first quantity in real time when the data packet is successfully sent.

[0062] It should be understood that the receiving end can be a computing service device with data processing, network communication, and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or other electronic devices that can achieve the same or similar functions. This embodiment does not limit this.

[0063] It can be understood that during the process of sending data packets to the receiving end, every time a data packet is successfully sent, the above first quantity needs to be updated.

[0064] Furthermore, in order to determine the updated first quantity and thus determine the current number of data packets that can be sent, step S30 in this embodiment may include:

[0065] Step S301: If so, send a data packet to the receiving end, and the number of the data packets is less than or equal to the current first quantity.

[0066] It should be noted that during the actual packet sending process, the number of data packets should be less than or equal to the current first quantity. For example, in one packet sending, the current first quantity is 64, which means the current number of data packets that can be sent is 64, that is, the data packets sent by the sending end to the receiving end cannot exceed 64, that is, less than or equal to 64.

[0067] Step S302: When the data packet is successfully sent, subtract the number of packets sent from the first quantity, and the number of packets sent is the number of data packets sent this time.

[0068] It can be understood that during the packet sending process, every time the sending end sends a data packet, it is equivalent to the receiving end receiving a data packet, and every time the receiving end receives a data packet, it needs to occupy a memory block. Therefore, when the above data packet is successfully sent, the maximum number of data packets that the receiving end can currently receive can be confirmed by subtracting the number of packets sent from the first quantity, so as to monitor whether the receiving end is congested.

[0069] Step S40: When it is detected that the updated first quantity is less than or equal to the first preset threshold, suspend sending data packets to the receiving end.

[0070] It should be understood that when the updated first quantity is less than or equal to the first preset threshold, it indicates that the memory blocks in the receiving end have been fully occupied and cannot continue to receive data packets. Therefore, network congestion in the receiving end can be avoided by pausing the transmission of data packets.

[0071] Further, in order for the sending end to continue sending data packets to the receiving end when there are free memory blocks in the receiving end, after step S40 in this embodiment, the following steps may further be included:

[0072] Step S50: Add the updated first quantity to the second quantity of the receiving end, and use the added quantity as the new first quantity, where the second quantity is the current quantity of data packets that can be updated.

[0073] It should be noted that the above-mentioned second quantity refers to the value obtained from the second counter. The second counter is used to record the current quantity of data packets that can be updated at the sending end. It can be a synchronous counter or an asynchronous counter, and this embodiment does not limit this.

[0074] Step S60: When it is detected that the new first quantity is greater than the first preset threshold, continue to send data packets to the receiving end.

[0075] It can be understood that when the new first quantity is greater than the first preset threshold, it indicates that there are free memory blocks in the receiving end at this time to store data packets. Therefore, at this time, the sending end can send data packets to the receiving end.

[0076] In this embodiment, by obtaining the first quantity, where the first quantity is the current quantity of data packets that can be sent, it is determined whether the first quantity is greater than the first preset threshold. If so, data packets are sent to the receiving end, and the first quantity is updated in real time when the data packets are successfully sent. When it is detected that the updated first quantity is less than or equal to the first preset threshold, the transmission of data packets to the receiving end is paused. Compared with the prior art, in which complex mechanisms with relatively high communication delays such as sliding windows and congestion queues are used for network communication, the method in this embodiment monitors the available quantity of RDMA memory blocks at the sending end and the receiving end during the network communication process by introducing a counter, and controls whether the sending end sends data packets to the receiving end based on the quantity of the above-mentioned RDMA memory blocks, solving the problem of increased communication delay caused by network congestion during network communication in the prior art, thereby realizing the functions of congestion intervention and traffic control between network nodes, and further reducing the communication delay of network communication.

[0077] Reference Figure 3 , Figure 3 is a schematic flowchart of the second embodiment of the data flow control method of the present invention.

[0078] In this embodiment, the data flow control method includes the following steps:

[0079] Step S100: Receive the data packet sent by the sending end, and obtain the third quantity of the sending end from the data packet, where the third quantity is the number of RDMA memory blocks that can be increased currently.

[0080] It should be noted that the above-mentioned third quantity refers to the value obtained from the third counter, and the above-mentioned third counter is used to record the number of RDMA memory blocks that can be increased currently at the receiving end. It can be a synchronous counter or an asynchronous counter, and this embodiment does not limit this.

[0081] Step S200: Update the second quantity and the fourth quantity in real time based on the third quantity, where the second quantity is the number of data packets that can be updated currently at the sending end, and the fourth quantity is the number of current RDMA memory blocks.

[0082] It can be understood that the above-mentioned fourth quantity refers to the value obtained from the fourth counter, and the above-mentioned fourth counter is used to record the number of current RDMA memory blocks at the receiving end. It can be a synchronous counter or an asynchronous counter, and this embodiment does not limit this.

[0083] Reference Figure 4 , Figure 4 is the first timing diagram of data transmission of the data flow control method of the present invention.

[0084] As Figure 4 shown, the A end in the figure is the sending end, and the B end is the receiving end: send_comps in the A end is the first quantity (i.e., the value in the first counter), send_update in the B end is the second quantity (i.e., the value in the second counter), send_update in the A end is the third quantity (i.e., the value in the third counter), and send_comps in the B end is the fourth quantity (i.e., the value in the fourth counter). Figure 4 A specific scenario of data transmission is given. The sending end continuously sends 3 data packets to the receiving end. After each data packet is sent, the first quantity is decreased by 1. When 3 data packets are sent, the first quantity is set to 61, and the third quantity is set to 0. When the receiving end receives 3 data packets, since the received third quantity is all 0, at this time the fourth quantity is 64 and the third quantity is 3. Subsequently, the receiving end sends a data packet to the sending end, and this data packet carries the second quantity of the receiving end. After sending, the fourth quantity is decreased by 1 and set to 63; the second quantity is set to 0. After the sending end receives the data packet, it takes out the second quantity, and the first quantity is updated to 61 + 3 = 64. The above scenario is only used to illustrate the timing diagram of data transmission and is not used for limitation. Other scenarios of data transmission are also applicable to this embodiment and will not be elaborated here.

[0085] Step S300: When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, so that the sending end updates the first quantity based on the update data packet, where the first quantity is the number of data packets that the sending end can send.

[0086] It should be noted that the above second preset threshold does not have a practical meaning and is only used for numerical comparison. The second preset threshold can be custom-set according to requirements. It can be 0 or any other natural number.

[0087] It can be understood that when the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, it indicates that the sending end has accumulated a certain number of unupdated data packets at this time.

[0088] In this embodiment, by receiving the data packets sent by the sending end, obtaining the third quantity of the sending end from the data packets, and then updating the second quantity and the fourth quantity in real time based on the third quantity. Finally, when it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, an update data packet is sent to the sending end, so that the sending end updates the first quantity based on the update data packet. The above method in this embodiment monitors the available quantity of the RDMA memory blocks of the sending end and the receiving end in the network communication process by introducing a counter, and controls the sending end to update the data packets based on the quantity of the above RDMA memory blocks, solving the problem that in the existing technology network communication process, the sending end cannot predict the occupancy situation of the RDMA memory blocks of the receiving end and continuously sends data packets, thereby avoiding congestion at the receiving end and further reducing the communication delay of the network communication.

[0089] Reference Figure 5 , Figure 5 is a schematic flowchart of the third embodiment of the data flow control method of the present invention.

[0090] Based on the above embodiments, in this embodiment, in order to update the second quantity and the fourth quantity in real time, step S200 may include:

[0091] Step S201: When the data packet is successfully received, update the fourth quantity to the sum of the current fourth quantity stored locally and the third quantity corresponding to the current data packet, and add the packet receiving quantity to the second quantity, where the packet receiving quantity is the number of data packets received this time.

[0092] Further, based on the above embodiments, in this embodiment, in order to enable the sender to update the data packet when the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, step S300 may include:

[0093] Step S301: When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, send an update data packet to the sender, where the update data packet contains the current third quantity, so that the sender updates the first quantity to the sum of the currently stored first quantity locally and the current third quantity and increments the second quantity by 1.

[0094] Step S302: When the update data packet is successfully sent, set the third quantity to the third preset threshold.

[0095] It should be noted that the above third preset threshold can be custom-set according to requirements. It can be 0 or any other natural number.

[0096] Reference Figure 6 , Figure 6 is the second timing diagram of data transmission for the data flow control method of the present invention.

[0097] As Figure 6 shown, in the figure, end A is the sender and end B is the receiver: send_comps in end A is the first quantity (i.e., the value in the first counter), send_update in end B is the second quantity (i.e., the value in the second counter), send_update in end A is the third quantity (i.e., the value in the third counter), and send_comps in end B is the fourth quantity (i.e., the value in the fourth counter). Figure 6 A specific scenario of data transmission is given. The sender continuously sends 32 data packets, the first quantity is set to 32, and the third quantity is set to 0. When the receiver receives the data packet, the second quantity is updated to 32 and the fourth quantity is set to 64. Assume that the first preset threshold is 0 and the second preset threshold is 0.5. The calculation method of the above second preset threshold is the current second quantity divided by the total number of initial RDMA memory blocks. Then at this time, the receiver detects that the current fourth quantity is greater than 0 and the current second quantity 32 divided by the total number of initial RDMA memory blocks 64 is equal to 0.5, then sends an update data packet to the sender, and sets the second quantity to 0 after successful sending. When the sender receives the data packet, it updates the first quantity to 32 + 32 = 64 and increments the third quantity by 1. The above scenario is only used to illustrate the timing diagram of data transmission and is not used for limitation. Other data transmission scenarios are also applicable to this embodiment and will not be elaborated here.

[0098] In this embodiment, it is determined whether to send an update data packet to the sending end according to whether the updated second quantity is greater than or equal to the second preset threshold and whether the updated fourth quantity is greater than the first preset threshold, so that the sending end sends the data packet on the premise that the receiving end has the reception condition. Compared with the prior art in which the sending end in network communication cannot predict the occupation situation of the RDMA memory block at the receiving end and continuously sends data packets, the above method in this embodiment can monitor the occupation situation of the RDMA memory block at the receiving end in real time, thus avoiding congestion at the receiving end and further reducing the communication delay of network communication.

[0099] In addition, an embodiment of the present invention further provides a storage medium, on which a data flow control program is stored. When the data flow control program is executed by a processor, the steps of the data flow control method as described above are implemented.

[0100] Refer to Figure 7 , Figure 7 which is a structural block diagram of the first embodiment of the data flow control device of the present invention.

[0101] As Figure 7 shown, the data flow control device proposed in the embodiment of the present invention includes:

[0102] A data acquisition module 701, configured to acquire a first quantity, where the first quantity is the number of data packets that can be sent currently;

[0103] A data judgment module 702, configured to judge whether the first quantity is greater than a first preset threshold;

[0104] A data sending module 703, configured to, if so, send a data packet to the receiving end, and update the first quantity in real time when the data packet is successfully sent;

[0105] A data control module 704, configured to pause sending data packets to the receiving end when it is detected that the updated first quantity is less than or equal to the first preset threshold.

[0106] The present invention obtains a first quantity, where the first quantity is the number of data packets that can be sent currently, determines whether the first quantity is greater than a first preset threshold. If so, it sends data packets to the receiving end and updates the first quantity in real time when the data packets are successfully sent. When it is detected that the updated first quantity is less than or equal to the first preset threshold, sending data packets to the receiving end is paused. Compared with the prior art where complex mechanisms with relatively high communication delays such as sliding windows and congestion queues are used for network communication, the above method of the present invention monitors the available quantity of RDMA memory blocks at the sending end and the receiving end during the network communication process by introducing a counter, and controls whether the sending end sends data packets to the receiving end based on the quantity of the above RDMA memory blocks, solving the problem of increased communication delay caused by network congestion during the network communication process in the prior art, thereby realizing the functions of congestion intervention and traffic control between network nodes, and further reducing the communication delay of network communication.

[0107] Refer to Figure 8 , Figure 8 which is a structural block diagram of a second embodiment of the data flow control device of the present invention.

[0108] As Figure 8 shown, the data flow control device proposed in the embodiment of the present invention includes:

[0109] A data receiving module 801, configured to receive data packets sent by a sending end, and obtain a third quantity of the sending end from the data packets, where the third quantity is the number of RDMA memory blocks that can be increased currently;

[0110] A data updating module 802, configured to update a second quantity and a fourth quantity in real time based on the third quantity, where the second quantity is the number of data packets that the sending end can update currently, and the fourth quantity is the number of current RDMA memory blocks;

[0111] A data detecting module 803, configured to send an update data packet to the sending end when it is detected that the updated second quantity is greater than or equal to a second preset threshold and the fourth quantity is greater than the first preset threshold, so that the sending end updates a first quantity based on the update data packet, where the first quantity is the number of data packets that the sending end can send.

[0112] In this embodiment, by receiving the data packets sent by the sending end, obtaining the third quantity of the sending end from the data packets, then updating the second quantity and the fourth quantity in real time based on the third quantity, and finally when it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, sending an update data packet to the sending end, so that the sending end updates the first quantity based on the update data packet. The above method in this embodiment monitors the available quantity of RDMA memory blocks of the sending end and the receiving end in the network communication process by introducing a counter, and controls the sending end to update the data packets based on the quantity of the above RDMA memory blocks, solving the problem in the prior art that the sending end cannot predict the occupation situation of the RDMA memory blocks of the receiving end and continuously sends data packets, thereby avoiding congestion at the receiving end and further reducing the communication delay of the network communication.

[0113] For other embodiments or specific implementation manners of the data flow control device of the present invention, reference may be made to the above method embodiments, which will not be elaborated herein.

[0114] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including the element.

[0115] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.

[0116] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0117] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.

Claims

1. A data flow control method, characterized in that, When the method is applied to the receiving end, the method includes the following steps: Receive the data packet sent by the sending end, and obtain the third quantity of the sending end from the data packet, where the third quantity is the number of RDMA memory blocks that can be increased currently; Update the second quantity and the fourth quantity in real time based on the third quantity, where the second quantity is the number of data packets that the sending end can update currently, and the fourth quantity is the number of current RDMA memory blocks; When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, so that the sending end updates the first quantity based on the update data packet, where the first quantity is the number of data packets that the sending end can send; 2. The data flow control method according to claim 1, wherein The real-time update of the second quantity and the fourth quantity based on the third quantity includes: When the data packet is received successfully, update the fourth quantity to the sum of the current fourth quantity stored locally and the third quantity corresponding to the current data packet, and add the number of received packets to the second quantity, where the number of received packets is the number of data packets received this time; 3. The data flow control method according to claim 1, wherein, The step of, when it is detected that the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, so that the sending end updates the first quantity based on the update data packet, includes: When it is detected that the updated second quantity is greater than or equal to the second preset threshold and the updated fourth quantity is greater than the first preset threshold, send an update data packet to the sending end, where the update data packet contains the current third quantity, so that the sending end updates the first quantity to the sum of the current first quantity stored locally and the current third quantity and adds 1 to the second quantity; When the update data packet is sent successfully, set the third quantity to the third preset threshold; 4. A data flow control device, characterized in that, Applied to the receiving end, the data flow control device includes: A data receiving module, configured to receive the data packet sent by the sending end, and obtain the third quantity of the sending end from the data packet, where the third quantity is the number of RDMA memory blocks that can be increased currently; A data update module, configured to update the second quantity and the fourth quantity in real time based on the third quantity, where the second quantity is the number of data packets that the sending end can update currently, and the fourth quantity is the number of current RDMA memory blocks; A data detection module, configured to send an update data packet to the sending end when it is detected that the updated second quantity is greater than or equal to the second preset threshold and the fourth quantity is greater than the first preset threshold, so that the sending end updates the first quantity based on the update data packet, where the first quantity is the number of data packets that the sending end can send; 5. A data flow control device, characterized in that, The device includes: a memory, a processor, and a data flow control program stored on the memory and executable on the processor, where the data flow control program is configured to implement the steps of the data flow control method according to any one of claims 1 to 3.

6. A storage medium, characterized in that, A data flow control program is stored on the storage medium, and when the data flow control program is executed by a processor, the steps of the data flow control method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method and system for conditional interrupts

    US20130054858A1