Communication channel function replacement method and device, equipment and medium

By obtaining network card configuration information and replacing the execution code segment, a communication channel supporting remote direct memory access is established, solving the problems of large workload and poor flexibility in the existing technology, and realizing efficient communication channel replacement.

CN121509560APending Publication Date: 2026-02-10JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511728879.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing technologies, the modification of communication interfaces based on the TCP/IP protocol stack in database systems, distributed storage systems, and high-performance computing clusters is labor-intensive and lacks flexibility, leading to performance bottlenecks.

Method used

By obtaining network card configuration information, a communication channel supporting remote direct memory access is established, the function of the initial interface is replaced with the function of the current interface, and a replacement execution code segment is generated to realize the replacement of the communication channel function.

Benefits of technology

It reduces the cost of modifying the Socket interface, improves communication efficiency, and enhances the flexibility and adaptability of the communication channel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509560A_ABST
    Figure CN121509560A_ABST
Patent Text Reader

Abstract

The invention discloses a communication channel function replacement method and device, equipment and a medium. The method comprises the following steps: acquiring network card configuration information of a first network card and network card configuration information of a second network card; establishing a current communication channel between the first device and the second device according to the network card configuration information of the first network card and the network card configuration information of the second network card; obtaining at least one initial method function associated with the initial interface; obtaining at least one current method function associated with the current interface; and for each current method function, in the code file of the initial interface, generating a replacement execution code segment of the current method function with the same function, the replacement execution code segment being used for replacing to execute the current method function with the same function when the execution of the initial method function is triggered. For the Socket interface which only supports direct adaptation of the TCP / IP protocol, the method and the device provided by the embodiment of the invention reduce the transformation cost of transforming the Socket interface into support of remote direct access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication channel technology, and in particular to a method, apparatus, device and medium for replacing communication channel functions. Background Technology

[0002] In scenarios such as database systems, distributed storage systems, and high-performance computing clusters, different devices heavily rely on network-based remote communication to transmit business data. Existing systems generally use file descriptor-based communication interfaces provided by the operating system (such as network communication interfaces based on the TCP / IP protocol stack) for data interaction, facilitating network programming for upper-layer business programs in a unified manner. However, with the expansion of business scale and the increase in data throughput, the overhead of the traditional TCP / IP protocol stack in kernel-mode, user-mode switching, and data copying has gradually become a bottleneck for system performance. High-performance network interface cards have begun to support protocols such as remote direct memory access, aiming to bypass parts of the kernel protocol stack, reduce communication latency and CPU usage, thereby improving overall data communication efficiency. This involves modifying the original file descriptor-based communication interface by adding the TCP / IP protocol.

[0003] Currently, existing technologies involve extensive modifications to the original interfaces to adapt to remote direct memory protocols.

[0004] However, existing technologies involve a large amount of modification work and lack flexibility. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and medium for replacing communication channel functions. For Socket interfaces that only support direct adaptation to the TCP / IP protocol, the embodiments of this invention reduce the cost of modifying Socket interfaces to support remote direct access.

[0006] In a first aspect, embodiments of the present invention provide a method for replacing a communication channel function, the method comprising:

[0007] Obtain the network card configuration information of the first network card and the network card configuration information of the second network card, wherein the second network card is a network card installed on the second device that supports remote memory access;

[0008] Based on the network card configuration information of the first network card and the network card configuration information of the second network card, establish the current communication channel between the first device and the second device;

[0009] Obtain at least one initial method function associated with the initial interface; the protocols supported by the initial interface do not support remote memory access.

[0010] Get at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access;

[0011] For each current method function, a replacement execution code segment with the same function is generated in the code file of the initial interface. The replacement execution code segment is used to replace the current method function with the function with the same function when the initial method function is triggered.

[0012] Secondly, embodiments of the present invention also provide a communication channel function replacement device, the device comprising:

[0013] The information acquisition module is used to acquire the network card configuration information of the first network card and the network card configuration information of the second network card, wherein the second network card is a network card installed on the second device that supports remote access to memory;

[0014] The channel establishment module is used to establish a current communication channel between the first device and the second device based on the network card configuration information of the first network card and the network card configuration information of the second network card.

[0015] The initial method functionality acquisition module is used to acquire at least one initial method functionality associated with the initial interface; the protocols supported by the initial interface do not support remote memory access.

[0016] The current method function acquisition module is used to acquire at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access;

[0017] The code replacement module is used to generate replacement execution code segments for the current method function in the code file of the initial interface for each current method function. The replacement execution code segments are used to replace the current method function with the function that performs the same function when the initial method function is triggered.

[0018] Thirdly, embodiments of the present invention also provide a communication channel function replacement device, the communication channel function replacement device comprising:

[0019] At least one processor; and

[0020] A memory that is communicatively connected to at least one processor; wherein,

[0021] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the communication channel function replacement method according to any embodiment of the present invention.

[0022] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to implement the communication channel function replacement method of any embodiment of the present invention when executed.

[0023] The technical solution of this invention, by obtaining the network interface card (NIC) configuration information of the first NIC and the second NIC, enables the establishment of subsequent communication channels to be configured based on actual hardware capabilities, which helps ensure that the current communication channel matches the characteristics of the NIC supporting remote memory access. By establishing the current communication channel between the first device and the second device based on the NIC configuration information of both ends, communication path configuration for specific NIC capabilities can be achieved, which helps provide a usable remote memory access communication channel between the two ends. By obtaining at least one initial method function associated with the initial interface, the interface call behavior under existing conditions that do not support remote memory access protocols can be clarified, providing a basis for subsequent function replacement without changing the semantics of the initial method function. By obtaining the current interface that is adapted to the current communication channel and supports the remote memory access protocol, the technical solution can be further optimized. At least one associated current method function can provide a corresponding implementation based on the remote memory access protocol for each initial method function, which is beneficial for migrating the original communication behavior to the current communication channel for execution. By generating replacement execution code segments with the same function for each current method function in the code file of the initial interface, the operation originally executed based on the protocol that does not support remote memory access can be replaced with the current method function that supports the protocol that supports remote memory access, while keeping the entry point of the initial method function unchanged. This is beneficial for replacing the communication channel function without modifying the upper layer calling method. It solves the technical problems of large modification workload and poor flexibility of the existing technology, thereby reducing the modification cost of the Socket interface to support remote direct access for the Socket interface that only supports direct adaptation of TCP / IP (Transmission Control Protocol / Internet Protocol).

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A flowchart illustrating a method for replacing a communication channel function according to an embodiment of the present invention;

[0027] Figure 2A flowchart illustrating a method for replacing a communication channel function according to an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of a communication channel function replacement device provided in an embodiment of the present invention;

[0029] Figure 4 This is a schematic diagram of a communication channel function replacement device provided in an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] In the technical solutions of the embodiments of the present invention, the acquisition, storage and application of network card configuration information, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0033] Figure 1 This is a flowchart illustrating a communication channel function replacement method provided in an embodiment of the present invention. This embodiment is applicable to situations involving communication channel function replacement. The method can be executed by a communication channel function replacement device, which can be implemented in hardware and / or software.

[0034] See Figure 1 The communication channel function replacement method shown is applied to a first device equipped with a first network interface card that supports remote memory access, and includes:

[0035] S101. Obtain the network card configuration information of the first network card and the network card configuration information of the second network card. The second network card is a network card installed on the second device that supports remote memory access.

[0036] The first network interface card (NIC) can refer to a NIC installed on the first device that has the capability to remotely access memory. The first device can refer to the main device acting as the client, which typically includes a processor, memory, storage devices, operating system, and drivers, and has the first NIC plugged in. The first NIC typically includes hardware structures such as a physical interface, electrical transceiver unit, protocol processing unit, and buffer. The first NIC can be an Ethernet NIC supporting RDMA (Remote Direct Memory Access), or it can be a dedicated high-speed Internet NIC supporting remote memory access. The first NIC can support remote memory access protocols such as RoCE (RDMA over Converged Ethernet) and iWARP (Internet Wide Area RDMA Protocol), and the specific protocol type is not limited.

[0037] Remote memory access (RMA) refers to a data exchange mechanism that allows one device to directly access the memory area of ​​another device over a network. Compared to traditional TCP / IP-based byte stream communication, it places greater emphasis on direct read and write operations to remote memory. The basic mechanism of RMA is to establish a communication channel with remote read and write capabilities between the sending and receiving ends, performing read and write operations on the memory area pre-registered by the other device. RMA is the protocol foundation of the current interface, enabling the current communication channel to provide efficient data transmission capabilities. Thus, after functional replacement of the initial interface, the communication between the first and second devices can be switched from a protocol that does not support RMA to one that does.

[0038] The network interface card (NIC) configuration information refers to a set of configuration information related to the current working status and performance of the NIC. This configuration information may include, but is not limited to: the NIC's IP (Internet Protocol) address, port number, supported protocol types, bandwidth capacity, queue size, maximum transmission unit (MTBF), configured communication ports, and supported remote memory access parameters. The first and second NICs each have their own corresponding NIC configuration information.

[0039] The second network interface card (NIC) can refer to a network interface card installed on a second device that also supports remote memory access. The second device can refer to the main body of the server, which typically includes basic components such as a processor, memory, storage devices, operating system, and drivers, and has the first NIC plugged into it.

[0040] Optionally, the roles of the first and second devices are not limited. When the first device acts as a client, the second device acts as a server; when the first device acts as a server, the second device acts as a client.

[0041] S102. Based on the network card configuration information of the first network card and the network card configuration information of the second network card, establish a current communication channel between the first device and the second device.

[0042] The current communication channel refers to the data transmission channel established between the first and second devices that supports remote memory access protocols. The current communication channel is the actual transmission path carrying the protocols supported by the current interface, replacing the original communication path that does not support remote memory access. For example, the current communication channel can consist of a set of multiple logical channels composed of multiple RDMA queue pairs and corresponding memory buffers. The transmission capacity of each communication sub-channel can be allocated according to the network card bandwidth and application load.

[0043] S103. Obtain at least one initial method function associated with the initial interface; the protocol supported by the initial interface does not support remote memory access.

[0044] The initial interface can refer to the existing interface in the first device used for data communication, whose supported protocols do not support remote memory access. The initial interface can be a file descriptor-based communication interface, such as a socket interface, which structurally includes a set of initial methods for establishing a connection, sending data, receiving data, and closing the connection. The protocol attributes of the initial interface are usually byte stream communication based on Transmission Control Protocol and Internet Protocol (such as TCP / IP).

[0045] The initial method functionality refers to one or more specific method functionalities provided by the initial interface to implement communication behavior. It is an operational unit executed under protocols that do not support remote memory access. The initial method functionality is the target object being replaced. By performing operations such as function name mapping and code segment replacement on the initial method functionality, the actual execution logic can be switched to the current method functionality that supports remote memory access, while ensuring that the caller still invokes the initial method functionality.

[0046] S104. Obtain at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access.

[0047] The current interface refers to an interface adapted to the current communication channel and providing data communication capabilities based on a protocol that supports remote memory access. It is the interface used to replace the underlying implementation of the initial interface, which does not support remote memory access. The current interface is the target interface for replacing the communication channel's functionality. By obtaining the current method functionality associated with the current interface and generating a replacement execution code segment in the initial interface's code file, the data communication operations originally executed based on the initial interface can be replaced with those executed based on the current interface, thus switching the communication channel from a protocol that does not support remote memory access to one that does.

[0048] The current method function can refer to the communication method function provided by the current interface, which is based on a remote memory access protocol and is used to perform the same or corresponding communication operation as the initial method function on the current communication channel.

[0049] S105. For each current method function, generate a replacement execution code segment with the same function in the code file of the initial interface. The replacement execution code segment is used to replace the current method function with the function with the same function when the initial method function is triggered.

[0050] The replacement execution code segment refers to a piece of program code in the code file of the initial interface that replaces the original execution flow of the initial method function. While formally triggered by the call entry point of the initial method function, logically it executes the corresponding current method function. By generating the replacement execution code segment, the actual execution process can be switched to the current method function of the current interface based on remote memory access, while retaining the initial interface call format (e.g., based on socket interface, based on TCP / IP). This allows the communication channel between the first and second devices to migrate from a protocol that does not support remote memory access to a current communication channel that does support remote memory access. For example, the original send(fd, buf, len) function in the initial interface originally called the sending logic based on the TCP / IP protocol stack; the replacement execution code segment can be changed to: calling the current method function rdma_send(qp, mr, len) according to the name correspondence, and completing the mapping from file descriptors to current communication channel identifiers (e.g., queue pairs) in the code segment.

[0051] As can be seen, in this embodiment, by obtaining the network interface card (NIC) configuration information of the first and second NICs, the establishment of subsequent communication channels can be configured based on actual hardware capabilities, which helps ensure that the current communication channel matches the characteristics of the NICs that support remote memory access. By establishing the current communication channel between the first and second devices based on the NIC configuration information at both ends, communication path configuration can be implemented for specific NIC capabilities, which helps provide a usable remote memory access communication channel between the two ends. By obtaining at least one initial method function associated with the initial interface, the interface call behavior that does not support the remote memory access protocol can be clarified, providing a basis for subsequent function replacement without changing the semantics of the initial method function. By obtaining at least one current method function associated with the current interface that is compatible with the current communication channel and supports the remote memory access protocol, It can provide a corresponding implementation based on the remote memory access protocol for each initial method function, which is beneficial for migrating the original communication behavior to the current communication channel. By generating replacement execution code segments with the same function for each current method function in the code file of the initial interface, it is possible to replace the operation originally executed based on the protocol that does not support remote memory access with the current method function that supports the remote memory access protocol, while keeping the entry point of the initial method function unchanged. This is beneficial for replacing the communication channel function without modifying the upper layer calling method. It solves the technical problems of large amount of modification work and poor flexibility of the existing technology, thereby reducing the modification cost of the Socket interface to support remote direct access for the Socket interface that only supports direct adaptation of the TCP / IP protocol.

[0052] In an optional embodiment, Figure 2 The flowchart of a communication channel function replacement method provided in this embodiment of the invention refines the process of "generating a replacement execution code segment with the same function for each current method function in the code file of the initial interface" into "for each current method function, obtain the function name corresponding to the initial method function and the function name corresponding to the current method function; determine the name correspondence between the function name corresponding to the initial method function and the function name corresponding to the current method function based on the correspondence between the initial method function and the current method function; generate a replacement execution code segment with the same function for the current method function in the code file of the initial interface based on the name correspondence," thereby improving the operation of communication channel function replacement.

[0053] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.

[0054] See Figure 2 The communication channel function replacement method shown includes:

[0055] S201. Obtain the network card configuration information of the first network card and the network card configuration information of the second network card. The second network card is a network card installed on the second device that supports remote access to memory.

[0056] S202. Based on the network card configuration information of the first network card and the network card configuration information of the second network card, establish a current communication channel between the first device and the second device.

[0057] S203. Obtain at least one initial method function associated with the initial interface; the protocol supported by the initial interface does not support remote memory access.

[0058] S204. Obtain at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access.

[0059] S205. For each current method function, obtain the function name corresponding to the initial method function and the function name corresponding to the current method function.

[0060] The function name can refer to the symbolic name used in the initial interface and the current interface to identify the function of the initial method and the function of the current method, and to distinguish the logical entities of different method functions.

[0061] S206. Based on the correspondence between the functions of the initial method and the current method, determine the name correspondence between the function name corresponding to the function of the initial method and the function name corresponding to the function of the current method.

[0062] The name correspondence can refer to the one-to-one mapping relationship between the initial function name and the current function name established based on the functional correspondence between the initial method function and the current method function.

[0063] S207. Based on the name correspondence, generate a replacement execution code segment with the same function as the current method in the code file of the initial interface. The replacement execution code segment is used to replace the current method with the same function when the initial method is triggered.

[0064] As can be seen, in this embodiment, by obtaining the function names corresponding to the initial method function and the current method function for each current method function, the code-level identifiers of each initial method function and the current method function with the same function can be clearly identified, providing a foundation for establishing accurate correspondences later. By determining the name correspondence between the function names corresponding to the initial method function and the current method function based on the correspondence between the initial method function and the current method function, a stable mapping relationship can be established at the function name level. By generating replacement execution code segments for the current method function with the same function in the code file of the initial interface based on the name correspondence, the actual execution process can be automatically switched to be completed by the current method function on the current communication channel without changing the way the upper layer calls the initial method function, thereby achieving a smooth replacement of the communication channel function.

[0065] In some embodiments, establishing a current communication channel between a first device and a second device based on the network interface card (NIC) configuration information of a first NIC and the NIC configuration information of a second NIC includes:

[0066] Based on the network card configuration information of the first network card, determine the first communication port of the first device;

[0067] Based on the network card configuration information of the second network card, determine the second communication port of the second device;

[0068] Establish a current communication channel between the first device and the second device based on the first communication port and the second communication port.

[0069] The first communication port can refer to the communication port determined on the first device based on the network card configuration information of the first network card, which is used to participate in the establishment of the current communication channel and serves as the communication entry point of the current communication channel on the first device side.

[0070] The second communication port can refer to the communication port determined on the second device based on the network card configuration information of the second network card, which is used to participate in the establishment of the current communication channel and serves as the communication entry point of the current communication channel on the second device side.

[0071] As can be seen, in this embodiment, by establishing the current communication channel between the first device and the second device based on the network card configuration information of the first network card and the second network card, the establishment process of the current communication channel can fully consider the actual capabilities and configuration parameters of the network cards at both ends. By determining the first communication port of the first device based on the network card configuration information of the first network card, a communication endpoint that meets the configuration constraints of the first network card can be selected on the first device side. By determining the second communication port of the second device based on the network card configuration information of the second network card, a communication endpoint that matches the capabilities of the second network card can be selected on the second device side. By establishing the current communication channel between the first device and the second device based on the first communication port and the second communication port, a specific communication path can be formed between the determined communication ports at both ends, thereby carrying subsequent data transmission on the communication path.

[0072] In some embodiments, establishing a current communication channel between the first device and the second device includes:

[0073] Based on the network interface card (NIC) configuration information of the first NIC and the NIC configuration information of the second NIC, determine the total transmission capacity of the current communication channel and the number of communication sub-channels;

[0074] The transmission capacity of each communication sub-channel is determined based on the total transmission capacity and the number of sub-channels.

[0075] Based on the transmission sub-capacity, the first communication port, and the second communication port, establish at least one communication sub-channel between the first device and the second device;

[0076] Based on each communication sub-channel, determine the current communication channel between the first device and the second device.

[0077] The total transmission capacity can refer to the quantitative indicator of the overall bandwidth or overall transmission capability that can be allocated for data transmission under the constraints of the network card configuration information of the first and second network cards for the current communication channel.

[0078] The number of sub-channels refers to the number of communication sub-channels divided into the current communication channel according to the total transmission capacity. The number of sub-channels is used to characterize how many independent sub-paths the current communication channel is divided into.

[0079] For example, based on the network card configuration information of the first network card and the second network card, it can be determined that the total transmission capacity of the current communication channel is 40Gbps; it can also be determined that the current communication channel can support a total of N data streams, each stream having a certain maximum throughput capacity, based on the RDMA queue and buffer configuration.

[0080] Among them, transmission sub-capacity can refer to the sub-capacity allocated for data transmission to each communication sub-channel after the total transmission capacity and the number of sub-channels are determined. It is a subdivision of the total transmission capacity in the sub-channel dimension.

[0081] In this context, a communication subchannel can refer to a specific logical communication channel established between the first communication port and the second communication port in the current communication channel, based on the transmission subcapacity configuration, to carry part of the data stream. Multiple subchannels constitute the communication channel.

[0082] As can be seen, in this embodiment, by establishing at least one communication sub-channel between the first device and the second device according to the transmission sub-capacity, the first communication port and the second communication port, a specific transmission path with a predetermined transmission capacity can be formed between the communication ports determined at both ends, thereby enabling parallel or hierarchical data transmission between different communication sub-channels.

[0083] In some embodiments, after establishing at least one communication sub-channel between the first device and the second device, the method further includes:

[0084] For each communication sub-channel, obtain the verification parameters of the first device and the verification parameters of the second device. The verification parameters include: sub-channel identifier;

[0085] The verification parameters of the first device and the verification parameters of the second device are compared to determine the alignment verification result of the communication sub-channel. The alignment verification result is used to verify whether the identification information of the communication sub-channel is the same on the first device and the second device.

[0086] The verification parameters refer to a set of parameters used to verify the configuration consistency of the communication sub-channel between the first device and the second device, and include at least the sub-channel identifier. After establishing at least one communication sub-channel, verification parameters related to each communication sub-channel are obtained from the first device and the second device, respectively. By comparing these verification parameters, it is determined whether the configuration of the communication sub-channel at both ends is consistent, thereby determining the alignment verification result.

[0087] The alignment verification result can refer to the result obtained after comparing the verification parameters of the first device and the second device, which indicates whether the identification information of the communication sub-channel is consistent at both ends.

[0088] The identification information can refer to the identifier used to determine whether the configurations at both ends of the first and second devices are consistent.

[0089] As can be seen, in this embodiment, by adding verification-related processing steps after establishing at least one communication sub-channel between the first device and the second device, the communication sub-channel can be further checked after its creation. This allows for a verification step to be reserved for subsequent confirmation of whether the communication sub-channel configuration is correct. By comparing the verification parameters of the first device and the second device, the alignment verification result of the communication sub-channel is determined. The alignment verification result is then used to verify whether the identification information of the communication sub-channel on the first device and the second device is the same. This allows for the determination of whether the configurations of each communication sub-channel are aligned at the identification information level, thereby identifying communication sub-channels with inconsistent configurations or incorrect mappings.

[0090] In some embodiments, after establishing at least one communication sub-channel between the first device and the second device, the method further includes:

[0091] Obtain the standard verification message sent by the second device;

[0092] The standard verification message is inspected to obtain the message inspection result;

[0093] Based on the message detection results, determine the connection status of the sub-communication channel; the connection status includes: connection successful and connection failed.

[0094] Based on the connection status, determine whether the sub-communication channel is transmitting accurate data.

[0095] In this context, a standard verification message can refer to a test message with a pre-agreed format sent by a second device, used by the first device to detect the connection status of the communication sub-channel and the accuracy of data transmission. As a test message actively probing the status of the sub-communication channel, the standard verification message is used to detect the connectivity and reliability of the channel without carrying service data, providing a verification means for stable operation after the communication channel function is replaced. For example, a standard verification message can be a fixed-length, predictable test message containing a known pattern of byte sequences and CRC checksums; it can also be a heartbeat message containing an incrementing sequence number, used to detect packet loss and out-of-order delivery.

[0096] The message detection result can refer to the result obtained by the first device after detecting the received standard verification message, which is used to reflect whether the standard verification message conforms to the expected format, content and completeness.

[0097] As can be seen, in this embodiment, by adding a follow-up processing step after establishing at least one communication sub-channel between the first device and the second device, the operating status of the sub-communication channel can be further checked after its creation. This allows for a detection step to be reserved for subsequent determination of whether the sub-communication channel is available. By detecting the standard verification message, the message detection result can be obtained. The content, format, or completeness of the verification message can be used to determine whether the message meets expectations, thus providing a basis for subsequent evaluation of the connectivity of the sub-communication channel based on the result.

[0098] In some embodiments, the initial interface includes a socket interface; the protocols supported by the initial interface include those based on Transmission Control Protocol and Internet Protocol.

[0099] As can be seen, in this embodiment, by limiting the initial interface to a socket interface and limiting the protocols supported by the initial interface to Transmission Control Protocol and Internet Protocol, it can be clearly stated that the initial interface corresponds to the existing conventional network communication method based on TCP / IP. This provides a clear basis for comparison when replacing the underlying communication channel with the current interface that supports remote memory access while keeping the socket programming mode unchanged.

[0100] Figure 3 This invention provides a schematic diagram of a communication channel function replacement device. This invention is applicable to situations involving communication channel function replacement; the device can execute a communication channel function replacement method and can be implemented in hardware and / or software.

[0101] See Figure 3 The communication channel function replacement device shown includes: an information acquisition module 301, a channel establishment module 302, an initial method function acquisition module 303, a current method function acquisition module 304, and a code replacement module 305, wherein...

[0102] The information acquisition module 301 is used to acquire the network card configuration information of the first network card and the network card configuration information of the second network card, wherein the second network card is a network card installed in the second device that supports remote access to memory;

[0103] The channel establishment module 302 is used to establish a current communication channel between the first device and the second device based on the network card configuration information of the first network card and the network card configuration information of the second network card.

[0104] The initial method function acquisition module 303 is used to acquire at least one initial method function associated with the initial interface; the protocol supported by the initial interface does not support remote memory access.

[0105] The current method function acquisition module 304 is used to acquire at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access;

[0106] The code replacement module 305 is used to generate replacement execution code segments with the same function of the current method in the code file of the initial interface for each current method function. The replacement execution code segments are used to replace the current method function with the function of the same function when the initial method function is triggered.

[0107] The technical solution of this invention, by obtaining the network interface card (NIC) configuration information of the first NIC and the second NIC, enables the establishment of subsequent communication channels to be configured based on actual hardware capabilities, which helps ensure that the current communication channel matches the characteristics of the NIC supporting remote memory access. By establishing the current communication channel between the first device and the second device based on the NIC configuration information of both ends, communication path configuration for specific NIC capabilities can be achieved, which helps provide a usable remote memory access communication channel between the two ends. By obtaining at least one initial method function associated with the initial interface, the interface call behavior under existing non-remote memory access protocols can be clarified, providing a basis for subsequent function replacement without changing the semantics of the initial method function. By obtaining at least one current method function associated with the current interface that is adapted to the current communication channel and supports the remote memory access protocol, the technical solution can further enhance the communication channel. This approach provides a corresponding implementation based on the remote memory access protocol for each initial method function, facilitating the migration of existing communication behaviors to the current communication channel. By generating replacement execution code segments with the same functionality for each current method function in the initial interface code file, operations originally executed based on protocols that do not support remote memory access can be replaced with current method functions that support remote memory access protocols, while keeping the initial method function call entry point unchanged. This allows for the replacement of communication channel functions without modifying the upper-layer calling method. It solves the technical problems of existing technologies, such as large modification workload and poor flexibility, thereby reducing the modification cost of Socket interfaces that only support direct TCP / IP protocol adaptation to support remote direct access.

[0108] In some embodiments, in generating replacement execution code segments with the same functionality for each current method function in the code file of the initial interface, the code replacement module 305 is specifically used for:

[0109] For each current method function, obtain the function name corresponding to the initial method function and the function name corresponding to the current method function;

[0110] Based on the correspondence between the functions of the initial method and the current method, determine the name correspondence between the function names corresponding to the functions of the initial method and the function names corresponding to the functions of the current method;

[0111] Based on the name correspondence, a replacement execution code segment with the same functionality as the current method is generated in the code file of the initial interface.

[0112] In some embodiments, in establishing a current communication channel between a first device and a second device based on the network interface card (NIC) configuration information of the first NIC and the NIC configuration information of the second NIC, the channel establishment module 302 is specifically used for:

[0113] Based on the network card configuration information of the first network card, determine the first communication port of the first device;

[0114] Based on the network card configuration information of the second network card, determine the second communication port of the second device;

[0115] Establish a current communication channel between the first device and the second device based on the first communication port and the second communication port.

[0116] In some embodiments, the channel establishment module 302 is specifically configured to: In establishing a current communication channel between the first device and the second device,

[0117] Based on the network interface card (NIC) configuration information of the first NIC and the NIC configuration information of the second NIC, determine the total transmission capacity of the current communication channel and the number of communication sub-channels;

[0118] The transmission capacity of each communication sub-channel is determined based on the total transmission capacity and the number of sub-channels.

[0119] Based on the transmission sub-capacity, the first communication port, and the second communication port, establish at least one communication sub-channel between the first device and the second device;

[0120] Based on each communication sub-channel, determine the current communication channel between the first device and the second device.

[0121] In some embodiments, after establishing at least one communication sub-channel between the first device and the second device, the channel establishment module 302 is further specifically configured to:

[0122] For each communication sub-channel, obtain the verification parameters of the first device and the verification parameters of the second device. The verification parameters include: sub-channel identifier;

[0123] The verification parameters of the first device and the verification parameters of the second device are compared to determine the alignment verification result of the communication sub-channel. The alignment verification result is used to verify whether the identification information of the communication sub-channel is the same on the first device and the second device.

[0124] In some embodiments, after establishing at least one communication sub-channel between the first device and the second device, the channel establishment module 302 is further specifically configured to:

[0125] Obtain the standard verification message sent by the second device;

[0126] The standard verification message is inspected to obtain the message inspection result;

[0127] Based on the message detection results, determine the connection status of the sub-communication channel; the connection status includes: connection successful and connection failed.

[0128] Based on the connection status, determine whether the sub-communication channel is transmitting accurate data.

[0129] In some embodiments, the initial interface includes a socket interface; the protocols supported by the initial interface include those based on Transmission Control Protocol and Internet Protocol.

[0130] The communication channel function replacement device provided in this embodiment of the invention can execute the communication channel function replacement method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the communication channel function replacement method.

[0131] Figure 4 This is a schematic diagram of a communication channel function replacement device provided in an embodiment of the present invention.

[0132] like Figure 4 As shown, the communication channel function replacement device 400 includes at least one processor 401 and a memory, such as a read-only memory (ROM) 402 or a random access memory (RAM) 403, communicatively connected to the at least one processor 401. The memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes based on the computer program stored in the ROM 402 or loaded into the RAM 403 from storage unit 408. The RAM 403 may also store various programs and data required for the operation of the communication channel function replacement device 400. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 408 is also connected to the bus 404.

[0133] Multiple components in the communication channel function replacement device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, optical disk, etc.; and a communication unit 409, such as a network card, modem, wireless transceiver, etc. The communication unit 409 allows the communication channel function replacement device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0134] Processor 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 401 performs the various methods and processes described above, such as the communication channel function replacement method.

[0135] In some embodiments, the communication channel function replacement method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the communication channel function replacement device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the communication channel function replacement method described above may be performed. Alternatively, in other embodiments, processor 401 may be configured to perform the communication channel function replacement method by any other suitable means (e.g., by means of firmware).

[0136] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and communicating data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0138] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0139] To provide interaction with the user, the systems and techniques described herein can be implemented on an operational detection device. This communication channel function replacement device includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the communication channel function replacement device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0140] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0141] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

[0142] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for replacing the function of a communication channel, characterized in that, The method, applied to a first device having a first network interface card (NIC) that supports remote memory access, includes: Obtain the network card configuration information of the first network card and the network card configuration information of the second network card, wherein the second network card is a network card installed on the second device that supports remote memory access; Based on the network card configuration information of the first network card and the network card configuration information of the second network card, a current communication channel is established between the first device and the second device; Obtain at least one initial method function associated with the initial interface; the protocol supported by the initial interface does not support remote memory access. Obtain at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access; For each of the current method functions, a replacement execution code segment with the same function is generated in the code file of the initial interface. The replacement execution code segment is used to replace the current method function with the function that performs the same function when the initial method function is triggered.

2. The method according to claim 1, characterized in that, For each of the current method functions, in the code file of the initial interface, a replacement execution code segment with the same function is generated, including: For each of the current method functions, obtain the function name corresponding to the initial method function and the function name corresponding to the current method function; Based on the correspondence between the initial method function and the current method function, determine the name correspondence between the function name corresponding to the initial method function and the function name corresponding to the current method function; Based on the name correspondence, a replacement execution code segment with the same function as the current method is generated in the code file of the initial interface.

3. The method according to claim 1, characterized in that, The step of establishing a current communication channel between the first device and the second device based on the network interface card (NIC) configuration information of the first NIC and the NIC configuration information of the second NIC includes: Based on the network card configuration information of the first network card, determine the first communication port of the first device; Based on the network card configuration information of the second network card, determine the second communication port of the second device; A current communication channel is established between the first device and the second device based on the first communication port and the second communication port.

4. The method according to claim 3, characterized in that, Establishing the current communication channel between the first device and the second device includes: Based on the network card configuration information of the first network card and the network card configuration information of the second network card, determine the total transmission capacity and the number of communication sub-channels of the current communication channel; The transmission capacity of each communication sub-channel is determined based on the total transmission capacity and the number of sub-channels. Based on the transmission sub-capacity, the first communication port, and the second communication port, at least one communication sub-channel is established between the first device and the second device; The current communication channel between the first device and the second device is determined based on each of the aforementioned communication sub-channels.

5. The method according to claim 4, characterized in that, After establishing at least one communication sub-channel between the first device and the second device, the method further includes: For each of the communication sub-channels, the verification parameters of the first device and the verification parameters of the second device are obtained, wherein the verification parameters include: sub-channel identifier; The verification parameters of the first device and the verification parameters of the second device are compared to determine the alignment verification result of the communication sub-channel. The alignment verification result is used to verify whether the identification information of the communication sub-channel is the same on the first device and the second device.

6. The method according to claim 4, characterized in that, After establishing at least one communication sub-channel between the first device and the second device, the method further includes: Obtain the standard verification message sent by the second device; The standard verification message is inspected to obtain the message inspection result; Based on the message detection results, the connection status of the sub-communication channel is determined; the connection status includes: connection successful and connection failed. Based on the connection status, determine whether the sub-communication channel transmits accurate data.

7. The method according to claim 1, characterized in that, The initial interface includes a socket interface; the protocols supported by the initial interface include those based on Transmission Control Protocol and Internet Protocol.

8. A communication channel function replacement device, characterized in that, include: The information acquisition module is used to acquire the network card configuration information of the first network card and the network card configuration information of the second network card, wherein the second network card is a network card installed in the second device that supports remote access to memory; The channel establishment module is used to establish a current communication channel between the first device and the second device based on the network card configuration information of the first network card and the network card configuration information of the second network card. An initial method function acquisition module is used to acquire at least one initial method function associated with the initial interface; the protocol supported by the initial interface does not support remote memory access. The current method function acquisition module is used to acquire at least one current method function associated with the current interface; the current interface is adapted to the current communication channel, and the protocol supported by the current interface supports remote memory access; The code replacement module is used to generate, in the code file of the initial interface, a replacement execution code segment for each of the current method functions, which is used to replace the current method function with the current method function that performs the same function when the initial method function is triggered.

9. A communication channel function replacement device, characterized in that, The communication channel function replacement device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the communication channel function replacement method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the communication channel function replacement method according to any one of claims 1-7.