Method, device, storage medium and program product for improving efficiency of RDMA dual card switching

By preparing backup resources in advance and establishing connections in advance, the problem of long switching time for RDMA dual NICs was solved, enabling fast and seamless fault switching, improving service continuity and stability, and reducing switching latency and packet loss rate.

CN122507562APending Publication Date: 2026-08-04KYLIN CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KYLIN CORP
Filing Date
2026-03-19
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing RDMA dual NIC switching methods have long switching cycles during failures, resulting in severe packet loss and increased network bandwidth consumption due to packet retransmission, which affects business continuity and user experience and cannot meet the requirements of high-performance and stability requirements in high-end business scenarios.

Method used

By intercepting RDMA calls through an intermediate library, backup resources are prepared in advance and pre-connection is performed. In the event of a failure, only a handover signal needs to be sent to achieve fast handover. This includes synchronously creating backup resources, exchanging attribute information through out-of-band UDP sockets, and changing the QP status through ibv_modify_qp to achieve pre-connection of backup resources.

Benefits of technology

The RDMA network card failover time was reduced from 127ms to 11ms, achieving near-seamless switching, reducing packet loss, improving service continuity and stability, and avoiding bandwidth waste and latency caused by retransmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122507562A_ABST
    Figure CN122507562A_ABST
Patent Text Reader

Abstract

The application provides a method, device, storage medium and program product for improving RDMA dual-card switching efficiency, and belongs to the technical field of computer networks, and comprises the following steps: intercepting RDMA calling of an application program through a self-provided RDMA function library of an intermediate library; when the RDMA calling is intercepted, responding to the RDMA calling through the self-provided RDMA function library to perform RDMA communication, mapping resources required by the RDMA communication into resources of the intermediate library so that the application program directly accesses the resources of the intermediate library; standby resource preparation and pre-association; monitoring changes of RDMA network cards through the intermediate library, and when a failure of a main RDMA network card is monitored, the next step is entered; a failure signal and complete association of the standby resource; after the complete association is successfully completed, the resources of the intermediate library of the associated main RDMA network card are switched to the associated standby RDMA network card to continue the RDMA communication. The method further reduces the RDMA network card failure switching time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to RDMA dual-SIM handover, and more particularly to a method, device, storage medium, and program product for improving RDMA dual-SIM handover efficiency, belonging to the field of computer network technology. Background Technology

[0002] Patent (CN120743638A) discloses an RDMA dual-NIC primary / backup switching method and device. It provides a method for implementing primary / backup fault switching based on RDMA dual NICs. In this method, a primary and backup dual NIC are deployed in the customer's business environment. When one NIC fails or crashes, the system switches to the backup NIC to perform a secondary service reconnection to restore the established communication service. This allows the customer's business to perform primary / backup NIC fault switching without being aware of the fault, avoiding service interruption due to NIC failure. The time cycle for resource preparation (CQ, MR, QP, etc.), secondary reconnection, and service recovery after detecting the fault is approximately 127ms.

[0003] The above process has a relatively long time cycle, requiring approximately 127ms to complete resource preparation, secondary reconnection, and service recovery. This can be limiting in scenarios with high customer traffic, frequent interactions, and high requirements for stability and performance, specifically due to the following issues: ①Long switching cycles can lead to severe packet loss; ② Because of packet loss, message retransmission will occur, which will increase the consumption of network bandwidth. ③ Business awareness, which ultimately manifests as business request timeouts, transaction interruptions, and increased job execution latency, seriously affecting business continuity and user experience.

[0004] Therefore, in business scenarios where performance and stability are paramount, the ability to quickly and accurately switch to a backup NIC to restore existing services in the event of a failure is crucial for customers. Consequently, there is an urgent need in this field for a technical solution that can reduce RDMA NIC failover time from hundreds of milliseconds to tens of milliseconds or even lower, to meet the demands of high-end business scenarios for extreme stability and performance.

[0005] RDMA (Remote Direct Memory Access) means remote direct address access, combined with... Figure 1As shown, through RDMA, local nodes can directly access the memory of remote nodes. Due to its high throughput and low latency, RDMA technology has become a key network technology for data centers and high-performance computing clusters. "Direct" means that it can read and write remote memory as if it were local memory, bypassing the complex TCP / IP network protocol stack of traditional Ethernet. This process is invisible to the remote node, and most of the work in this read / write process is done by hardware rather than software. Its stability directly affects the performance of upper-layer services.

[0006] RDMA multi-NIC switching, patent (CN120743638A) provides a method and device for RDMA dual-NIC master / slave switching, which offers a method for resource preparation, secondary reconnection, and service recovery after detecting a NIC failure, known as the RDMA high availability method. Figure 2 As shown, there are two devices, Node0 and Node1. Each device has two RDMA network cards, Device_0 and Device_1. When Device_0 of Node0 fails, it will automatically switch to Device_1 of Node0. The upper-layer application APP is unaware of the underlying network card device switching, thus realizing the seamless migration of services.

[0007] The typical implementation of RDMA multi-NIC switching involves intercepting RDMA calls from applications using the built-in RDMA function library in the intermediate library. If an RDMA call is intercepted, the built-in RDMA function library is used to respond to the RDMA call and perform RDMA communication. The resources required for RDMA communication are mapped to the resources of the intermediate library so that the application can directly access the resources of the intermediate library. The intermediate library monitors changes to the RDMA NICs, and if a failure is detected in the primary RDMA NIC, a second reconnection is performed using the backup RDMA NIC through the CM interface. After a successful reconnection, the resources of the intermediate library of the associated primary RDMA NIC are switched to the associated backup RDMA NIC to continue RDMA communication.

[0008] RDMA connection establishment is essentially QP connection establishment, similar to traditional TCP socket connection establishment. QP connection establishment has two mechanisms: one based on CM (Configuration Management) and the other is out-of-band socket connection. CM-based connection establishment is implemented using the CM management library. The CM library includes functions such as `rdma_create_id`, `rdma_get_cm_event`, and `rdma_connect`, which are upper-layer interfaces provided by the CM management library. The advantage of upper-layer interfaces is that developers do not need to concern themselves with the underlying function implementation, simplifying development logic. However, the disadvantages are slower efficiency and higher latency. RDMA's out-of-band socket connection scheme essentially bypasses the standard CM protocol stack and directly programs through the low-level Verbs interface to manually handle the state machine driving and connection parameter synchronization of queue pairs (QPs). It uses `ibv_modify_qp` to handle QP state machine switching and connection operations. However, this operation requires knowledge of certain attribute information (QPN, GID, etc.) of the peer QP to establish a connection manually. In other words, if the local client QP wants to establish a connection with the peer QP via `ibv_modify_qp`, it needs to exchange QP attribute information with both sides beforehand. The advantage of this low-level interface is high efficiency, but the disadvantage is the complexity of manual operation due to its low-level nature.

[0009] In summary, an RDMA QP cannot be directly used for RDMA communication after creation. The QP needs to undergo state changes (RESET->INIT->RTR->RTS) via ibv_modify_qp before communication can occur. These state changes require the exchange of QP attribute information (qpn, gid, lid, etc.) between the client and server sides. This is because the local QP needs to know the gid, qpn, lid, etc., of the peer QP to perform state changes. There are two ways to exchange attributes and implement QP state changes: one is through the upper-layer interface provided by the CM (which does not require manual execution of ibv_modify_qp), as mentioned above; the other is through a TCP socket channel for transmission combined with manual execution of ibv_modify_qp. Summary of the Invention

[0010] To address the aforementioned problems, this invention provides a method, device, storage medium, and program product for improving the efficiency of RDMA dual-SIM handover, thereby further reducing RDMA network card failure handover time.

[0011] To achieve the above objectives, the technical solution of the present invention is as follows: a method for improving the efficiency of RDMA dual-card handover, comprising the following steps: S1 intercepts the application's RDMA calls through the built-in RDMA function library of the intermediate library; S2, when an RDMA call is intercepted, the built-in RDMA function library is used to respond to the RDMA call and perform RDMA communication. The resources required for RDMA communication are mapped to the resources of the intermediate library so that the application can directly access the resources of the intermediate library. S3, Resource preparation and pre-establishment of connections; S4 monitors changes to the RDMA network card through the intermediate library. When a failure of the main RDMA network card is detected, it proceeds to the next step. S5, fault signals are fully linked with backup resources; S6, after successfully establishing a connection, will switch the intermediate library resources of the associated primary RDMA network card to the associated backup RDMA network card to continue RDMA communication.

[0012] Furthermore, in step S3, the backup resources are the resources required for RDMA network card communication.

[0013] Furthermore, step S3, resource preparation and pre-establishment, is performed during normal system operation.

[0014] Furthermore, step S3 specifically includes the following: 1) Create backup resources synchronously; 2) Send the attribute information of the backup resource to other nodes through out-of-band UDP sockets to lay the foundation for the pre-establishment of backup resource connections; 3) Based on the completed backup resource attribute information, the QP status is changed through ibv_modify_qp to realize the pre-establishment of connection with the peer master resource.

[0015] Furthermore, the attribute information of the backup resources includes src_qpn, dst_qpn, src_gid, and src_lid.

[0016] Furthermore, in step S5, the complete association between the fault signal and the backup resource is performed when a fault occurs.

[0017] Furthermore, step S5 specifically includes the following: 1) The faulty party sends a fault switching signal and the faulty party's QP attribute information to the non-faulty party, and the faulty party and the non-faulty party synchronously change the state of QP. 2) The backup resource qp on the faulty side and the primary resource qp on the non-faulty side are fully connected by changing the qp status through ibv_modify_qp.

[0018] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.

[0019] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0020] A computer program product includes a computer program that, when executed by a processor, implements the steps of the method described above.

[0021] The beneficial effects of the method, apparatus, storage medium, and program product for improving RDMA dual-card switching efficiency of the present invention are as follows: The core logic of this invention is proactive preheating: normal preparation (reserve resources, establish connection) -> fault detection -> send handover signal -> instantaneous handover; compared with the passive response of the prior art: fault detection -> resource preparation -> re-establish connection -> restore service, this invention transforms the serial long link operation into a parallel pre-set operation, fundamentally shortening the critical path.

[0022] Regarding resource status, the backup card is in a "hot standby" state: 1. Resource pre-preparation: Key resources such as QP, CQ, and MR, which are symmetrical with the primary card, are pre-initialized for the backup card; 2. Backup resource connection pre-establishment: During system initialization or primary card connection establishment, a reliable connection is synchronously established with the remote node for the backup card. The backup card pre-establishment involves pre-interaction of the QP attributes of the backup resources and pre-change of the QP status. Compared with the prior art, where the backup card is usually in a "cold standby" or "low ready" state and the resources are not fully initialized, this invention eliminates the serious time consumption of preparing resources and establishing backup resource connections after a fault, improving the switching performance from 127ms to 11ms, which is the key to a 10-fold performance improvement.

[0023] In terms of the switching action of this invention, the triggering of a "switching signal" is extremely simple: a switching signal is exchanged between the control threads of the local device and the remote device, and upon receipt, traffic is immediately directed to the ready backup card channel. Compared with the complex resource creation and connection negotiation process of existing technologies, which involves multiple software and hardware interactions, the action of this invention is extremely fast, changing from a software-intensive operation to a signal-level operation with extremely low latency.

[0024] Regarding data path continuity, this invention achieves near-seamless switching since the backup card connection is already established, minimizing or even eliminating packet loss. Compared to existing technologies where connection interruptions during switching inevitably lead to packet loss and retransmission, this invention improves service continuity and stability, avoiding bandwidth waste and additional latency caused by retransmissions. Attached Figure Description

[0025] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0026] Figure 1 This is a schematic diagram of existing RDMA communication technology; Figure 2 This is a schematic diagram of communication during a failure in existing RDMA technology; Figure 3 This is a schematic diagram of the control thread pre-establishment logic of the present invention; Figure 4 This is a schematic diagram of the RDMA network card reconnection process in this invention. Figure 5 This is a flowchart illustrating the method of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0028] Explanation of technical terms RDMA: Remote Direct Memory Access is an advanced network communication technology that allows one computer (the initiating computer) to directly read and write memory to another computer (the target computer) over a network without the involvement of the target computer's central processing unit (CPU).

[0029] The ibverbs interface is a set of low-level hardware-oriented interfaces that provide the most direct and fundamental control over RDMA devices. It follows the philosophy of "providing basic building blocks." Its responsibilities include creating and managing core RDMA objects such as protection domains (PDs), completion queues (CQs), queue pairs (QPs), and memory regions (MRs).

[0030] QP: Queue Pair (QP) is the core communication endpoint of RDMA technology. Each QP consists of a Send Queue and a Receive Queue. Applications initiate RDMA operations by submitting work requests to these queues.

[0031] CQ: A Completion Queue (CQ) is a data structure used to notify an application that its submitted RDMA operation (such as send or receive) has been completed. A CQ can be shared by multiple QPs.

[0032] MR: Memory Region is a user-space memory buffer that is registered to the RDMA network card. Memory registration is a crucial step; it locks and maps virtual memory addresses to physical addresses, and sets access permissions for this memory, enabling the RDMA network card to directly perform DMA (Direct Memory Access) operations on it.

[0033] CM Connection Establishment: CM (Communication Manager) Connection Management Layer: This is a high-level, connection-oriented abstraction interface. Built on top of the IB Verbs interface, it aims to simplify the process of establishing reliable connections. Responsibilities: Manages both connections and underlying resources. It not only includes the functionality to create QPs, but also encapsulates the entire complex process of discovering peers, exchanging parameters, handshaking, and transitioning a QP to a usable state (RTS). The CM interface encapsulates this complexity.

[0034] Out-of-band socket connection: Exchange detailed information about QP (such as QPN, Gid, LID, etc.) through sockets, and then use a series of low-level ibverbs interfaces such as ibv_modify_qp to make complex calls to achieve connection. It is more low-level and complex than CM connection, and provides the greatest flexibility and control.

[0035] This invention provides a method to improve the efficiency of RDMA dual-SIM handover by advancing the time-consuming operations during fault handover (especially backup resource preparation and secondary connection establishment) from after a fault occurs to during normal system operation. This ensures that the primary and backup network cards and associated resources are always in a "hot-ready" state. When a fault actually occurs, only a simple "handover signal" is needed to seamlessly and quickly switch services to the backup card, thereby skipping the most time-consuming resource preparation and reconnection phases.

[0036] Traditional RDMA dual-SIM handover involves preparing backup resources (based on the backup SIM's CQ, QP, MR, etc.), reconnecting twice (based on the CM interface connection method), and recovering from the fault (replacing the old resources with the newly prepared resources on the backup SIM). The new solution proposed in this invention, based on patent (CN120743638A) of an RDMA dual-NIC primary / backup handover method and device, makes the following changes: (1) The resource preparation action is placed before the failure occurs, and the resource preparation is implemented through a separate control thread; (2) The CM connection logic of the secondary connection is changed to the logic of pre-connection through out-of-band socket events and early RDMA QP connection. In case of failure, the control threads of both parties only need one signal to directly reset QP to achieve connection and switching.

[0037] Example 1

[0038] This embodiment combines Figure 3 and Figure 4 This paper details the improvements made to the present invention based on the RDMA dual-NIC master / slave switching method and equipment in patent (CN120743638A).

[0039] I. Control Thread Pre-establishment Logic like Figure 3 As shown, Figure 3 This section describes the out-of-band connection logic for exchanging RDMA backup resource QP attribute information (qpn, qkey, gid) between application nodes. The purpose of this attribute information exchange is to manually execute ibv_modify_qp to perform QP state transitions. The purpose of pre-connection is to perform the attribute exchange logic that needs to be done after a failure in advance, thus simplifying the post-failure logic and enabling rapid switchover to backup resources, improving failover efficiency. After the QP attribute exchange is complete, ibv_modify_qp will also perform some state changes on the QP in advance. Because the local QP already knows the attribute information of the peer QP, the QP state change can be performed in advance, which also improves the failover efficiency. The following is an explanation of each component in the diagram: ① Figure 3 The top section shows three RDMA application nodes: Node1, Node2, and Node3. These can be three physical servers with RDMA cards installed, or three virtual machines. The purpose is to allow customer applications to communicate externally via RDMA cards. SW stands for Switch, used for data forwarding between the three servers. Since real customer business may involve RDMA communication between two, dozens, or even hundreds of servers, this example uses three servers.

[0040] ② Figure 3 Example business logic: Backup resources have been created on three Node nodes. Now, the backup resource attribute information needs to be synchronized and exchanged between the nodes. The purpose is to change the ibv_modify_qp status of the backup resources, thereby realizing the pre-establishment of connections between backup resources. When the primary resource has a problem, it can quickly switch to the prepared backup resource to achieve rapid failover.

[0041] ③ Figure 3For example, Node1 broadcasts its own resource attribute information (src_qpn, dst_qpn, src_gid, src_lid, etc.) to Node2 and Node3 via a UDP multicast socket. The advantage of using out-of-band UDP multicast sockets is that Node1 only needs to send one message, and the switch automatically replicates and broadcasts the message among the nodes in the group (Node2, Node3). Otherwise, Node1 would need to send its own attribute information separately to Node2 and Node3, which would require hundreds or thousands of transmissions in a cluster with hundreds or thousands of nodes, significantly impacting the efficiency of attribute exchange. In the attribute information src_qpn, src_gid, and src_lid, src_ represents the attribute of the local qp, and dst_ represents the attribute of the peer qp. Since communication is often one-to-one between nodes, the client's actual business might be Node1 contacting RDMA on Node2. QP uses one-to-one communication, so it needs to include the name of the desired QPN to communicate with. The receiving end can then compare this name with its own local QPN; if they match, it will communicate with itself; otherwise, it won't. ④ After Node1 sends src_qpn, dst_qpn, src_gid, src_lid, etc. to other nodes, the receiving node will check whether dst_qpn is equal to its own qpn number. If they are equal, it means that Node1 wants to establish a connection with it. Then the receiving node will return its own src_qpn, src_lid, src_gid, dst_qpn, etc. to Node1, and the returned data will also be marked with the src_ identifier. After Node1 receives the reply from Node2, it will also check whether dst_qpn is equal to its own qpn. If they are equal, it is determined that it is the reply information from Node2.

[0042] 2. Preprocess resources and connection establishment. In case of failure, reconnection is achieved by resetting QP and modifying QPN. Then, fault migration is implemented in conjunction with failover and resource mapping. Figure 4This example illustrates the main technical logic and process of fault switching between two nodes via an APP application using an RDMA primary card, an RDMA backup card, and a SW switch. It involves backup card resource preparation, the mapping relationship between the primary and backup cards, QP attribute information exchange and pre-establishment between backup cards, and fault detection (not shown in the diagram, but explained below). QP0 and CQ0 are resources created based on device_0 (RDMA primary card), which are the primary resources used for business communication from the start. QP0' and CQ0' are resources created based on device_1 (RDMA backup card). Because customers need to prepare two RDMA cards simultaneously for fault switching between primary and backup RDMA cards, when the primary card fails, QP, CQ, and other resources are switched to QP', CQ', and other resources based on the backup card.

[0043] Figure 4 The red curve (i.e., the outer dashed line) represents the channel for normal business communication between the Node1 APP application on the left and the Node2 APP application on the right through the primary card. The orange curve (i.e., the inner dashed line) represents the channel based on backup resources. The connection will only be made to the backup card when the primary card of Node1 fails. This is when the red line (outer dashed line) switches to the orange line (inner dashed line). At this time, the backup resource QP` of Node1 will communicate with the primary resource QP of Node2. In other words, only the failed party will switch to the backup resource. The non-failed party will not switch resources, but it will re-switch the ibv_modify_qp attribute based on the primary QP. The reason why the non-failed party re-switches the attribute is because the peer Node1 has changed from QP to QP`. The communication object has changed, so it is necessary to re-establish the connection through the state attribute switch.

[0044] Example 2

[0045] This embodiment is based on embodiment 1, combined with... Figure 5 The overall process of the method of this invention is described in detail. The overall process includes intermediate library hijacking, resource mapping, fault detection, backup resource preparation, and pre-establishment of connection. The intermediate library hijacking logic, primary and backup resource mapping logic, and fault detection logic are consistent with the logic of the RDMA dual-NIC primary and backup switching method and device in patent (CN120743638A). The main improvement of this invention is that the backup resource pre-preparation and backup resource pre-interaction realize the initial basic connection establishment. In the event of a fault, only one signal is needed to quickly realize the complete re-establishment of connection between the faulty backup resource and the non-faulty primary resource, and then the fault switchover is realized. The specific process is as follows: S1 intercepts the application's RDMA calls through the built-in RDMA function library of the intermediate library; S2, when an RDMA call is intercepted, the built-in RDMA function library is used to respond to the RDMA call and perform RDMA communication. The resources required for RDMA communication are mapped to the resources of the intermediate library so that the application can directly access the resources of the intermediate library. S3, resource preparation + pre-establishment of alliances: 1) Synchronously create resources qp` and cq` based on the backup network card; 2) Send the attribute information of the backup resource to other nodes through out-of-band UDP sockets to lay the foundation for the pre-establishment of backup resource connections; 3) Based on the completed backup resource attribute information, the QP state is changed through ibv_modify_qp to realize the pre-establishment (basic establishment) with the peer master resource. S4 monitors changes to the RDMA network card through the intermediate library. When a failure of the main network card is detected, it proceeds to the next step. S5, fault signal + backup resource fully linked: 1) The faulty side sends a fault switching signal and the faulty side's QP attribute information to the non-faulty side, and both sides synchronously change the state of QP. 2) The backup resource qp on the faulty end and the primary resource qp on the non-faulty end can be fully connected by changing the qp status through ibv_modify_qp (because pre-connection has already been performed when there is no fault, there is no need for time-consuming connection based on CM from scratch). S6, after successfully establishing a connection, will switch the intermediate library resources of the associated primary RDMA network card to the associated backup RDMA network card to continue RDMA communication.

[0046] The following is a further supplementary description of step S3 above: Resource preparation + pre-connection establishment phase (during normal system operation): a. Resource pre-initialization: When starting up or when the primary card comes online, not only are the primary card resources initialized, but the control thread also synchronously initializes a set of completely equivalent resources (QP, CQ, MR, AH, etc.) for the backup card. b. Connection Pre-establishment: While the primary card establishes an RDMA connection with the remote node, a parallel, standby RDMA connection is established and maintained between the local backup card and the same remote node through control thread interaction. This connection remains active but does not carry service traffic at this time.

[0047] The following is a further supplementary description of step S5 above: Fault signal + complete re-establishment of backup resources (when a fault occurs): a. Triggering switching signal: Once the fault detection module confirms a fault, the faulty party sends a fault switching signal to the remote non-faulty party's control thread through its control thread; b. Upon receiving a fault signal, the non-faulty party immediately stops the service of its primary resource QP and synchronously switches the QP status with the faulty party, so as to achieve full connection between the backup resource of the faulty party and the primary resource of the non-faulty party, thus opening up all pathways for traffic switching.

[0048] In summary, the present invention has the following stages: Pre-preparation stage: During normal system operation and the primary network card's normal operation, resource initialization is completed for the backup network card in advance, and a backup connection is established with the remote node; Fault detection stage: The working status of the primary network card is continuously monitored; Fast switching stage: When a fault is detected in the primary network card, the pre-prepared backup network card and its connection are directly activated by sending a switching signal, skipping the resource preparation and connection establishment process.

[0049] This invention synchronously initializes symmetrical network resources, including queue pairs (QP), completion queues (CQ), and memory regions (MR), for a primary network interface card (NIC) and a backup NIC. When the primary NIC establishes a service connection with a remote node, a standby connection is simultaneously established between the backup NIC and the same remote node. The backup NIC's connection remains active but does not carry service data traffic.

[0050] By adding timestamps to the RDMA dual-NIC handover library: a start timestamp is added to the fault detection logic, and an end timestamp is added after the fault is recovered. The handover latency can be calculated by subtracting the two. In the actual business environment of a securities exchange in Shanghai, the latency has been reduced from 127ms to 11ms, which is more than 10 times the performance.

[0051] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

Claims

1. A method for improving RDMA dual card switching efficiency, characterized in that, Includes the following steps: S1 intercepts the application's RDMA calls through the built-in RDMA function library of the intermediate library; S2, when an RDMA call is intercepted, the built-in RDMA function library is used to respond to the RDMA call and perform RDMA communication. The resources required for RDMA communication are mapped to the resources of the intermediate library so that the application can directly access the resources of the intermediate library. S3, Resource preparation and pre-establishment of connections; S4 monitors changes to the RDMA network card through the intermediate library. When a failure of the main RDMA network card is detected, it proceeds to the next step. S5, fault signals are fully linked with backup resources; S6, after successfully establishing a connection, will switch the intermediate library resources of the associated primary RDMA network card to the associated backup RDMA network card to continue RDMA communication.

2. The method of claim 1, wherein, In step S3, the backup resources are the resources required for RDMA network card communication.

3. The method of claim 2, wherein, Step S3, resource preparation and pre-establishment, is performed during normal system operation.

4. The method of claim 3, wherein, Step S3 specifically includes the following: 1) Create backup resources synchronously; 2) Send the attribute information of the backup resource to other nodes through out-of-band UDP sockets to lay the foundation for the pre-establishment of backup resource connections; 3) Based on the completed backup resource attribute information, the QP status is changed through ibv_modify_qp to realize the pre-establishment of connection with the peer master resource.

5. The method of claim 4, wherein, The attribute information of the backup resources includes src_qpn, dst_qpn, src_gid, and src_lid.

6. The method of claim 1, wherein, Step S5, the complete connection between the fault signal and the backup resource is established when a fault occurs.

7. The method of claim 6, wherein, Step S5 specifically includes the following: 1) The faulty party sends a fault switching signal and the faulty party's QP attribute information to the non-faulty party, and the faulty party and the non-faulty party synchronously change the state of QP. 2) The backup resource qp on the faulty side and the primary resource qp on the non-faulty side are fully connected by changing the qp status through ibv_modify_qp.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-7.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-7.

10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-7.