A RDMA-based packet retransmission method, device and medium

CN123019977APending Publication Date: 2026-10-30SHANGHAI YUNMAI XINLIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611435163.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]但是,当发送端RDMA网卡接收到NAK报文或达到RTO阈值时需要重传当前已发送但未被确认的所有数据报文,会导致有效吞吐量随丢包率的提升呈非线性急剧下降;接收端在检测到报文乱序时,通常需要等待乱序超时后才发送SACK报文,在此期间,发送端迫进入空闲等待状态,导致发送端在接收到SACK报文前的空闲占比较高,降低了有效吞吐;并且,丢包引发的恢复协商及重传过程会引入微秒至毫秒级的额外延迟,受重传策略及链路速率的综合影响,丢包事件发生后的整体数据传输延迟可能是平均延迟的10至1000倍;因此可知,通过上述方法进行数据报文重传,有效吞吐率较低,数据传输的长尾延迟较高

Benefits of technology

[0014]本申请提供了一种基于RDMA的报文重传方法、设备及介质,在所述方法中,当发送端RDMA网卡通过队列对发送正常数据报文时,获取该队列对当前对应的未确认报文数量gap;当gap>QPC时,基于该队列对对应的最大重传数量,从当前发送端RDMA网卡通过该队列对发出的,但未被接收端RDMA网卡确认收到的数据报文中,确定待重传数据报文,并基于预设的窗口阈值增加步长对QPC进行更新,其中,QPC为该队列对对应的等待确认的窗口的长度阈值;将待重传数据报文进行重传,并在发送端RDMA网卡接收到新的ACK报文时,基于预设的最小窗口长度值和预设的窗口阈值恢复系数对QPC进行更新。可知,本申请引入了动态的等待确认的窗口的长度阈值和未确认报文数量作为重传触发条件,使得发送端无需完全被动等待NAK、SACK报文或RTO超时即可及时响应网络异常,主动触发重传;同时,通过最大重传数量确定待重传报文,有效规避了盲目重传引发的重传风暴及发送端无效空闲,显著降低了数据传输的长尾延迟,提升了有效吞吐率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123019977A_ABST
    Figure CN123019977A_ABST
Patent Text Reader

Abstract

The application provides an RDMA-based packet retransmission method and device and a medium, and relates to the field of RDMA.The method comprises the following steps: when a sending end RDMA network card sends normal data packets through a queue pair, obtaining the number of unconfirmed packets corresponding to the queue pair at present, gap;if gap>QPC, determining the data packets to be retransmitted from the data packets sent through the queue pair at present but not confirmed by a receiving end RDMA network card based on the maximum retransmission number corresponding to the queue pair, and updating QPC based on a preset window threshold increase step, wherein QPC is the length threshold of the window to be confirmed corresponding to the queue pair;retransmitting the data packets to be retransmitted, and updating QPC based on a preset minimum window length value and a preset window threshold recovery coefficient when a new ACK packet is received by the sending end RDMA network card; and the long tail delay of data transmission is reduced, and the effective throughput is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of RDMA, and in particular to a message retransmission method, device and medium based on RDMA. Background Technology

[0002] Remote Direct Memory Access (RDMA) is a technology that allows servers to directly transfer data to each other's memory. Because it does not require operating system kernel intervention, it can significantly reduce latency and increase data throughput. During RDMA transmission, if data packet transmission errors, packet loss, or sequence number abnormalities occur, the data packets must be retransmitted. In existing technologies, the triggering and execution strategies of retransmission mechanisms are generally divided into two categories: one is triggering retransmission based on the Go-back-N strategy when the sending end's RDMA network card receives a Negative Acknowledgment (NAK) message or reaches the Retransmission Timeout (RTO) threshold; the other is triggering selective retransmission for specific lost packets when a Selective Acknowledgment (SACK) message is received.

[0003] However, when the sending RDMA network card receives a NAK message or reaches the RTO threshold, it needs to retransmit all currently sent but unacknowledged data packets, causing the effective throughput to decrease sharply and non-linearly with the increase of packet loss rate. When the receiving end detects out-of-order packets, it usually needs to wait for the out-of-order timeout before sending a SACK message. During this period, the sending end is forced into an idle waiting state, resulting in a high idle ratio before the sending end receives the SACK message, which reduces the effective throughput. Furthermore, the recovery negotiation and retransmission process caused by packet loss introduces additional delays of microseconds to milliseconds. Due to the combined effects of retransmission strategy and link rate, the overall data transmission delay after a packet loss event may be 10 to 1000 times the average delay. Therefore, it can be seen that the above method for data packet retransmission has a low effective throughput and a high long-tail delay in data transmission. Summary of the Invention

[0004] To address the aforementioned technical problem, the technical solution adopted in this application is as follows:

[0005] According to a first aspect of this application, a message retransmission method based on RDMA is provided, the method comprising the following steps:

[0006] S1. When the sending RDMA network card sends normal data packets through a queue pair, obtain the current number of unacknowledged packets (gap) corresponding to that queue pair; normal data packets are non-retransmitted data packets; gap meets the following conditions:

[0007] gap = SPSN - APSN; SPSN is the sequence number of the last data packet sent by the current sending RDMA network card through this queue; APSN is the sequence number of the last data packet continuously acknowledged by the current receiving RDMA network card through this queue.

[0008] S2. When gap > QPC, based on the maximum retransmission count corresponding to the queue pair, determine the data packets to be retransmitted from the data packets sent by the current sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card, and update QPC by increasing the step size based on the preset window threshold; QPC is the length threshold of the window waiting for acknowledgment corresponding to the queue pair, and the initial value of the length threshold of the window waiting for acknowledgment is the preset length threshold.

[0009] S3. Retransmit the data packets to be retransmitted.

[0010] S4. When the sending end RDMA network card receives a new ACK message, the QPC is updated based on the preset minimum window length value and the preset window threshold recovery coefficient.

[0011] According to a second aspect of this application, a non-transitory computer-readable storage medium is provided, which stores at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described RDMA-based message retransmission method.

[0012] According to a third aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0013] This application has at least the following beneficial effects:

[0014] This application provides a message retransmission method, device, and medium based on RDMA. In the method, when the sending RDMA network card sends a normal data message through a queue pair, the number of unacknowledged messages corresponding to the queue pair, gap, is obtained. When gap > QPC, based on the maximum retransmission number corresponding to the queue pair, data messages to be retransmitted are determined from the data messages sent by the sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card. The QPC is updated by increasing the step size based on a preset window threshold, where QPC is the length threshold of the waiting window for acknowledgment corresponding to the queue pair. The data messages to be retransmitted are retransmitted, and when the sending RDMA network card receives a new ACK message, the QPC is updated based on a preset minimum window length value and a preset window threshold recovery coefficient. As can be seen, this application introduces a dynamic threshold for the length of the waiting confirmation window and the number of unacknowledged packets as retransmission triggering conditions, so that the sender does not need to passively wait for NAK, SACK packets or RTO timeouts to respond to network anomalies in a timely manner and actively trigger retransmissions. At the same time, by determining the packets to be retransmitted through the maximum number of retransmissions, the retransmission storm caused by blind retransmissions and the invalid idle time of the sender are effectively avoided, significantly reducing the long tail delay of data transmission and improving the effective throughput. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart of a message retransmission method based on RDMA provided for embodiments of this application. Detailed Implementation

[0017] The technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] It is worth noting that in the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary details.

[0019] It should be understood that in this application specification and the appended claims, the terms "comprising," "including," "including but not limited to," "including but not limited to," "mainly composed of," or "mainly made of" all indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0020] It should be understood that in this application specification and the appended claims, the use of the terms "consisting of" or "component of" indicates the presence of the described feature, integral, step, operation, element and / or component, but excludes the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0021] It should be understood that, in this specification and the appended claims, the term "and" indicates a combination in which multiple of the associated listed items exist simultaneously. For example, "A, B, C, and D" means a combination in which "A and B and C and D exist simultaneously".

[0022] It should be understood that in this application specification and the appended claims, the use of the term "or" indicates a combination in which one of the associated listed items exists alone. For example, "A, B, C or D" refers to the four combinations of "A alone", "B alone", "C alone", and "D alone".

[0023] It should be understood that, in this application specification and the appended claims, the term "and / or" indicates any combination of one or more of the associated listed items, as well as all possible combinations, and includes such combinations. For example, "A and / or B" refers to the three combinations of "A alone," "B alone," or "A and B simultaneously." For example, "A, B, and / or C" refers to the seven combinations of "A alone," "B alone," "C alone," "A and B simultaneously," "A and C simultaneously," "B and C simultaneously," and "A, B, and C simultaneously."

[0024] It should be understood that, in this specification and the appended claims, the term "if" is used to indicate, depending on the context, "in the case of," "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0025] It should be understood that in this application specification and the appended claims, the terms "greater than", "less than", "exceeding", etc. are understood to exclude the number itself; and the terms "above", "below", "within", etc. are understood to include the number itself.

[0026] It should be understood that in this application specification and the appended claims, the terms "the," "the," "the," "the," "the," "the described," "the mentioned," etc., may be understood, depending on the context, to refer to the content mentioned above.

[0027] It should be understood that in this application specification and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance, nor are they used to describe a specific order or sequence.

[0028] It should be understood that in this application specification and appended claims, the designations such as "S100," "S200," and "S300" are used only for distinguishing descriptions and should not be construed as indicating or implying a specific order or sequence of execution of steps or processes. For example, "S100, acquire data A; S200, acquire data B; S300, acquire C based on A and B;" is merely an example providing a feasible execution order, not a necessary one. Those skilled in the art can determine the actual and feasible execution order based on the function and internal logic of each step. For example, "step S100 is executed before step S200, then step S300 is executed," "step S200 is executed before step S100, then step S300 is executed," or "steps S100 and S200 are executed in parallel, then step S300 is executed."

[0029] It should be understood that in this application specification and appended claims, if numbering or quantity in the form of “f(i); i=1, 2, ..., n;” is used, the specific value corresponding to the term “f(i)” should be understood as a value that changes with the value of i, and not as a fixed value. For example, in different practical scenarios, “f(1)” and “f(2)”, “f(1)” may be equal to “f(2)” or may not be equal to “f(2)”, and unless otherwise specified, there is no necessary size relationship between “f(1)” and “f(2)”.

[0030] It should be understood that in this application specification and appended claims, if numbers or symbols in the form of superscript are used, and the context or other corresponding locations provide a specific interpretation of them, they should be understood according to their corresponding explanatory description, and cannot be directly and simply understood as concepts such as "exponent" in mathematics or "atomic number" in chemistry. Similarly, if numbers or symbols in the form of subscript are used, they should be understood in the same way, without further explanation.

[0031] It should be understood that in the description of this application and the appended claims, if terms such as "A=(...)" are used, unless otherwise specifically interpreted, they should be understood as "A includes...", and not as "A is composed of...". Furthermore, unless otherwise specifically interpreted, the parentheses "(" and ")" are only used in conjunction with "=" to indicate what items or data A includes, and do not refer to any specific data structure, nor do they limit the type of its elements, whether the number of elements is fixed, whether the elements are ordered, whether the elements are repeatable, what query method is required to query its elements, or what access order is required to access its elements.

[0032] It should be understood that in the description of this application and the appended claims, if common processing functions such as "max(...)", "min(...)", and "avg(...)" are used, the context or other corresponding locations should provide a specific interpretation of these terms. If no specific interpretation exists, those skilled in the art should use relevant technical terms from computer science and technology for connection. For example, "max(...)" refers to a function for determining the maximum value, "min(...)" refers to a function for determining the minimum value, and "avg(...)" refers to a function for determining the average value.

[0033] Embodiments of this application provide a message retransmission method based on RDMA, the method comprising the following steps, such as... Figure 1 As shown:

[0034] S1. When the sending RDMA network card sends normal data packets through a queue pair, obtain the current number of unacknowledged packets (gap) corresponding to that queue pair; normal data packets are non-retransmitted data packets; gap meets the following conditions:

[0035] gap = SPSN - APSN; SPSN is the sequence number of the last data packet sent by the current sending RDMA network card through this queue; APSN is the sequence number of the last data packet continuously acknowledged by the current receiving RDMA network card through this queue.

[0036] Specifically, a non-retransmitted data packet can be understood as the data packet sent for the first time.

[0037] Specifically, in step S1, the sending RDMA network card determines the sequence number of the last data packet that the receiving RDMA network card has continuously acknowledged through the queue, based on the received ACK message.

[0038] Further, the sending RDMA network card parses the acknowledgment sequence number field in the most recently received ACK message. The acknowledgment sequence number field represents the data packet sequence number of the next data packet that the receiving RDMA network card expects to receive. The sending RDMA network card decrements the value of the acknowledgment sequence number field by 1 to obtain the data packet sequence number of the last data packet that the receiving RDMA network card has continuously acknowledged through this queue.

[0039] S2. When gap > QPC, based on the maximum retransmission count corresponding to the queue pair, determine the data packets to be retransmitted from the data packets sent by the current sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card, and update QPC by increasing the step size based on a preset window threshold; QPC is the length threshold of the window waiting for acknowledgment corresponding to the queue pair, and the initial value of the length threshold of the window waiting for acknowledgment is a preset length threshold; wherein, those skilled in the art know that the preset length threshold is a threshold preset by those skilled in the art according to actual needs, for example: 135, which will not be elaborated here.

[0040] Specifically, the data packets sent by the sending RDMA network card through this queue but not acknowledged by the receiving RDMA network card are the data packets corresponding to data packets sent by the sending RDMA network card through this queue, and whose data packet sequence number is between the APSN and SPSN. These data packets include data packets that were sent for the first time but were not acknowledged by the receiving RDMA network card, as well as data packets that have been retransmitted but have not yet been acknowledged by the receiving RDMA network card and need to be retransmitted again.

[0041] In the embodiments of this application, whenever the sending RDMA network card sends a normal data packet through a queue pair, it obtains the current number of unacknowledged packets corresponding to that queue pair, gap, and triggers packet retransmission when gap > QPC. When the network link is in good condition, after the sending RDMA network card continuously sends a certain number of data packets, it will usually receive ACK packets from the receiving RDMA network card in succession, at which time gap will remain at a low and stable level. However, when the network is unstable, experiences packet loss, or congestion, ACK packet feedback will be delayed or interrupted. During this stage, the sending RDMA network card continues to send data packets because... Without ACK (Sliding Acknowledgment), the gap will continue to accumulate and grow as more packets are sent. Therefore, when the gap accumulates and exceeds the QPC (Queries Per Count), the sender can directly determine that packet loss or network congestion has occurred and actively trigger retransmission. There is no need to passively wait for out-of-order timeouts or retransmission timeouts to expire, nor is there a need to wait for the receiver's RDMA network card to explicitly respond with a NAK (Network Address Translation) message before triggering retransmission. This allows the sender to perceive network fluctuations in real time during data transmission, thereby intervening in the processing before out-of-order or retransmission timeouts occur. This greatly shortens the response time for packet loss detection and recovery, significantly reduces the long-tail latency of data transmission, and improves the effective throughput.

[0042] Specifically, the QPC is updated by increasing the step size based on a preset window threshold, including:

[0043] When QPC+B≤Z, let QPC=QPC+B to update QPC; when QPC+B>Z, let QPC=Z to update QPC; B is the preset window threshold increment step; Z is the sending window length corresponding to the queue pair; wherein, those skilled in the art know that the preset window threshold increment step is a step set by those skilled in the art according to actual needs, for example: 135, the number of data packets that the sending end RDMA network card can send through the queue pair in a single round-trip time, which will not be elaborated here.

[0044] Specifically, the process before step S2 also includes:

[0045] When QPC < Z, proceed to step S2; when QPC = Z, do not trigger retransmission.

[0046] Through the above steps, when a retransmission is triggered, it indicates that packet loss or network congestion has occurred in the current network, and the ACK packet feedback is delayed or interrupted. At this time, the length threshold of the waiting confirmation window is updated by increasing the step size according to the preset window threshold, actively expanding the length threshold of the waiting confirmation window for triggering retransmission. This can effectively avoid the cycle of triggering retransmission again after each normal data packet is sent due to the ACK feedback delay after the retransmission ends. When the length threshold of the waiting confirmation window increases to the sending window length, it indicates that the upper limit of the number of retransmission triggers under the current network condition has been reached. At this time, the active retransmission mechanism driven by the number of unacknowledged packets is suspended, and retransmission retransmission mechanisms such as out-of-order timeout and retransmission timeout timers are used for fallback retransmission. Until a new ACK packet is received, it indicates that the network congestion has been alleviated. The QPC is updated based on the preset minimum window length value and the preset window threshold recovery coefficient, and the active retransmission mechanism driven by the number of unacknowledged packets is restored. This further improves the sensitivity to packet loss, effectively avoids the invalid occupation of bandwidth by retransmission storms, and ensures reliable data transmission when there is severe packet loss in the network.

[0047] Specifically, in step S2, based on the maximum retransmission count corresponding to the queue pair, the data packets to be retransmitted are determined from the data packets sent by the current sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card, including:

[0048] S21. When gap≤M, for each data packet sent by the current sending RDMA network card through this queue pair but not acknowledged by the receiving RDMA network card, the data packet is identified as a data packet to be retransmitted; M is the maximum number of retransmissions corresponding to this queue pair.

[0049] S22. When gap > M, each data packet sent by the current sending RDMA network card through this queue but not acknowledged by the receiving RDMA network card is taken as a data packet to be selected.

[0050] S23. Sort all the data packets to be selected in order from earliest to latest according to their initial transmission time, and determine the first M data packets to be selected as the M data packets to be retransmitted.

[0051] Specifically, M is obtained through a preset retransmission quantity mapping table, which includes several preset packet loss rate intervals and a preset maximum retransmission quantity corresponding to each preset packet loss rate interval. The preset maximum retransmission quantity corresponding to the preset packet loss rate interval containing the current packet loss rate of the queue is taken as M. Those skilled in the art know that the preset packet loss rate interval and the preset maximum retransmission quantity corresponding to the preset packet loss rate interval are pre-configured by those skilled in the art according to actual needs. For example, if the preset packet loss rate interval is [0, 1%], the corresponding preset maximum retransmission quantity is 16; if the preset packet loss rate interval is (1%, 5%), the corresponding preset maximum retransmission quantity is 32; if the preset packet loss rate interval is (5%, 100%), the corresponding preset maximum retransmission quantity is 64. Further details are omitted here.

[0052] Specifically, every preset statistical period, the number of data packets sent by the sending RDMA network card through the queue and the number of data packets acknowledged and received by the receiving RDMA network card through the same queue are obtained; based on the difference between the number of sent data packets and the number of acknowledged and received data packets, the current packet loss rate of the queue is calculated; wherein, as those skilled in the art know, the preset statistical period is a period preset by those skilled in the art according to actual needs, such as 100ms, 1s, and will not be elaborated here.

[0053] Through the above steps, when the number of unacknowledged packets does not exceed the maximum retransmission limit, each data packet sent by the current sending RDMA network card through this queue but not acknowledged by the receiving RDMA network card is identified as a data packet to be retransmitted; otherwise, the data packets to be retransmitted are determined according to the order of the initial sending time from earliest to latest and the maximum retransmission limit, with priority given to retransmitting the earliest sent unacknowledged packets. This avoids bandwidth waste and increased network congestion caused by blindly retransmitting the entire packet, and improves the transmission efficiency and stability of the RDMA network in a packet loss environment.

[0054] S3. Retransmit the data packets to be retransmitted.

[0055] S4. When the sending end RDMA network card receives a new ACK message, the QPC is updated based on the preset minimum window length value and the preset window threshold recovery coefficient.

[0056] Specifically, the new ACK message is an ACK message for a data packet whose sequence number has been successfully received and is greater than the APSN.

[0057] Furthermore, subtract 1 from the value of the acknowledgment sequence number field in the ACK message to obtain the sequence number of the successfully received data packet corresponding to the ACK.

[0058] Through the above steps, when the sending RDMA network card sends normal data packets through the queue pair, it obtains the current number of unacknowledged packets, gap, for that queue pair. When gap > QPC, based on the maximum retransmission count for that queue pair, it identifies the data packets to be retransmitted from the data packets sent by the sending RDMA network card through that queue pair but not yet acknowledged by the receiving RDMA network card. It then updates the QPC by increasing the step size based on a preset window threshold, where QPC is the length threshold of the waiting window for acknowledgment for that queue pair. The data packets to be retransmitted are then retransmitted, and the transmission is completed within the specified timeframe. When the RDMA network card receives a new ACK packet, it updates the QPC based on a preset minimum window length and a preset window threshold recovery coefficient. By introducing a dynamic window length threshold for waiting for acknowledgment and the number of unacknowledged packets as retransmission trigger conditions, the sending end can respond to network anomalies and actively trigger retransmissions without having to passively wait for NAK, SACK packets or RTO timeouts. At the same time, by determining the packets to be retransmitted through the maximum number of retransmissions, the retransmission storm caused by blind retransmissions and the invalid idle time of the sending end are effectively avoided, significantly reducing the long-tail latency of data transmission and improving the effective throughput.

[0059] Specifically, the QPC is updated based on a preset minimum window length value and a preset window threshold recovery coefficient, including:

[0060] Let QPC = max(D, QPC - α × (QPC - gap)) to update QPC; where D is the preset minimum window length value; α is the preset window threshold recovery coefficient; 0 < α < 1; max() is the maximum value acquisition function; those skilled in the art know that the preset minimum window length value is a value pre-configured by those skilled in the art according to actual needs, such as 4, 5, which will not be elaborated here.

[0061] Preferably, α = 0.8; this avoids setting the value of α too large, causing the length threshold of the waiting confirmation window to converge quickly to the number of unacknowledged packets, thus preventing retransmission from being mistakenly triggered again when a small number of normal data packets are sent subsequently; at the same time, it also avoids setting the value of α too small, causing the length threshold of the waiting confirmation window to shrink slowly, thus preventing the retransmission response from being unable to be triggered in time when packet loss or congestion occurs again in the network.

[0062] Through the above steps, when a new ACK message is received, it indicates that the sequence number of the data packets continuously acknowledged by the receiving end has been updated, and the network transmission status tends to recover. At this time, the length threshold of the window waiting for acknowledgment is updated based on the preset minimum window length value and the preset window threshold recovery coefficient, so that the length threshold of the window waiting for acknowledgment is smoothly shrunk towards the number of unacknowledged messages. This avoids the situation where the shrinkage is too fast and directly approaches the number of unacknowledged messages, which would cause retransmission to be mistakenly triggered again when a small number of normal data packets are sent later. This improves the transmission stability and reliability of the RDMA network in a dynamic fluctuation environment.

[0063] In another specific embodiment, the QPC is updated based on a preset minimum window length value and a preset window threshold recovery coefficient, including:

[0064] S401. Obtain the minimum window length value E corresponding to the current queue pair, where E meets the following condition:

[0065] E = max(D, rate1 / rate2×L), where rate1 is the current transmission rate of the queue pair; rate2 is the maximum transmission rate of the queue pair; and L is a preset length threshold.

[0066] S402. Let QPC = max(E, QPC - α × (QPC - gap)) to update QPC.

[0067] Through the above steps, based on the preset minimum window length value, the current transmission rate and maximum transmission rate of the queue pair, the minimum window length value corresponding to the current queue pair is dynamically calculated; based on the minimum window length value corresponding to the current queue pair and the preset window threshold recovery coefficient, the length threshold of the window waiting for acknowledgment is updated; not only is a basic safety threshold introduced, but the impact of the congestion control algorithm adaptively reducing the packet sending rate after network congestion is also taken into account; it can play a fallback role when the preset minimum window length value is set too small, avoiding frequent retransmissions due to the preset minimum window length value being set too small; it can also ensure that when the calculated dynamic value is too small, a stable retransmission window is maintained by relying on the preset minimum window length value; it avoids the length threshold of the window waiting for acknowledgment shrinking too quickly to directly approach the number of unacknowledged packets, causing subsequent transmission of a small number of normal data packets to trigger retransmissions again; through the dual protection mechanism, the transmission stability and reliability of the RDMA network in a dynamically fluctuating environment are significantly improved.

[0068] In this application embodiment, a non-transitory computer-readable storage medium is also provided. This non-transitory computer-readable storage medium can be disposed in an electronic device to store at least one instruction or at least one program related to implementing the method provided in any embodiment of this application. The at least one instruction or the at least one program is loaded and executed by a processor to implement the method provided in any embodiment of this application, and can achieve the same technical effect. To avoid repetition, further details are omitted here.

[0069] Examples of non-transitory computer-readable storage media include: computer read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), compact disc read-only memory (CD-ROM), flash memory, magnetic disk, optical disk, portable computer disk, hard disk and / or solid-state drive, etc.

[0070] In this application embodiment, an electronic device is also provided, the electronic device including a processor and the non-transitory computer-readable storage medium. The processor loads and executes at least one instruction or at least one program stored in the non-transitory computer-readable storage medium related to implementing the method provided in any embodiment of this application, so as to implement the method provided in the embodiment of this application.

[0071] For example, the electronic device may be a mobile electronic device or a non-mobile electronic device that also includes other functions such as a personal digital assistant and / or music player. Further, the mobile electronic device may be any one of a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA); the non-mobile electronic device includes any one of a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine. No specific limitations are made in the embodiments of this application.

[0072] For example, the processor can be a processor in any electronic device.

[0073] Exemplary embodiments of this application also provide a feasible structure for an electronic device. For example, the electronic device may include a processor, an external memory interface, internal memory, a universal serial bus (USB) interface (hereinafter referred to as a USB interface), a charging management module, a power management module, a battery, a first antenna, a second antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a receiver, a microphone, a headphone jack, a sensor module, buttons, a motor, an indicator, a camera, a display screen, and a subscriber identification module (SIM) card interface (hereinafter referred to as a SIM card interface), etc. The sensor module may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and / or bone conduction sensors, etc.

[0074] It should be understood that the exemplary structures of the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than the structure described herein, or combine some components, or split some components, or have different component arrangements. The components may be implemented in hardware, software, or a combination of software and hardware.

[0075] For example, the processor may include one or more processing units, wherein the processing units include: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0076] For example, the processor may further include a memory for storing instructions and data. In some embodiments of this application, the memory in the processor is a cache memory. The memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instructions or data again, it can directly retrieve them from the memory.

[0077] For example, the processor may also include one or more interfaces. These interfaces include: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.

[0078] The integrated circuit interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).

[0079] Integrated circuits with built-in audio interfaces can be used for audio communication. In some embodiments of this application, the processor may include multiple sets of integrated circuit-based audio interfaces. The processor can couple with an audio module through the integrated circuit-based audio interface to achieve communication between the processor and the audio module.

[0080] The pulse code modulation interface can also be used for audio communication, specifically for sampling, quantizing, and encoding analog signals. In some embodiments of this application, the audio module and the wireless communication module can be coupled through the pulse code modulation interface.

[0081] A Universal Asynchronous Receiver / Transmitter (UART) is a universal serial data bus interface used for asynchronous communication. This bus can be a bidirectional communication bus interface. It converts the data to be transmitted between serial and parallel communication. In some embodiments of this application, the processor and the wireless communication module can be connected via the UART.

[0082] Mobile industry processor interfaces can be used to connect processors to peripheral devices such as displays and cameras.

[0083] General purpose input / output interfaces can be configured via software.

[0084] Furthermore, the general-purpose input / output interface can be configured as a control signal or a data signal. In some embodiments of this application, the general-purpose input / output interface can be used to connect the processor to a camera, display screen, wireless communication module, audio module, sensor module, etc.

[0085] A USB interface is an interface that conforms to the USB standard specification, specifically including Mini USB, Micro USB, and USB Type-C interfaces. USB interfaces can be used to connect chargers to charge electronic devices, and also for transferring data between electronic devices and peripheral devices.

[0086] It should be understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or a combination of multiple interface connection methods as described in the embodiments.

[0087] The charging management module receives charging input from a charger, which can be either a wireless or wired charger. In some wired charging embodiments, the charging management module receives charging input from the wired charger via a USB interface. In some wireless charging embodiments, the charging management module receives wireless charging input via the wireless charging coil of the electronic device. While charging the battery, the charging management module can also supply power to various parts of the electronic device via the power management module.

[0088] The power management module is used to connect the battery, the charging management module, and the processor.

[0089] Wireless communication functionality in electronic devices can be achieved through a first antenna, a second antenna, a mobile communication module, a wireless communication module, a modem processor, and a baseband processor.

[0090] Mobile communication modules can enable wireless communication solutions, including 2G / 3G / 4G / 5G, for use in electronic devices.

[0091] A modem processor may include a modulator and a demodulator. The modulator modulates a low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to a baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to an application processor. The application processor outputs sound signals through audio devices (not limited to speakers, receivers, etc.) or displays images or videos on a display screen. In some embodiments of this application, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor and housed within the same device as the mobile communication module or other functional modules.

[0092] Wireless communication modules can enable solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.

[0093] In some embodiments of this application, the first antenna of the electronic device is coupled to the mobile communication module, and the second antenna is coupled to the wireless communication module, enabling the electronic device to communicate with networks and other devices via wireless communication technology.

[0094] Electronic devices utilize GPUs, displays, and application processors to achieve their display functions. A GPU is a microprocessor for image processing, connecting the display and the application processor. GPUs perform mathematical and geometric calculations and are used for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.

[0095] The display screen is used to display images, videos, etc. The display screen includes a display panel. The display panel can be a liquid crystal display (LCD), or a display panel made of materials selected from organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), minimized, microLEDs, micro-OLEDs, or quantum dot light-emitting diodes (QLEDs). In some embodiments of this application, the electronic device may include one or more display screens. In some embodiments of this application, the display screen may also integrate touch functionality and may be referred to as a touch screen.

[0096] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.

[0097] External storage interfaces can be used to connect external memory cards, such as Micro SD cards, to expand the storage capacity of electronic devices.

[0098] Internal memory can be used to store executable program code for a computer, which includes instructions. The processor executes the instructions stored in internal memory to perform various functional applications and data processing of electronic devices.

[0099] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors. Examples include music playback and recording.

[0100] The audio module converts digital audio information into analog audio signals for output, and also converts analog audio input into digital audio signals. The speaker, also called a "horn," converts audio electrical signals into sound signals. The receiver, also called a "handset," converts audio electrical signals into sound signals. The microphone, also called a "microphone" or "voice transducer," converts sound signals into electrical signals. The headphone jack is used to connect wired headphones.

[0101] Pressure sensors are used to sense pressure signals and convert them into electrical signals. In some embodiments of this application, the pressure sensor can be located on the display screen. A gyroscope sensor can be used to determine the motion posture of the electronic device. A barometric pressure sensor is used to measure air pressure. In some embodiments of this application, the electronic device calculates altitude using the air pressure value measured by the barometric pressure sensor, assisting in positioning and navigation. An accelerometer can detect the magnitude of acceleration of the electronic device in various directions (generally three axes). A distance sensor is used to measure distance. A fingerprint sensor is used to collect fingerprints. A touch sensor, also known as a "touch panel," can be located on the display screen, forming a touchscreen, also known as a "touch screen." A bone conduction sensor can acquire vibration signals. In some embodiments of this application, a bone conduction sensor can acquire vibration signals from vibrating bone fragments in the human vocal cords. A bone conduction sensor can also contact the human pulse to receive blood pressure signals.

[0102] The buttons include a power button and volume buttons. A motor can generate vibration alerts. Indicators can be indicator lights, used to show charging status, battery level changes, messages, missed calls, notifications, etc. A SIM card slot is used to connect a SIM card.

[0103] Embodiments of this application also provide a computer program product including program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described in this specification according to various exemplary embodiments of this application.

[0104] This application also provides a chip, which includes a processor and a communication interface. The communication interface is used to receive signals and transmit the signals to the processor. The processor processes the signals so that the methods described in the various exemplary embodiments of this application are executed.

[0105] While specific embodiments of this application have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this application. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of this application. The scope of this application is defined by the appended claims.

Claims

1. A message retransmission method based on RDMA, characterized in that, The method includes the following steps: S1. When the sending RDMA network card sends normal data packets through a queue pair, obtain the current number of unacknowledged packets (gap) corresponding to that queue pair; normal data packets are non-retransmitted data packets; gap meets the following conditions: gap = SPSN - APSN; SPSN is the sequence number of the last data packet sent by the current sending RDMA network card through this queue; APSN is the sequence number of the last data packet continuously acknowledged by the current receiving RDMA network card through this queue. S2. When gap > QPC, based on the maximum retransmission count corresponding to the queue pair, determine the data packets to be retransmitted from the data packets sent by the current sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card, and update QPC by increasing the step size based on the preset window threshold; QPC is the length threshold of the window waiting for acknowledgment corresponding to the queue pair, and the initial value of the length threshold of the window waiting for acknowledgment is the preset length threshold. S3. Retransmit the data packet to be retransmitted; S4. When the sending end RDMA network card receives a new ACK message, the QPC is updated based on the preset minimum window length value and the preset window threshold recovery coefficient.

2. The message retransmission method based on RDMA according to claim 1, characterized in that, The QPC is updated by increasing the step size based on a preset window threshold, including: When QPC+B≤Z, let QPC=QPC+B to update QPC; when QPC+B>Z, let QPC=Z to update QPC; B is the preset window threshold increment; Z is the sending window length corresponding to this queue.

3. The message retransmission method based on RDMA according to claim 1, characterized in that, The QPC is updated based on a preset minimum window length value and a preset window threshold recovery coefficient, including: Let QPC = max(D, QPC - α × (QPC - gap)) to update QPC; where D is the preset minimum window length value; α is the preset window threshold recovery coefficient; 0 < α < 1.

4. The message retransmission method based on RDMA according to claim 3, characterized in that, The QPC is updated based on a preset minimum window length value and a preset window threshold recovery coefficient, including: S401. Obtain the minimum window length value E corresponding to the current queue pair, where E meets the following condition: E = max(D, rate1 / rate2×L), where rate1 is the current transmission rate of the queue pair; rate2 is the maximum transmission rate of the queue pair; and L is a preset length threshold. S402. Let QPC = max(E, QPC - α × (QPC - gap)) to update QPC.

5. The message retransmission method based on RDMA according to claim 1, characterized in that, In step S2, based on the maximum retransmission count corresponding to the queue pair, the data packets to be retransmitted are determined from the data packets sent by the current sending RDMA network card through the queue pair but not acknowledged by the receiving RDMA network card, including: S21. When gap≤M, for each data packet sent by the current sending end RDMA network card through this queue pair but not acknowledged by the receiving end RDMA network card, the data packet is identified as a data packet to be retransmitted; M is the maximum number of retransmissions corresponding to this queue pair. S22. When gap > M, each data packet sent by the current sending end RDMA network card through this queue but not acknowledged by the receiving end RDMA network card is taken as a data packet to be selected. S23. Sort all the data packets to be selected in order from earliest to latest according to their initial transmission time, and determine the first M data packets to be selected as the M data packets to be retransmitted.

6. The message retransmission method based on RDMA according to claim 5, characterized in that, M is obtained through a preset retransmission number mapping table, which includes several preset packet loss rate intervals and a preset maximum retransmission number corresponding to each preset packet loss rate interval; the preset maximum retransmission number corresponding to the preset packet loss rate interval containing the current packet loss rate of the queue is taken as M.

7. The message retransmission method based on RDMA according to claim 1, characterized in that, In step S1, the sending RDMA network card determines the sequence number of the last data packet that the receiving RDMA network card has continuously acknowledged through the queue, based on the received ACK message.

8. The message retransmission method based on RDMA according to claim 1, characterized in that, The new ACK message is an ACK message for a data packet whose sequence number has been successfully received and is greater than that of the APSN.

9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the RDMA-based message retransmission method as described in any one of claims 1-8.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.