A multi-channel connection method, device and equipment for data interaction, and a storage medium

CN116389545BActive Publication Date: 2026-10-27JINAN INSPUR DATA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310349937.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2026-10-27
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

虚拟IP漂移一般发生在节点故障时候,此种情况下,SMB业务数据会继续与该故障节点交互,不符合我们的预期,容易造成业务数据异常,断流等问题

Benefits of technology

[0032]由此可见,本申请公开了一种数据交互的多通道连接方法,应用于服务端,包括:若检测到目标服务节点的服务状态为异常状态时,则触发服务节点断连请求;基于所述服务节点断连请求查询与位于所述目标服务节点的虚拟IP关联的所有服务节点,将服务状态为正常状态的服务节点作为待连接服务节点;基于客户端发送的数据交互请求将所述待连接服务节点与所述客户端进行TCP重连接,获取正常状态的TCP连接通路,以便通过所述TCP连接通路进行所述客户端与所述服务端的数据交互。可见,通过检测服务节点的服务状态,将服务状态为异常状态的服务节点判断为发生虚拟IP漂移,SMB进程主动断开通过该节点所有服务节点的TCP连接。并筛选服务状态为正常状态的服务节点,此时,再有客户端进行读写时,会与虚拟IP所在的正常节点重新建立TCP连接,进行数据交互,从而保证其他业务的正常运行,提升集群的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389545B_ABST
    Figure CN116389545B_ABST
Patent Text Reader

Abstract

The application discloses a multi-channel connection method, device and equipment for data interaction and a storage medium, relates to the technical field of distributed storage, and comprises the following steps: if it is detected that the service state of a target service node is an abnormal state, triggering a service node disconnection request; querying all service nodes associated with a virtual IP located at the target service node based on the service node disconnection request, and taking the service nodes with normal service states as to-be-connected service nodes; performing TCP reconnection between the to-be-connected service nodes and a client based on a data interaction request sent by the client, obtaining a TCP connection path in a normal state, so that the client and the server can perform data interaction through the TCP connection path. The service state of the service node is detected, the service node with the abnormal service state is determined to have virtual IP drift, and the TCP connection of all service nodes is disconnected. The TCP connection with the normal node where the virtual IP is located is re-established, and data interaction is performed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed storage technology, and in particular to a multi-channel connection method, apparatus, device, and storage medium for data interaction. Background Technology

[0002] In distributed storage, after a client mounts a service node via Samba, it enters the mounted directory and can then access shared directories and files as if they were local files. This process requires the transmission of data packets between the client and server, and the server needs to provide feedback to the client after each successful data operation. Samba currently supports multi-channel connections, meaning that under certain conditions, the client can establish multiple TCP connections with the server, thereby increasing the packet transmission capacity of both the client and server, increasing system throughput, and improving Samba's read and write performance. Single-channel and multi-channel diagrams are shown below. Figure 1 As shown: In the current solution, the client establishes connections on all interconnected network interface cards (NICs) of the server. When the client establishes connections with both NICs (NIC 1 and NIC 2) of the server, assuming the CTDB (Cluster Trivial Database) virtual IP is configured on NIC 1, if the virtual IP of NIC 1 migrates, the SMB (Server Messages Block) process will disconnect the TCP connection through NIC 1, but not the TCP connection through NIC 2. At this time, when the client performs read / write operations, it will still communicate with the original node, not with the new node containing the virtual IP. Virtual IP migration typically occurs when a node fails. In this case, SMB service data will continue to interact with the failed node, which is not what we expect and can easily cause service data anomalies, network outages, and other problems.

[0003] In summary, how to accurately disconnect abnormal connections between the client and the server in the SMB process, and how to interact with non-faulty nodes to avoid business data anomalies and interruptions are technical problems that need to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a multi-channel connection method, apparatus, device, and storage medium for data interaction, which can accurately disconnect abnormal connections between the client and the server in the SMB process, and exchange business data with non-faulty nodes, avoiding business data anomalies and interruptions. The specific solution is as follows:

[0005] In a first aspect, this application discloses a multi-channel connection method for data interaction, applied to a server, comprising:

[0006] If the service status of the target service node is detected to be abnormal, a service node disconnection request will be triggered.

[0007] Based on the service node disconnection request, query all service nodes associated with the virtual IP located at the target service node, and select service nodes with a normal service status as service nodes to be connected.

[0008] Based on the data interaction request sent by the client, the service node to be connected is reconnected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact via the TCP connection path.

[0009] Optionally, before detecting that the service status of the target service node is abnormal, the method further includes:

[0010] When a data interaction request is received from the client, a status check is performed on the target network interface card where the virtual IP is located in the target service node.

[0011] Optionally, if the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered, including:

[0012] If the service status of the target network card in the target service node is detected to be abnormal, then the TCP connection of all network cards in the target service node will be disconnected.

[0013] Optionally, the step of selecting service nodes with a normal service status as service nodes to be connected includes:

[0014] Service nodes with abnormal service status are removed, and service nodes with normal status are selected as service nodes to be connected. The network card information of the service nodes to be connected is saved to a preset list.

[0015] Optionally, the step of reconnecting the service node to be connected to the client via TCP based on the data interaction request sent by the client includes:

[0016] The network card to be connected is determined based on the network card information in the preset list, and a multi-channel TCP reconnection is performed between the network card to be connected and the client based on the data interaction request.

[0017] Optionally, before determining the network card to be connected based on the network card information in the preset list, the method further includes:

[0018] Establish an initial connection between the client and the server to receive file system control requests;

[0019] The system queries a preset list based on the file system control request and returns the preset list to the client.

[0020] Secondly, this application discloses a multi-channel connection method for data interaction, applied to a client, including:

[0021] Send a data interaction request to the server;

[0022] Obtain the normal TCP connection established by the server in response to the data interaction request;

[0023] Data is exchanged with the server through the TCP connection.

[0024] Thirdly, this application discloses a multi-channel connection device for data interaction, applied to a server, comprising:

[0025] The request triggering module is used to trigger a service node disconnection request if the service status of the target service node is detected to be abnormal.

[0026] The node acquisition module is used to query all service nodes associated with the virtual IP located at the target service node based on the service node disconnection request, and to select service nodes with a normal service status as service nodes to be connected.

[0027] The data interaction module is used to reconnect the service node to be connected to the client via TCP based on the data interaction request sent by the client, and obtain a normal TCP connection path so that the client and the server can interact via the TCP connection path.

[0028] Fourthly, this application discloses an electronic device, comprising:

[0029] Memory, used to store computer programs;

[0030] A processor for executing the computer program to implement the steps of the aforementioned disclosed multi-channel connection method for data interaction.

[0031] Fifthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed multi-channel connection method for data interaction.

[0032] Therefore, this application discloses a multi-channel connection method for data interaction, applied to the server side, including: if the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered; based on the service node disconnection request, all service nodes associated with the virtual IP located at the target service node are queried, and service nodes with normal service status are selected as service nodes to be connected; based on the data interaction request sent by the client, the service nodes to be connected are reconnected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact through the TCP connection path. It can be seen that by detecting the service status of service nodes, service nodes with abnormal service status are judged to have experienced virtual IP migration, and the SMB process actively disconnects the TCP connections through all service nodes of that node. Service nodes with normal service status are then selected. At this time, when a client performs read / write operations, a new TCP connection will be established with the normal node where the virtual IP is located to perform data interaction, thereby ensuring the normal operation of other services and improving the reliability of the cluster. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 This is a schematic diagram illustrating a single-channel and multi-channel data interaction method disclosed in this application;

[0035] Figure 2 This is a flowchart of a multi-channel connection method for data interaction disclosed in this application;

[0036] Figure 3 This application discloses a flowchart of a specific multi-channel connection method for data interaction.

[0037] Figure 4 This is a flowchart of another multi-channel connection method for data interaction disclosed in this application;

[0038] Figure 5 This is a schematic diagram of a multi-channel connection device for data interaction disclosed in this application;

[0039] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0041] In distributed storage, after a client mounts a service node via Samba, it enters the mounted directory and can then access shared directories and files as if they were local files. This process requires the transmission of data packets between the client and server, and the server needs to provide feedback to the client after each successful data operation. Samba currently supports multi-channel connections, meaning that under certain conditions, the client can establish multiple TCP connections with the server, thereby increasing the packet transmission capacity of both the client and server, increasing system throughput, and improving Samba's read and write performance. Single-channel and multi-channel diagrams are shown below. Figure 1 As shown: In the current solution, the client establishes connections on all interconnected network interface cards (NICs) of the server. When the client establishes connections with both NICs (NIC 1 and NIC 2) of the server, assuming the CTDB virtual IP is configured on NIC 1, if the virtual IP of NIC 1 migrates, the SMB process will disconnect the TCP connection through NIC 1, but not the TCP connection through NIC 2. At this time, when the client performs read / write operations, it will still communicate with the original node, not with the new node containing the virtual IP. Virtual IP migration typically occurs when a node fails. In this case, SMB service data will continue to interact with the failed node, which is not what we expect and can easily cause service data anomalies, network outages, and other problems.

[0042] To this end, this application provides a multi-channel connection scheme for data interaction, which can accurately disconnect abnormal connections between the client and the server in the SMB process, and interact with non-faulty nodes to exchange business data, thereby avoiding business data abnormalities and interruptions.

[0043] Reference Figure 2 As shown, this embodiment of the invention discloses a multi-channel connection method for data interaction, applied to a server, including:

[0044] Step S11: If the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered.

[0045] In this embodiment, if the service status of the target network interface card (NIC) in the target service node is detected to be abnormal, the TCP connections of all NICs in the target service node are disconnected. It can be understood that by modifying the code logic on the server side, when the service status of the target NIC in the target service node is detected to be abnormal, a service node disconnection request is triggered on the target service node, so that the TCP connections of all NICs in the target service node can be disconnected promptly based on this request.

[0046] In this embodiment, before detecting an abnormal service status of the target service node, the method further includes: when a data interaction request is received from a client, performing a status check on the target network interface card (NIC) where the virtual IP is located within the target service node. It is understood that since it is uncertain whether all service nodes in the current distributed storage system are in a normal state during data read / write operations, when a data interaction request is received from a client, a status check needs to be performed on the previously connected target service node. It is important to note that since there may be multiple target NICs within a target service node, a status check is needed on the NIC where the virtual IP is located. This prevents situations where only one or a few target NICs within a target service node are abnormal, and a new data interaction request is received where a normal target NIC still exists within that target service node, causing the client to continue using that target service node for TCP connection. Therefore, upon receiving a data interaction request, a status check needs to be performed immediately on the NIC where the virtual IP is located. Once a virtual IP migration is detected, indicating a node failure in the target service node, all TCP connections with the entire service node are immediately disconnected. Avoid using service nodes in abnormal states for data interaction, which could cause business data anomalies and data interruptions.

[0047] Step S12: Based on the service node disconnection request, query all service nodes associated with the virtual IP located at the target service node, and select the service nodes with normal service status as the service nodes to be connected.

[0048] In this embodiment, based on the service node disconnection request, all service nodes associated with the current virtual IP are queried. It can be understood that, in order to maximize the utilization of each service node and reduce the waste of service node resources in a distributed storage structure, a virtual IP is usually associated with multiple service nodes. Therefore, when a data interaction request is received, it is uncertain which specific service node associated with the virtual IP is being used for the current data interaction. Therefore, it is necessary to query all service nodes associated with the current virtual IP based on the service node disconnection request, and select the service nodes with a normal service status from all the service nodes as the service nodes to be connected.

[0049] Step S13: Based on the data interaction request sent by the client, reconnect the service node to be connected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact via the TCP connection path.

[0050] In this embodiment, after the service node to be connected is determined, the service node to be connected and the client are reconnected via TCP based on the current data interaction request, so as to obtain a TCP connection path in a normal state, so as to facilitate data interaction between the client and the server through the TCP connection path in a normal state.

[0051] Therefore, this application discloses a multi-channel connection method for data interaction, applied to the server side, including: if the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered; based on the service node disconnection request, all service nodes associated with the virtual IP located at the target service node are queried, and service nodes with normal service status are selected as service nodes to be connected; based on the data interaction request sent by the client, the service nodes to be connected are reconnected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact through the TCP connection path. It can be seen that by detecting the service status of service nodes, service nodes with abnormal service status are judged to have experienced virtual IP migration, and the SMB process actively disconnects the TCP connections through all service nodes of that node. Service nodes with normal service status are then selected. At this time, when a client performs read / write operations, a new TCP connection will be established with the normal node where the virtual IP is located to perform data interaction, thereby ensuring the normal operation of other services and improving the reliability of the cluster.

[0052] Reference Figure 3 As shown, this embodiment of the invention discloses a specific multi-channel connection method for data interaction. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0053] Step S21: If the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered.

[0054] Step S22: Based on the service node disconnection request, query all service nodes associated with the virtual IP located at the target service node.

[0055] For more detailed processing procedures in steps S21 and S22, please refer to the aforementioned disclosed embodiments; they will not be repeated here.

[0056] Step S23: Remove service nodes with abnormal service status, obtain service nodes with normal status as service nodes to be connected, and save the network card information of the service nodes to be connected to a preset list.

[0057] In this embodiment, service nodes in an abnormal state are identified from all service nodes associated with the virtual IP, and these service nodes are removed, leaving only service nodes in a normal state. This means that all network interfaces (NICs) within these normal service nodes are functioning correctly. Then, the NICs in these normal service nodes are designated as the NICs to be connected, and their information is saved to a preset list of interfaces. Compared to the original solution, during the mounting negotiation phase, the Samba client negotiates whether both the client and server support multi-channel capabilities. If both ends have multi-channel capabilities, a multi-channel connection will be established during subsequent data read / write operations. After establishing a connection, the client sends an FSCTL request to query the server's interface list. Upon receiving the FSCTL request, the server returns its own interface list (containing all of the server's NICs) to the client based on its network conditions. When the client reads or writes data, it creates a multi-channel connection on each NIC based on the interface list returned by the server. During data read / write operations, the client establishes multi-channel connections with all network cards on the server, including the network card containing the CTDB virtual IP and other network cards. Therefore, when the server fails, the CTDB virtual IP migrates, and the SMB process only disconnects the SMB connection of the network card containing the virtual IP, without actively disconnecting the SMB connections of other network cards. In this case, when a client performs data read / write operations, it will still communicate with the failed node, potentially causing data anomalies and affecting normal user experience.

[0058] Step S24: Determine the network card to be connected based on the network card information to be connected in the preset list, and reconnect the network card to be connected to the client through multiple channels based on the data interaction request to obtain a normal TCP connection path so that the client and the server can interact through the TCP connection path.

[0059] In this embodiment, the network card information to be connected is obtained from a preset list, and then the network card to be connected is determined using the network card information. The network card to be connected is then connected to the client via a multi-channel TCP reconnection to form a multi-channel TCP connection, so that data interaction between the client and the server can be carried out through a normal TCP connection.

[0060] In this embodiment, before determining the network interface card (NIC) to be connected based on the information of the NICs to be connected in the preset list, the method further includes: establishing an initial connection between the client and the server to receive file system control requests; querying the preset list based on the file system control requests, and returning the preset list to the client. It can be understood that, firstly, during the negotiation phase, the client and server negotiate whether they both support multi-channel communication, i.e., establishing an initial connection to facilitate sending or receiving file system control requests through the initial connection. Then, based on the file system control requests, a preset list is queried and returned to the client to obtain the NIC information to be connected in the service node under normal conditions.

[0061] Therefore, by modifying the Samba server code, when a service node experiences virtual IP migration, the SMB process actively disconnects all SMB TCP connections through all network cards of that service node. A new SMB TCP connection is then established between the client and the new service node where the virtual IP resides. This new service node is a selected, healthy node without any faults. At this point, when the client needs to read or write data, it interacts directly with the new service node where the virtual IP resides, avoiding data interaction with the faulty node. This improves product stability and enhances its competitiveness.

[0062] Reference Figure 4 As shown, this embodiment of the invention also discloses a multi-channel connection method for data interaction, applied to a client, including:

[0063] Step S31: Send a data interaction request to the server.

[0064] In this embodiment, when a data read operation or a data write operation is required, a data interaction request is sent to the server.

[0065] Step S32: Obtain the normal TCP connection established by the server in response to the data interaction request.

[0066] In this embodiment, the receiving server determines the normal state of the service node for the data interaction request, establishes a TCP connection between the client and the normal state service node, and obtains a multi-channel TCP connection.

[0067] Step S33: Interact with the server via the TCP connection.

[0068] In this embodiment, a defined multi-channel TCP connection is used to interact with the server to complete data interaction requests for reading or writing data.

[0069] Therefore, this application discloses a multi-channel connection method for data interaction, applied to a client, comprising: sending a data interaction request to a server; obtaining a normal TCP connection established by the server in response to the data interaction request; and performing data interaction with the server through the TCP connection. It is evident that by detecting the service status of service nodes, service nodes with abnormal service status are identified as having experienced virtual IP migration, and the SMB process actively disconnects all TCP connections through that node. Service nodes with normal service status are then selected. When a client performs read / write operations, a new TCP connection will be established with the normal node containing the virtual IP for data interaction, thereby ensuring the normal operation of other services and improving the reliability of the cluster.

[0070] Reference Figure 5 As shown, this embodiment of the invention also discloses a multi-channel connection device for data interaction, applied to a server, comprising:

[0071] The request triggering module 11 is used to trigger a service node disconnection request if the service status of the target service node is detected to be abnormal.

[0072] The node acquisition module 12 is used to query all service nodes associated with the virtual IP located at the target service node based on the service node disconnection request, and to select service nodes with normal service status as service nodes to be connected.

[0073] Data interaction module 13 is used to reconnect the service node to be connected to the client via TCP based on the data interaction request sent by the client, and obtain a normal TCP connection path so that the client and the server can interact via the TCP connection path.

[0074] The request triggering module 11 is specifically used to disconnect the TCP connections of all network cards in the target service node when the service status of the target network card in the target service node is detected to be abnormal. It can be understood that by modifying the code logic on the server side, a service node disconnection request is triggered when the service status of the target network card in the target service node is detected to be abnormal, so that the TCP connections of all network cards in the target service node can be disconnected in a timely manner based on this request. Before the step of detecting that the service status of the target service node is abnormal, the module further includes: when a data interaction request sent by the client is received, performing a status check on the target network card where the virtual IP is located in the target service node. Understandably, since it's uncertain whether all service nodes in the distributed storage system are in a normal state during data read / write operations, when a data interaction request is received from a client, it's necessary to perform a status check on the previously connected target service node. It's important to note that since a target service node may have multiple target network interfaces (NICs), it's also necessary to check the status of the NIC containing the virtual IP. This prevents situations where only one or a few NICs within a target service node are abnormal, and a new data interaction request occurs, the client might still use that target service node for TCP connection because some NICs within it are still in a normal state. Therefore, upon receiving a data interaction request, the status of the NIC containing the virtual IP must be checked immediately. If the virtual IP is detected as drifting, indicating a node failure in the target service node, all TCP connections to the entire service node must be immediately disconnected. This avoids data corruption and service interruptions caused by using abnormally stated service nodes for data interaction.

[0075] The node acquisition module 12 is specifically used to query all service nodes associated with the current virtual IP based on the service node disconnection request. It is understood that in a distributed storage structure, to maximize the utilization of each service node and reduce resource waste, a virtual IP is usually associated with multiple service nodes. Therefore, when a data interaction request is received, it is uncertain which specific service node associated with the virtual IP is being used for the data interaction. Thus, it is necessary to query all service nodes associated with the current virtual IP based on the service node disconnection request, and select service nodes with a normal service status as the service nodes to be connected. Specifically, service nodes with abnormal service status are identified from all service nodes associated with the virtual IP and removed, leaving only service nodes in a normal state. That is, all network cards (NICs) in normal service nodes are normal NICs. Then, the NICs in the normal service nodes are identified as the NICs to be connected, and the NIC information is saved to a preset list `interface`. Compared to the original solution, during the mounting negotiation phase, the Samba client negotiates whether both the client and server support multi-channel capabilities. If both ends have multi-channel capabilities, a multi-channel connection will be established during subsequent data read / write operations. After the client and server establish a connection, the client sends an FSCTL request to query the server's interface list. Upon receiving the FSCTL request, the server returns its own interface list (which includes all network interfaces on the server) to the client based on its network conditions. When the client needs to read or write data, it will create a multi-channel connection on each network interface based on the interface list returned by the server. During data read / write operations, the client establishes multi-channel connections with all network cards on the server, including the network card containing the CTDB virtual IP and other network cards. Therefore, when the server fails, the CTDB virtual IP migrates, and the SMB process only disconnects the SMB connection of the network card containing the virtual IP, without actively disconnecting the SMB connections of other network cards. In this case, when a client performs data read / write operations, it will still communicate with the failed node, potentially causing data anomalies and affecting normal user experience.

[0076] The data interaction module 13 is specifically used to, after determining the service node to be connected, reconnect the service node to be connected to the client via TCP based on the current data interaction request to obtain a TCP connection path under normal conditions, facilitating data interaction between the client and the server through this normal TCP connection path. Specifically, it obtains the network interface card (NIC) information to be connected from a preset list, then uses the NIC information to determine the NIC to be connected, and reconnects the NIC to be connected to the client via multi-channel TCP reconnection, forming a multi-channel TCP connection so that data interaction between the client and the server can be performed through a normal TCP connection. Before determining the NIC to be connected based on the NIC information in the preset list, it also includes: establishing an initial connection between the client and the server to receive file system control requests; querying the preset list based on the file system control requests, and returning the preset list to the client. It can be understood that, firstly, during the negotiation phase, it negotiates whether both the client and the server support multi-channel communication, that is, establishing an initial connection to facilitate sending or receiving file system control requests through the initial connection, and then querying and returning a preset list to the client based on the file system control requests to obtain the NIC information to be connected in the service node under normal conditions.

[0077] Therefore, this application discloses a method that triggers a service node disconnection request when the service status of a target service node is detected to be abnormal. Based on the service node disconnection request, it queries all service nodes associated with the virtual IP located at the target service node, and selects service nodes with normal service status as service nodes to be connected. Based on the data interaction request sent by the client, it reconnects the service node to be connected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact via the TCP connection path. Thus, by detecting the service status of service nodes, service nodes with abnormal service status are identified as having experienced virtual IP migration, and the SMB process actively disconnects all TCP connections through that node. Service nodes with normal service status are then selected. When a client performs read / write operations, a new TCP connection will be established with the normal node where the virtual IP resides to perform data interaction, thereby ensuring the normal operation of other services and improving the reliability of the cluster.

[0078] In some specific embodiments, the multi-channel connection device for data interaction may specifically include:

[0079] The status detection unit is used to perform status detection on the target network interface card where the virtual IP is located in the target service node when a data interaction request is received from the client.

[0080] In some specific embodiments, the request triggering module 11 may specifically include:

[0081] The request triggering unit is used to disconnect the TCP connections of all network cards in the target service node if the service status of the target network card in the target service node is detected to be abnormal.

[0082] In some specific embodiments, the node acquisition module 12 may specifically include:

[0083] The node acquisition unit is used to remove service nodes with abnormal service status, acquire service nodes with normal status as service nodes to be connected, and save the network card information of the service nodes to be connected to a preset list.

[0084] In some specific embodiments, the data interaction module 13 may specifically include:

[0085] The data interaction unit is used to determine the network card to be connected based on the network card information to be connected in a preset list, and to perform multi-channel TCP reconnection between the network card to be connected and the client based on the data interaction request.

[0086] In some specific embodiments, the multi-channel connection device for data interaction may specifically include:

[0087] The list query unit is used to establish an initial connection between the client and the server in order to receive file system control requests; query a preset list based on the file system control requests, and return the preset list to the client.

[0088] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0089] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the multi-channel connection method for data interaction disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0090] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0091] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0092] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0093] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the multi-channel connection method for data interaction executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.

[0094] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned multi-channel connection method for data interaction. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0095] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0096] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementation should not be considered beyond the scope of this application. The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. Software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0097] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0098] The foregoing has provided a detailed description of a multi-channel connection method, apparatus, device, and storage medium for data interaction provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A multi-channel connection method for data interaction, characterized in that, Applied to distributed storage service clients that provide SMB multi-channel connections based on the CTDB virtual IP mechanism, including: If the service status of the target service node is detected to be abnormal, a service node disconnection request will be triggered. Based on the service node disconnection request, query all service nodes associated with the virtual IP located at the target service node, and select service nodes with a normal service status as service nodes to be connected. Based on the data interaction request sent by the client, the service node to be connected is reconnected to the client via TCP to obtain a normal TCP connection path, so that the client and the server can interact via the TCP connection path; Before detecting that the service status of the target service node is abnormal, the method further includes: When a data interaction request is received from the client, a status check is performed on the target network interface card (NIC) where the virtual IP of the target service node is located; wherein, the target service node is a service node that has established SMB TCP connections with the client through each NIC; If the service status of the target service node is detected to be abnormal, a service node disconnection request is triggered, including: If the service status of the target network card in the target service node is detected to be abnormal, a service node disconnection request is triggered, and the SMBTCP connections between the client and each network card of the target service node are disconnected through the SMB process. The step of selecting service nodes with a normal service status as service nodes to be connected includes: Service nodes with abnormal service status are removed, and service nodes with normal status are selected as service nodes to be connected. The network card information of the service nodes to be connected is saved to a preset list. The process of reconnecting the service node to be connected to the client via TCP based on the data interaction request sent by the client includes: The network card to be connected is determined based on the network card information in the preset list. A multi-channel SMB TCP connection is established between the client and the network card to be connected to obtain a normal TCP connection path, and data interaction requests are executed through the TCP connection path.

2. The multi-channel connection method for data interaction according to claim 1, characterized in that, Before determining the network card to be connected based on the network card information in the preset list, the method further includes: Establish an initial connection between the client and the server to receive file system control requests; The system queries a preset list based on the file system control request and returns the preset list to the client.

3. A multi-channel connection method for data interaction, characterized in that, Applied to the client side, including: The receiving end performs status detection on the target network interface card (NIC) where the virtual IP of the target service node is located. If the service status of the target NIC in the target service node is detected to be abnormal, a service node disconnection request is triggered, and the SMB TCP connections between the client and each NIC of the target service node are disconnected through the SMB process. Service nodes with abnormal service status are removed, and service nodes with normal status are selected as service nodes to be connected. The information of the NICs to be connected in the service nodes to be connected is saved to a preset list. The target service node is a service node that has established SMB TCP connections with the client through each NIC. Send a data interaction request to the server; Obtain the normal TCP connection established by the server in response to the data interaction request; Data is exchanged with the server through the TCP connection; The step of obtaining the normal TCP connection established by the server in response to the data interaction request includes: The server determines the network card to be connected based on the network card information in the preset list, establishes a multi-channel SMB TCP connection between the client and the network card to be connected, obtains a normal TCP connection path, and executes data interaction requests through the TCP connection path.

4. A multi-channel connection device for data interaction, characterized in that, Applied to distributed storage service clients that provide SMB multi-channel connections based on the CTDB virtual IP mechanism, including: The request triggering module is used to trigger a service node disconnection request if the service status of the target service node is detected to be abnormal. The node acquisition module is used to query all service nodes associated with the virtual IP located at the target service node based on the service node disconnection request, and to select service nodes with a normal service status as service nodes to be connected. The data interaction module is used to reconnect the service node to be connected to the client via TCP based on the data interaction request sent by the client, and obtain a normal TCP connection path so that the client and the server can interact via the TCP connection path; The multi-channel connection device for data interaction is further configured to perform status detection on the target network card where the virtual IP is located in the target service node when a data interaction request is received from the client; wherein, the target service node is a service node that has established SMB TCP connections with the client through each network card; The request triggering module is specifically used to trigger a service node disconnection request if the service status of the target network card in the target service node is detected to be abnormal, and to disconnect each SMB TCP connection between the client and each network card of the target service node through the SMB process. The node acquisition module is specifically used to remove service nodes with abnormal service status, acquire service nodes with normal status as service nodes to be connected, and save the network card information of the service nodes to be connected to a preset list. The data interaction module is specifically used to determine the network card to be connected based on the network card information to be connected in a preset list, establish a multi-channel SMB TCP connection between the client and the network card to be connected, obtain a normal TCP connection path, and execute data interaction requests through the TCP connection path.

5. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the multichannel connection method for data interaction as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the steps of the multi-channel connection method for data interaction as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Address switching method and address switching device

    CN108900647A

  • Fault recovery method, system and related components of distributed storage system

    CN109032830A

  • Virtual IP distribution method and related device

    CN110493060A

  • Method, system and device for establishing samba multi-channel connection optimization and storage medium

    CN114567642A