A communication method, apparatus, device, and storage medium
By creating multiple communication links on each IB card and managing the link status through a consistency algorithm, the problem that a single IB card cannot meet the high-performance scenario is solved, and the reliability and performance of the communication link are fully utilized.
Patent Information
- Application Number
- CN202310452271.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2043-04-21
AI Technical Summary
In high-performance scenarios, a single IB card may not be able to meet the performance requirements. How to ensure the reliability of communication and fully utilize the performance of IB card is a problem that needs to be solved urgently.
Create multiple communication links on each IB card, and select one as available state through the consistency algorithm and the other link as standby state. When the IB card of the target link fails, reselect one from the link in the standby state as the new target link to ensure the reliability of communication.
Through multi-link handover technology, the reliability of the communication link between the client and the server is ensured, the performance of each IB card is fully utilized, and the stability of the server is improved.
Smart Images

Figure CN116248585B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly relates to a communication method, apparatus, device, and storage medium. Background Art
[0002] IB (Infiniband) cards are used for data transmission between a client and a server. The IB cards are related to the quality of communication. For example, in a distributed storage system, the client communicates with the storage system through an IB card to complete data access. However, in a high-performance scenario, a single IB card may not meet the performance requirements. How to ensure the reliability of communication and give full play to the performance of IB cards is an urgent problem to be solved currently. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a communication method, apparatus, device, and medium, which can give full play to the performance of each IB card and ensure the reliability of the communication link between the client and the server. The specific solutions are as follows:
[0004] In a first aspect, the present application discloses a communication method, including:
[0005] Create a link on each IB card for the inter-process communication between the client and the server;
[0006] Select a target link from all the links corresponding to the inter-process communication, set the link state of the target link to the available state, and set the link states of the remaining links to the standby state;
[0007] Undertake the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby state as the new target link to undertake the inter-process communication.
[0008] Optionally, the step of creating a link on each IB card for the inter-process communication between the client and the server includes:
[0009] On each IB card, create a link for each inter-process communication between the client and the server respectively.
[0010] Optionally, the step of selecting a target link from all the links corresponding to the inter-process communication and setting the link state of the target link to the available state includes:
[0011] Using a consistency algorithm, select a target link for each inter-process communication according to all the links corresponding to different inter-process communications, so that each inter-process communication has at least one link with the link state being the available state, and the links with the link state being the available state corresponding to different inter-process communications are evenly distributed on different IB cards.
[0012] Optionally, creating a link on each IB card includes:
[0013] Collecting IB card information by enabling timed scanning during client mounting;
[0014] According to the collected IB card information, creating a link for the inter-process communication on each IB card.
[0015] Optionally, reselecting a link from the links in the standby state as a new target link to undertake the inter-process communication includes:
[0016] Using a consistency algorithm to select a corresponding replacement link for each available target link on the faulty IB card from all the links in the standby state corresponding to different inter-process communications, and using the replacement link as the new target link to undertake the corresponding inter-process communication.
[0017] Optionally, after reselecting a link from the links in the standby state as a new target link to undertake the inter-process communication when the IB card corresponding to the target link fails, it further includes:
[0018] Periodically detecting the status of the IB card by a timer according to a preset period. When the IB card failure is recovered, resetting the link status of the target link to the available state, and setting the link status of the new target link to the standby state.
[0019] Optionally, when the IB card corresponding to the target link fails, reselecting a link from the links in the standby state as a new target link to undertake the inter-process communication includes:
[0020] When the IB card corresponding to the target link fails, selecting a new target link from all the links in the standby state corresponding to the inter-process communication;
[0021] Modifying the link status of the new target link to the available state, and modifying the link status of the original target link to the standby state, so as to use the new target link to undertake the inter-process communication.
[0022] In a second aspect, the present application discloses a communication device, including:
[0023] A link creation module, configured to create a link on each IB card for the inter-process communication between a client and a server;
[0024] A link state configuration module, configured to select a target link from all the links corresponding to the inter-process communication, set the link state of the target link to the available state, and set the link states of the remaining links to the standby state;
[0025] A link switching module, configured to undertake the inter-process communication through the target link, and when a fault occurs in the IB card corresponding to the target link, re-select a link from the links in the standby state as a new target link to undertake the inter-process communication.
[0026] In a third aspect, the present application discloses an electronic device, including:
[0027] A memory, configured to store a computer program;
[0028] A processor, configured to execute the computer program to implement the foregoing communication method.
[0029] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein the computer program, when executed by a processor, implements the foregoing communication method.
[0030] In the present application, a link is created on each IB card for the inter-process communication between the client and the server; a target link is selected from all the links corresponding to the inter-process communication, and the link state of the target link is set to the available state, while the link states of the remaining links are set to the standby state; the inter-process communication is undertaken through the target link, and when a fault occurs in the IB card corresponding to the target link, a link is re-selected from the links in the standby state as a new target link to undertake the inter-process communication. It can be seen that a communication link is created on each IB card for the docking between the client and the server, giving full play to the performance of each IB card and realizing multi-IB card communication based on multiple links; by creating a link for the inter-process communication on each IB card, and selecting one of the multiple links as the available state and the other links as the standby state, and switching the link when a fault occurs, it is ensured that at least one IB card between the client and the server is working, giving full play to the performance of each IB card while also ensuring the reliability of the communication link between the client and the server and improving the stability of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0032] Figure 1 A flowchart of a communication method provided for this application;
[0033] Figure 2 A specific flowchart of a communication method provided for this application;
[0034] Figure 3 A schematic structural diagram of a communication device provided for this application;
[0035] Figure 4 A structural diagram of an electronic device provided for this application. Detailed implementation manners
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0037] In the prior art, an IB card is used for data transmission between a client and a server. The IB card is related to the communication quality. For example, in a distributed storage system, the client communicates with the storage system through the IB card to complete data access and storage. However, in a high-performance scenario, a single IB card may not meet the performance requirements. How to ensure the reliability of communication and give full play to the performance of the IB card is an urgent problem to be solved currently. To overcome the above technical problems, this application proposes a communication method that can give full play to the performance of each IB card and ensure the reliability of the communication link between the client and the server.
[0038] An embodiment of this application discloses a communication method. Refer to Figure 1 As shown, the method may include the following steps:
[0039] Step S11: Create a link on each IB card for inter-process communication between the client and the server.
[0040] In this embodiment, first, a link is created on each IB card for inter-process communication between the client and the server. For example, if N IB cards are responsible for data transmission between the client and the server, a communication link is created on each of these N IB cards to obtain N communication links.
[0041] In this embodiment, creating a link on each IB card may include: enabling timed scanning during client mounting to collect IB card information; and creating a link for the inter-process communication on each IB card according to the collected IB card information. That is, during client mounting, the timed scanning function is enabled, relevant IB card information is collected through scanning, and then the client creates a link for supporting inter-process communication on each IB card respectively according to the collected IB card information.
[0042] Step S12: Select a target link from all the links corresponding to the inter-process communication, and set the link state of the target link to the available state, and set the link states of the remaining links to the standby state.
[0043] In this embodiment, after creating a link on each IB card for the inter-process communication, a target link is selected from all the links corresponding to the inter-process communication, and then through link state configuration, the link state of the target link is set to the available state, and the link states of the remaining links are set to the standby state. That is, although multiple communication links are created for the inter-process communication, only one link will be used for actual data transmission. In this embodiment, by configuring the link state, the link state includes the available state (active) and the standby state (standby), and the link with the available state will be automatically selected for data transmission during communication, while the link with the standby state set is considered unavailable to the client.
[0044] Step S13: Undertake the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby state as the new target link to undertake the inter-process communication.
[0045] In this embodiment, the target link is used to support the above inter-process communication. When the IB card corresponding to the target link fails, that is, when the target link cannot be used normally, to ensure the reliability of communication, a link is re-selected from all the links in the standby state corresponding to the inter-process communication as the new target link, that is, link switching is performed, switching from the original target link to the new target link, and then the new target link is used to undertake the inter-process communication. At this time, the IB card where the selected new target link is located is normal. By creating multiple links, the reliability of communication is ensured, and during a failure, the data can be switched in time to ensure the real-time response of the application program.
[0046] In this embodiment, when the IB card corresponding to the target link fails, reselecting a link from the links in the standby state as a new target link to undertake the inter-process communication may include: when the IB card corresponding to the target link fails, selecting a new target link from all the links in the standby state corresponding to the inter-process communication; modifying the link state of the new target link to the available state, and modifying the link state of the original target link to the standby state, so as to use the new target link to undertake the inter-process communication. That is, the link switching is realized by modifying the link state. Specifically, the link state of the new target link is modified from the standby state to the available state, and the link state of the original target link is modified from the available state to the standby state. Thus, based on the multi-link multi-IB card communication, by software processing, a communication link is created for each IB card to maintain multiple links. At the same time, one of the links is set to the available state, and the remaining links are set to the standby state, giving full play to the performance of the multi-IB card. In case of a failure, the link will be reallocated to a normal IB, improving the reliability of the communication link between the client and the storage server, ensuring the reliability of the client in a failure scenario, and enhancing the product competitiveness of the storage system.
[0047] In this embodiment, after reselecting a link from the links in the standby state as a new target link to undertake the inter-process communication when the IB card corresponding to the target link fails, it may further include: periodically detecting the state of the IB card by a timer according to a preset period, and when the IB card failure is recovered, resetting the link state of the target link to the available state, and setting the link state of the new target link to the standby state. By the timer, the state of each IB card is scanned periodically. When the IB card failure is recovered, the corresponding link state is reset to the IB state, that is, the link state of the above target link is modified from the standby state to the available state, and the link state of the above new target link is modified from the available state to the standby state.
[0048] As can be seen from the above, in this embodiment, a link is created on each IB card for the inter-process communication between the client and the server; a target link is selected from all the links corresponding to the inter-process communication, and the link state of the target link is set to the available state, while the link states of the remaining links are set to the standby state; the inter-process communication is carried out through the target link, and when the IB card corresponding to the target link fails, a new target link is re-selected from the links in the standby state to carry out the inter-process communication. It can be seen that a communication link is created on each IB card for the docking between the client and the server, giving full play to the performance of each IB card and realizing multi-IB card communication based on multiple links; by creating a link for the inter-process communication on each IB card and selecting one of the multiple links as the available state and the other links as the standby state, when a failure occurs, through link switching, it is ensured that at least one IB card between the client and the server is working, giving full play to the performance of each IB card while also ensuring the reliability of the communication link between the client and the server and improving the stability of the server.
[0049] An embodiment of the present application discloses a specific communication method. Refer to Figure 2 As shown, the method may include the following steps:
[0050] Step S21: On each IB card, create a link for each inter-process communication between the client and the server respectively.
[0051] Step S22: Using a consistency algorithm, select a target link for each inter-process communication according to all the links corresponding to different inter-process communications respectively, and set the link state of the target link to the available state, while the link states of the remaining links are set to the standby state.
[0052] That is, when there are multiple processes between the client and the server that need to exchange data, each inter-process communication corresponds to a link in the available state. Taking M inter-process communications and N IB cards as an example, each IB card has created links corresponding to each inter-process communication, that is, M links are created on each IB card, and these M links are respectively the links corresponding to M inter-process communications. In order to prevent all the target links (i.e., the links in the available state) used by the inter-process communications from being on the same IB card or some IB cards, in this embodiment, a consistency algorithm is adopted to balance the target links corresponding to different inter-process communications on different IB cards, so that each inter-process communication corresponds to at least one link with the link state being the available state, and the links with the link state being the available state corresponding to different inter-process communications are evenly distributed on different IB cards.
[0053] That is to say, when there are multiple processes between the client and the server that need to exchange data, according to the consistency algorithm, one link is selected and set to the available state, and the other links are set to the standby state. During normal communication, the links in the available state are balanced to different IB cards, so that the communication of some processes is placed on one card, and the communication of some other data is placed on another card. Each IB card has data traffic and is basically balanced. In this way, the performance of each IB card can be fully utilized.
[0054] It can be seen that for each IB card used by the client, a link is created. In this way, for multiple IB cards, multiple links will be created, and one of the links is set to the available state, and the remaining links are set to the standby state. At the same time, using the consistency algorithm, all available links between the client and the server are balanced to different IB cards. Under normal circumstances, each IB card has data traffic and is basically balanced.
[0055] Step S23: Receive the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby state as the new target link to receive the inter-process communication.
[0056] It can be understood that in actual operation, each link can communicate. Under normal circumstances, one of the links is selected for communication through the consistency algorithm, and the other links are in the standby state. In a failure scenario, some of the links in the standby state will become available. After the failure scenario is restored, the available links are re-balanced to different IB cards through the consistency algorithm. In this way, it not only ensures that all IB cards are used for communication under normal circumstances, but also ensures the reliability of the client communication link in a failure scenario.
[0057] In this embodiment, the step of re-selecting a link from the links in the standby state as the new target link to receive the inter-process communication may include: using the consistency algorithm to select a corresponding replacement link for each target link in the available state on the failed IB card from all the links in the standby state corresponding to the respective inter-process communications, and using the replacement link as the new target link to receive the corresponding inter-process communication. That is, when initially selecting the target link, the target link for data transmission is balanced on different IB cards according to the consistency algorithm. When an IB card fails and the link needs to be switched to ensure communication reliability, in order to still maintain the balance of the transmission pressure on different IB cards, the consistency algorithm is used again to select the replacement link.
[0058] Among them, the specific process of the above step S23 can refer to the corresponding content disclosed in the foregoing embodiments and will not be elaborated here.
[0059] As can be seen from the above, in each IB card of this embodiment, a link is created for each inter-process communication between the client and the server; using a consistency algorithm, a target link is selected for each inter-process communication according to all the links corresponding to different inter-process communications, and the link state of the target link is set to the available state, and the link states of the remaining links are set to the standby state, so that each inter-process communication corresponds to at least one link with an available link state, and the links with an available link state corresponding to different inter-process communications are evenly distributed on different IB cards. Thus, by creating a communication link for each IB card and configuring the link state, the link with the available state is the one in use, and the link with the standby state is the standby link. At the same time, the available state links are balanced to different IB cards, ensuring that each IB card can exert its respective performance. In a failure scenario, the reliability of the communication link is also ensured through link state switching, improving the stability of the storage system.
[0060] Correspondingly, the embodiment of the present application also discloses a communication device, as shown in Figure 3 shown, the device includes:
[0061] A link creation module 11, configured to create a link on each IB card for the inter-process communication between the client and the server;
[0062] A link state configuration module 12, configured to select a target link from all the links corresponding to the inter-process communication, and set the link state of the target link to the available state, and set the link states of the remaining links to the standby state;
[0063] A link switching module 13, configured to undertake the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby state as a new target link to undertake the inter-process communication.
[0064] As can be seen from the above, in this embodiment, a link is created on each IB card for the inter-process communication between the client and the server; a target link is selected from all the links corresponding to the inter-process communication, and the link state of the target link is set to the available state, while the link states of the remaining links are set to the standby state; the inter-process communication is carried by the target link, and when the IB card corresponding to the target link fails, a new target link is reselected from the links in the standby state to carry the inter-process communication. It can be seen that a communication link is created on each IB card for the docking between the client and the server, giving full play to the performance of each IB card and realizing multi-IB card communication based on multiple links; by creating a link for the inter-process communication on each IB card and selecting one of the multiple links as the available state and the other links as the standby state, and switching the links when a failure occurs, it is ensured that at least one IB card is working between the client and the server. While giving full play to the performance of each IB card, it also ensures the reliability of the communication link between the client and the server and improves the stability of the server.
[0065] In some specific embodiments, the link creation module 11 may specifically include:
[0066] A link creation unit, configured to create a link for each inter-process communication between the client and the server on each IB card.
[0067] In some specific embodiments, the link state configuration module 12 may specifically include:
[0068] A target link selection unit, configured to use a consistency algorithm to select a target link for each inter-process communication according to all the links corresponding to different inter-process communications, so that each inter-process communication has at least one link with an available state, and the links with an available state corresponding to different inter-process communications are evenly distributed on different IB cards.
[0069] In some specific embodiments, the link creation module 11 may specifically include:
[0070] A card information collection unit, configured to collect IB card information by enabling periodic scanning when the client is mounted;
[0071] A link creation unit, configured to create a link for the inter-process communication on each IB card according to the collected IB card information.
[0072] In some specific embodiments, the link switching module 13 may specifically include:
[0073] A replacement link selection unit, configured to use a consistency algorithm to select a corresponding replacement link for each available target link on a faulty IB card from all the links in the standby state corresponding to inter-process communications respectively, and use the replacement link as the new target link to undertake the corresponding inter-process communications.
[0074] In some specific embodiments, the communication device may further specifically include:
[0075] A timing detection unit, configured to detect the status of the IB card at a preset period through a timer, and when the fault of the IB card is recovered, reset the link status of the target link to the available state again, and set the link status of the new target link to the standby state.
[0076] In some specific embodiments, the link switching module 13 may specifically include:
[0077] A new target link selection unit, configured to select a new target link from all the links in the standby state corresponding to the inter-process communication when the IB card corresponding to the target link fails;
[0078] A link status modification unit, configured to modify the link status of the new target link to the available state, and modify the link status of the original target link to the standby state, so as to use the new target link to undertake the inter-process communication.
[0079] Furthermore, an embodiment of the present application also discloses an electronic device. Refer to Figure 4 as shown. The content in the figure shall not be construed as any limitation on the scope of use of the present application.
[0080] Figure 4 is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically 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. Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21.
[0081] When the processor 21 executes the computer subroutine stored in the memory 22, the following steps can be specifically implemented: create a link on each IB card for the inter-process communication between the client and the server; select a target link from all the links corresponding to the inter-process communication, and set the link state of the target link to the available state, and set the link states of the remaining links to the standby state; undertake the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby state as the new target link to undertake the inter-process communication. On each IB card, create a link for each inter-process communication between the client and the server respectively. Use the consensus algorithm to select a target link for each inter-process communication according to all the links corresponding to different inter-process communications, so that each inter-process communication corresponds to at least one link with the link state being the available state, and the links with the link state being the available state corresponding to different inter-process communications are evenly distributed on different IB cards. By enabling timed scanning when mounting the client to collect IB card information; according to the collected IB card information, create a link for the inter-process communication on each IB card. Use the consensus algorithm to select a corresponding replacement link for each target link in the available state on the faulty IB card according to all the links in the standby state corresponding to different inter-process communications, and use the replacement link as the new target link to undertake the corresponding inter-process communication. Periodically detect the status of the IB card by a timer according to a preset period. When the IB card fault is recovered, reset the link state of the target link to the available state, and set the link state of the new target link to the standby state. When the IB card corresponding to the target link fails, select a new target link from all the links in the standby state corresponding to the inter-process communication; modify the link state of the new target link to the available state, and modify the link state of the original target link to the standby state, so as to use the new target link to undertake the inter-process communication. Thus, a communication link is created on each IB card for the docking between the client and the server, giving full play to the performance of each IB card and realizing multi-IB card communication based on multiple links; by creating a link for the inter-process communication on each IB card and selecting one of the multiple links as the available state and the other links as the standby state, and switching the link when a fault occurs, it is ensured that at least one IB card is working between the client and the server. While giving full play to the performance of each IB card, it also ensures the reliability of the communication link between the client and the server and improves the stability of the server.
[0082] In this embodiment, the power supply 23 is used to provide operating voltages for the various hardware devices 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 specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to specific application requirements, and specific limitations are not imposed on it here.
[0083] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc., and the resources stored thereon include an operating system 221, a computer program 222, and data 223 including link states, etc., and the storage method can be temporary storage or permanent storage.
[0084] Among them, the operating system 221 is used to manage and control the various hardware devices and the computer program 222 on the electronic device 20 to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the communication method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0085] Furthermore, the embodiments of the present application also disclose a computer storage medium. Computer-executable instructions are stored in the computer storage medium. When the computer-executable instructions are loaded and executed by a processor, the following steps are specifically implemented: creating a link on each IB card for the inter-process communication between the client and the server; selecting a target link from all the links corresponding to the inter-process communication, setting the link state of the target link to the available state, and setting the link states of the remaining links to the standby state; undertaking the inter-process communication through the target link, and when the IB card corresponding to the target link fails, reselecting a link from the links in the standby state as the new target link to undertake the inter-process communication. On each IB card, a link is respectively created for each inter-process communication between the client and the server. Using a consistency algorithm, a target link is selected for each inter-process communication according to all the links corresponding to different inter-process communications, so that each inter-process communication corresponds to at least one link with an available state, and the links with an available state corresponding to different inter-process communications are evenly distributed on different IB cards. Thus, a communication link is created on each IB card for the docking between the client and the server, giving full play to the performance of each IB card and realizing multi-IB card communication based on multiple links; by creating a link for the inter-process communication on each IB card and selecting one of the multiple links as the available state and the other links as the standby state, and switching the link when a failure occurs, it is ensured that at least one IB card is working between the client and the server. While giving full play to the performance of each IB card, the reliability of the communication link between the client and the server is also ensured, improving the stability of the server.
[0086] The various embodiments in this specification are described in a progressive manner. The key point of each embodiment is the difference from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and reference can be made to the description in the method part for the relevant parts.
[0087] The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0088] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0089] The above has introduced in detail a communication method, apparatus, device and medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A communication method, characterized in that, Including: Create a link on each IB card for the inter - process communication between the client and the server; Select a target link from all the links corresponding to the inter - process communication, set the link state of the target link to the available state, and set the link states of the remaining links to the standby state; Undertake the inter - process communication through the target link, and when the IB card corresponding to the target link fails, re - select a link from the links in the standby state as the new target link to undertake the inter - process communication; Among them, the step of selecting a target link from all the links corresponding to the inter - process communication includes: using a consensus algorithm, according to all the links corresponding to different inter - process communications respectively, select a target link for each inter - process communication, so that each inter - process communication has at least one link with the link state of available state, and the links with the link state of available state corresponding to different inter - process communications are evenly distributed on different IB cards; Re - select a link from the links in the standby state as the new target link to undertake the inter - process communication, including: using a consensus algorithm according to all the links in the standby state corresponding to different inter - process communications respectively, select a corresponding replacement link for each target link in the available state on the faulty IB card, and use the replacement link as the new target link to undertake the corresponding inter - process communication; After re - selecting a link from the links in the standby state as the new target link to undertake the inter - process communication, it further includes: regularly detect the state of the IB card through a timer according to a preset period. When the IB card fault is recovered, reset the link state of the target link to the available state, and set the link state of the new target link to the standby state; Among them, the step of creating a link on each IB card for the inter - process communication between the client and the server includes: on each IB card, create a link for each inter - process communication between the client and the server respectively.
2. The communication method according to claim 1, characterized in that, The step of creating a link on each IB card includes: Start a timed scan when the client is mounted to collect IB card information; According to the collected IB card information, create a link for the inter - process communication on each IB card.
3. The communication method according to claim 1 or 2, characterized in that, The step of when the IB card corresponding to the target link fails, re - select a link from the links in the standby state as the new target link to undertake the inter - process communication includes: When the IB card corresponding to the target link fails, select a new target link from all the links in the standby state corresponding to the inter - process communication; Modify the link state of the new target link to the available state, and modify the link state of the original target link to the standby state, so as to use the new target link to undertake the inter - process communication.
4. A communication device, characterized in that, Including: A link creation module, which is used to create a link on each IB card for the inter - process communication between the client and the server; A link status configuration module, configured to select a target link from all the links corresponding to the inter-process communication, set the link status of the target link to the available status, and set the link status of the remaining links to the standby status; A link switching module, configured to undertake the inter-process communication through the target link, and when the IB card corresponding to the target link fails, re-select a link from the links in the standby status as a new target link to undertake the inter-process communication; Wherein, the link status configuration module is configured to use a consistency algorithm to select a target link for each inter-process communication according to all the links corresponding to different inter-process communications, so that each inter-process communication has at least one link with the link status of available status, and the links with the link status of available status corresponding to different inter-process communications are evenly distributed on different IB cards; The link switching module is configured to use a consistency algorithm to select a corresponding replacement link for each target link in the available status on the faulty IB card according to all the links in the standby status corresponding to different inter-process communications, and use the replacement link as the new target link to undertake the corresponding inter-process communication; The communication device is configured to, after re-selecting a link from the links in the standby status as a new target link to undertake the inter-process communication, periodically detect the status of the IB card through a timer according to a preset period, when the IB card failure is recovered, reset the link status of the target link to the available status, and set the link status of the new target link to the standby status; Wherein, the link creation module is configured to create a link for each inter-process communication between the client and the server on each IB card.
5. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the communication method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, For storing a computer program; wherein when the computer program is executed by a processor, the communication method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Cross-node communication method, device and equipment, and readable storage medium
CN113535630A
Multi-device data sending method and related device
CN115134268A