[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN115145764A - Port connection method, device, equipment and storage medium - Google Patents

Port connection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115145764A
CN115145764A CN202210753281.2A CN202210753281A CN115145764A CN 115145764 A CN115145764 A CN 115145764A CN 202210753281 A CN202210753281 A CN 202210753281A CN 115145764 A CN115145764 A CN 115145764A
Authority
CN
China
Prior art keywords
port
message
host
switch
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210753281.2A
Other languages
Chinese (zh)
Inventor
马旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210753281.2A priority Critical patent/CN115145764A/en
Publication of CN115145764A publication Critical patent/CN115145764A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1443Transmit or communication errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • G06F15/17306Intercommunication techniques
    • G06F15/17312Routing techniques specific to parallel machines, e.g. wormhole, store and forward, shortest path problem congestion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • G06F15/17306Intercommunication techniques
    • G06F15/17331Distributed shared memory [DSM], e.g. remote direct memory access [RDMA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a port connection method, a device, equipment and a storage medium, which relate to the technical field of computers and comprise the following steps: constructing a host message based on a preset interaction protocol, and sending the host message to a switch; receiving a target storage end message sent by the switch; the target storage end message is a message which is determined in all storage end messages sent by the switch from a storage end and is in the same service domain with the host end message; analyzing the target storage end message to obtain analyzed message information; and sending the analyzed message information to a pre-created sub-thread, and performing corresponding port connection or disconnection operation in the sub-thread. According to the method and the device, the host message is sent to the switch, the judged storage message which is in the same service domain with the host message and sent by the switch is received, and corresponding port connection or disconnection operation is carried out based on the storage message, so that manual connection is avoided, and the bandwidth and error redundancy are improved.

Description

Port connection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a port connection method, apparatus, device, and storage medium.
Background
NVMe (Non-Volatile Memory express, open collection of standards and information) is a method of linking and transferring data between a host and a target storage system, and is designed specifically for use with faster storage media (e.g., flash Memory devices) having Non-Volatile Memory. This type of storage can achieve low latency, low CPU usage, and high performance, and can often replace SCSI (Small Computer System Interface) storage.
NVMe storage can be connected directly to the host using PCIe (peripheral component interconnect express) interface, or can be connected to the host through different architectural transmission media, such as NVMe over fiber Channel, NVMe over RDMA (Remote Direct Memory Access) (using RoCE v2 technology). NVMe over RDMA (RoCE v 2) technology enables the use of Remote Direct Memory Access (RDMA) transfers between two systems on a network that enable data exchange in the main memory, thereby bypassing the operating system or processors of either system.
The NVMe technology is in a stage of initial development, the stability of the NVMe technology is still to be further improved, meanwhile, a link cannot be automatically established between a host and a storage device, plug and play is not supported, the usability is relatively poor, and the host cannot be automatically established with the storage device in the link connection of the NVMe over RDMA (RoCE v 2); meanwhile, the link is manually established, parameters are easy to input incorrectly, and when the link fails (such as switch failure, port network cable extraction and the like), the link cannot be automatically switched.
Disclosure of Invention
In view of this, the present invention provides a port connection method, apparatus, device and storage medium, which can avoid manual connection and improve bandwidth and error redundancy. The specific scheme is as follows:
in a first aspect, the present application discloses a port connection method applied to a host, including:
constructing a host message based on a preset interaction protocol, and sending the host message to a switch;
receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message;
analyzing the target storage end message to obtain analyzed message information;
and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
Optionally, before the constructing the host-side message based on the preset interaction protocol, the method further includes:
sending first time information to the switch through an automatic connection device in the host; the switch receives second time information sent by the storage end at the same time; the second time information comprises a second message notification time interval and a second message validity period;
determining a communication protocol and a port IP; the port IP comprises a host port IP and a storage port IP;
and determining the preset interaction protocol based on the first time information, the second time information, the communication protocol and the port IP.
Optionally, the constructing a host message based on a preset interaction protocol, and sending the host message to the switch includes:
acquiring all network card port information of the host in a packet sending thread, and determining ports to be connected according to a preset screening rule;
acquiring the host port IP corresponding to the port to be connected;
constructing the host message based on the first time information, the port to be connected and the host port IP, and sending the host message to a switch; the first time information includes a first message notification time interval and a first message validity period.
Optionally, the receiving the target storage end message sent by the switch includes:
receiving the target storage end message sent by the switch in a packet receiving thread;
judging whether the target storage end message is accurate or not based on a preset message verification rule;
and if the target storage end message is accurate, sending message accurate information to the switch.
Optionally, the analyzing the target storage end packet to obtain the analyzed packet information includes:
analyzing the target storage end message to obtain an analyzed host port IP, an analyzed storage port IP and an action state bit corresponding to the analyzed storage port IP;
judging whether the analyzed host port IP is consistent with the current host port IP or not;
if the message information is consistent with the message information, sending the analyzed message information to a pre-created sub-thread;
and if the messages are not consistent, deleting the target storage end message.
Optionally, the sending the analyzed message information to a pre-created sub-thread so as to perform a corresponding port connection or disconnection operation in the sub-thread includes:
when the analyzed host port IP is consistent with the current host port IP, creating a sub-thread of the packet receiving thread to obtain the pre-created sub-thread;
sending the analyzed message information to a pre-created sub-thread;
when the action state bit represents that the storage port is in an on-line state, inquiring whether the connection between the storage port and a host port is established in a preset storage system through the automatic connection device; the storage port is a port corresponding to the analyzed storage port IP, and the host port is a port corresponding to the analyzed host port IP;
if the connection between the storage port and the host port is not established, the corresponding connection is automatically established, and if the connection between the storage port and the host port is established, the connection is maintained;
and when the action state bit indicates that the storage port is in an off-line state, querying a link controller corresponding to the storage port and the host port in the preset storage system through the automatic connecting device, and disconnecting the link controller if the link controller is found.
Optionally, before the constructing the host-side message based on the preset interaction protocol, the method further includes:
periodically inquiring the port information of the host in a detection thread;
when the port information changes, updating the host end message by using the latest port information to obtain an updated message so that the host can send the updated message to the switch;
and detecting whether the host port has abnormal conditions, if so, inquiring all the link controllers corresponding to the host port in the preset storage system through the automatic connecting device, and concurrently disconnecting all the link controllers through the sub-thread.
In a second aspect, the present application discloses a port connection device applied to a host, including:
the first message construction module is used for constructing a host message based on a preset interaction protocol and sending the host message to the switch;
the second message receiving module is used for receiving a target storage end message sent by the switch; the target storage end message is a message which is determined in all storage end messages sent by the switch from a storage end and is in the same service domain with the host end message;
the message analysis module is used for analyzing the target storage end message to obtain analyzed message information;
and the information sending module is used for sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing said computer program for implementing the steps of the port connecting method as disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements a port connection method as disclosed in the preceding.
As can be seen, the present application provides a port connection method, including: constructing a host message based on a preset interaction protocol, and sending the host message to a switch; receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message; analyzing the target storage end message to obtain analyzed message information; and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread. Therefore, according to the method and the device, the preset interaction protocol is used for constructing the host message and sending the host message to the switch to obtain the target storage end message in the same service domain, then the information contained in the target storage end message is sent to the sub-thread, and corresponding port connection or disconnection operation is carried out based on the information, so that manual connection is avoided, and the bandwidth and the error redundancy are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a port connection method disclosed herein;
FIG. 2 is a schematic illustration of the location of a network topology as disclosed herein;
FIG. 3 is a flow chart of a specific port connection method disclosed herein;
FIG. 4 is a flow chart of a particular method of port connection disclosed herein;
FIG. 5 is a schematic structural view of a port connection device provided herein;
fig. 6 is a block diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any inventive step, all fall within the scope of protection of the present invention.
At present, the NVMe technology is in a stage of initial development, the stability of the NVMe technology is still to be further improved, meanwhile, a link cannot be automatically established between a host and storage, plug and play is not supported, the usability is relatively poor, and the host cannot be automatically established with the storage in the NVMe over RDMA (RoCE v 2) link connection; meanwhile, the link is manually established, parameters are easy to input incorrectly, and when the link fails, such as a switch failure, a port network cable is pulled out and the like, the link cannot be automatically switched. Therefore, the application provides a port connection method, which can avoid manual connection and improve bandwidth and error redundancy.
The embodiment of the invention discloses a port connection method, which is applied to a host computer and shown in figure 1, and comprises the following steps:
step S11: and constructing a host message based on a preset interaction protocol, and sending the host message to the switch.
In this embodiment, a host-side message is constructed based on a preset interaction protocol, and the host-side message is sent to a switch. The method includes the steps that automatic connection devices are deployed on the host side, for example, an automatic connection device based on NVMe over RDMA (RoCE v 2) is arranged on the host side. The network topology position of the above device is shown in fig. 2, and the interaction between the host and the storage is realized through a switch, that is, the host cannot directly interact with the high-performance storage. The host end comprises an Application, an OS (Operating System), multipath software, an automatic connecting device and a RoCE (RDMA over converted Ethernet, one of which allows remote direct memory access through Ethernet) network card; deploying lossless Ethernet on the switch; the high-performance storage comprises a storage front-end interface and NVME over RoCE. It can be understood that the preset interactive protocol includes the automatic connection device, the switch, and the storage of the respective reported information. The host side constructs a host side message based on a preset interaction protocol and sends the host side message to the switch, and correspondingly, the storage side constructs a storage side message based on the preset interaction protocol and sends the storage side message to the switch.
Step S12: receiving a target storage end message sent by the switch; the target storage end message is a message which is determined in all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message.
In this embodiment, a target storage end message sent by the switch is received; the target storage end message is a message which is determined in all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message. It can be understood that the switch receives a host message sent by a host and a storage message sent by a storage, then determines a message in the same service domain as the host message from the storage message, then determines the message as a target storage message, and then sends the target storage message to the host. It should be noted that the specific operation process in the storage end is similar to that of the host end, but the storage end only executes the action of the sending part, and does not execute the action of the receiving part, that is, the storage end only sends the generated storage end message to the switch, and does not receive information from the storage end.
It can be understood that a host message is constructed in a packet sending thread based on a preset interaction protocol, and the host message is sent to a switch; receiving the target storage end message sent by the switch in a packet receiving thread; and periodically inquiring the port information of the host in the detection thread. The packet sending thread, the packet receiving thread and the detection thread are synchronous threads and are not influenced by each other. It should be noted that, after receiving the target storage end message sent by the switch in the packet receiving thread, whether the target storage end message is accurate is determined based on a preset message verification rule, if the target storage end message is accurate, the message accurate information is sent to the switch, and the switch does not send the same information again after receiving the message accurate information, thereby avoiding repeated sending of information. The preset message verification rule may be used for verifying the format of the target storage end message according to an agreed rule, and the like, or may be used for verifying other agreed verification modes.
Step S13: and analyzing the target storage end message to obtain analyzed message information.
In this embodiment, after receiving the target storage end message sent by the switch, the target storage end message is analyzed to obtain the analyzed message information. It can be understood that the target storage end message is analyzed to obtain the storage end port information corresponding to the host end port.
Step S14: and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
In this embodiment, after the target storage end message is analyzed to obtain analyzed message information, the analyzed message information is sent to a pre-created sub-thread, so as to perform corresponding port connection or disconnection operation in the sub-thread. It can be understood that the sub-thread that creates the packet receiving thread has already obtained the pre-created sub-thread, the analyzed message information is sent to the pre-created sub-thread, then the action status bit of the current corresponding memory port interface is judged according to the obtained analyzed message, and then the corresponding port connection or disconnection operation is performed according to the action status bit.
It can be understood that, in the present solution, the automatic connection device on the host periodically sends a host message to the switch through a packet sending thread, where the host message includes a port participating in connection and a corresponding port IP on each host in the entire service domain; then, receiving an online and offline notification of a target storage port sent by the switch through a packet receiving thread, and performing corresponding operation, thereby realizing rapid connection establishment and automatic fault switching; the host side port state is periodically detected through a detection thread, when the port state changes, messages at the host side are updated in time, and when the port of the host fails, the fault connection is disconnected in time, so that the rapid switching of service data is realized.
As can be seen, the present application provides a port connection method, including: constructing a host message based on a preset interaction protocol, and sending the host message to a switch; receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message; analyzing the target storage end message to obtain analyzed message information; and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread. Therefore, according to the method and the device, the preset interaction protocol is used for constructing the host message and sending the host message to the switch to obtain the target storage end message in the same service domain, then the information contained in the target storage end message is sent to the sub-thread, and corresponding port connection or disconnection operation is carried out based on the information, so that manual connection is avoided, and the bandwidth and the error redundancy are improved.
Referring to fig. 3, the embodiment of the present invention discloses a port connection method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S21: sending first time information to the switch through an automatic connection device in the host.
In this embodiment, the first time information is sent to the switch through an automatic connection device in the host. It can be understood that the switch receives the second time information sent by the storage end at the same time. Specifically, the first time information includes a first message notification time interval and a first message validity period, and the second time information includes a second message notification time interval and a second message validity period. The first message notification time interval and the second message notification time interval are self-defined time intervals, namely, the time interval of sending the corresponding message to the switch and the validity period corresponding to the message. For example, when the validity period in the time information of the message acquired by the switch indicates that the message has failed, the switch stops using the failed message to perform subsequent actions.
Step S22: determining a communication protocol and a port IP; the port IP includes a host port IP and a storage port IP.
In this embodiment, a communication protocol and a port IP are determined; the port IP includes a host port IP and a storage port IP. It can be understood that if the host message is generated at the host, the port IP included in the host message is the host port IP, and if the storage message is generated at the storage, the port IP included in the storage message is the storage port IP.
Step S23: and determining the preset interaction protocol based on the first time information, the second time information, the communication protocol and the port IP.
In this embodiment, the preset interaction protocol is determined based on the first time information, the second time information, the communication protocol, and the port IP. It can be understood that the host end and the storage end need to be based on the preset interaction protocol when generating the corresponding messages, that is, the finally generated messages all contain information of the preset interaction protocol.
It should be noted that the present solution includes 4 parts: the method comprises the steps of interaction protocol convention, a packet sending thread function, a packet receiving thread function and a detection thread function. The agreement of the interactive protocol comprises the time information, the communication protocol and the port IP.
Step S24: and constructing a host message based on a preset interaction protocol, and sending the host message to the switch.
In this embodiment, a host-side message is constructed based on a preset interaction protocol, and the host-side message is sent to a switch. It can be understood that, all network card port information of the host is acquired in a packet sending thread, a port to be connected is determined according to a preset screening rule, namely, a port which meets the current connection is identified and determined as a port to be connected, then the host port IP corresponding to the port to be connected is acquired, then the host message is constructed based on the first time information, the port to be connected and the host port IP, and the host message is sent to a switch; the first time information includes a first message notification time interval and a first message validity period.
It should be noted that, since the first time information includes a first message notification time interval, every time the first message notification time interval (i.e., timing) is set, the specific information corresponding to the port to be connected is acquired, and then a new host message is generated based on the specific information, and the new host message is sent to the switch.
Step S25: and receiving a target storage end message sent by the switch.
Step S26: and analyzing the target storage end message to obtain analyzed message information.
Step S27: and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
For the specific contents of the above steps S25 to S27, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
Therefore, the first time information is sent to the switch through the automatic connection device in the host; determining a communication protocol and a port IP; the port IP comprises a host port IP and a storage port IP; determining the preset interaction protocol based on the first time information, the second time information, the communication protocol and the port IP; constructing a host message based on a preset interaction protocol, and sending the host message to a switch; receiving a target storage end message sent by the switch; analyzing the target storage end message to obtain analyzed message information; and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread, thereby avoiding manual connection and improving bandwidth and error redundancy.
Referring to fig. 4, the embodiment of the present invention discloses a port connection method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S31: and periodically inquiring the port information of the host in the detection thread.
In this embodiment, the port information of the host is periodically queried in the detection thread. It can be understood that there may be a certain change in the port information of the host, so that it is necessary to set a detection thread to periodically query the port information of the host so as to find out the change in the port information of the host in time, thereby performing a corresponding update operation. It should be noted that the execution frequency of the probing thread is higher than the execution frequency of the packet sending thread and the packet receiving thread.
Step S32: and when the port information changes, updating the host end message by using the latest port information to obtain an updated message so that the host can send the updated message to the switch.
In this embodiment, when the detection thread queries that the port information of the host changes, the host-side packet is updated by using the latest port information to obtain an updated packet, so that the host sends the updated packet to the switch. It should be noted that the detection thread may also detect whether the host port has an abnormal condition, and if the abnormal condition exists, the automatic connection device may query all the link controllers corresponding to the host port (or the host port IP) in the preset storage system, and concurrently disconnect all the link controllers through the sub-thread.
Step S33: and receiving a target storage end message sent by the switch.
Step S34: and analyzing the target storage end message to obtain an analyzed host port IP, an analyzed storage port IP and an action state bit corresponding to the analyzed storage port IP.
In this embodiment, after receiving a target storage end message sent by the switch, the target storage end message is analyzed to obtain an analyzed host port IP, an analyzed storage port IP, and an action status bit corresponding to the analyzed storage port IP, which are included in the target storage end message. The resolved host port IP may also be referred to as a destination port IP, and the resolved storage port IP may also be referred to as an original port IP. That is, the target storage end message includes the IP of the storage port itself and the IP of the host port to which the storage port is to be connected.
Step S35: and judging whether the analyzed host port IP is consistent with the current host port IP.
In this embodiment, after obtaining the analyzed host port IP, the analyzed storage port IP, and the action status bit corresponding to the analyzed storage port IP, it is determined whether the analyzed host port IP is consistent with the current host port IP. It can be understood that, by determining whether the analyzed host port IP is consistent with the current host port IP, it is determined whether the host port currently receiving the analyzed information is a target port to which the storage port corresponding to the target storage port packet is to be connected. If the analyzed host port IP is not consistent with the current host port IP, the current host port is not the target port which the storage port wants to be connected with, and the current host port deletes the target storage port message. It should be noted that receiving a large number of repeated messages is avoided by the host port IP after the message sending and parsing of the target storage and the deduplication mechanism receiving the action status bit.
Step S36: and when the analyzed host port IP is consistent with the current host port IP, creating a sub-thread of the packet receiving thread to obtain the pre-created sub-thread.
In this embodiment, when the resolved host port IP is consistent with the current host port IP, a sub-thread of the packet receiving thread is created to obtain the pre-created sub-thread. It can be understood that the resolved host port IP is consistent with the current host port IP, and the surface current host port is the target port to which the storage port in the target storage end message is to be connected.
Step S37: and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
In this embodiment, after the pre-created sub-thread is obtained, the analyzed message information is sent to the pre-created sub-thread, so as to perform corresponding port connection or disconnection operation in the sub-thread. Specifically, when the action status bit indicates that the storage port is in an online state, the automatic connection device is used for inquiring whether connection is established between the storage port and the host port in a preset storage system, if the connection is not established between the storage port and the host port, the corresponding connection is automatically established, and if the connection is established between the storage port and the host port, the connection is maintained and is not processed. When the action status bit indicates that the storage port is in an offline state, querying a link controller corresponding to the storage port and the host port in the preset storage system through the automatic connecting device, disconnecting the link controller if the link controller is found, and prompting and not performing substantial processing if the link controller is not found. It is understood that the action status bit characterizes the memory port as being in an on-state, i.e. indicates that the memory port is available; the action status bit represents that the storage port is in an off-line state, namely, represents that the storage port is not available. The storage port is a port corresponding to the analyzed storage port IP, and the host port is a port corresponding to the analyzed host port IP.
It should be noted that the preset storage system may be an NVME system, and the automatic connection device performs corresponding actions through NVME system commands.
The method solves the problem that the link cannot be automatically established between the host end and the storage end in the link topology of NVMe over RDMA (RoCE v 2); when the port in the service domain is in fault, the automatic connecting device can quickly disconnect the link between the host port and the storage port in time and establish the link with a new service port; the active connecting device adopts an IP-to-IP connecting mode (namely, a host port IP is connected with a storage port IP), so that IO (Input/Output) loan between a host and a storage can be improved to the maximum extent, and error redundancy is improved.
It should be pointed out that the key point of the method is to agree the interactive protocol in advance, make every business domain port on the host communicate with the exchanger through the thread of sending out the packet, and keep the heartbeat connection; analyzing the target storage end message through a packet receiving thread, and replying confirmation information to the switch; the target storage end message is duplicated through a target IP (namely a host port IP) and an action state; link connection is quickly established or disconnected through concurrent sub-threads of the packet receiving thread; and updating host side port information through the detection thread, actively detecting host side faults and quickly responding.
For the details of the step S33, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Therefore, in the embodiment of the application, the port information of the host is regularly inquired in the detection thread; when the port information changes, updating the host end message by using the latest port information to obtain an updated message so that the host can send the updated message to the switch; receiving a target storage end message sent by the switch; analyzing the target storage end message to obtain an analyzed host port IP, an analyzed storage port IP and an action state bit corresponding to the analyzed storage port IP; judging whether the analyzed host port IP is consistent with the current host port IP; when the analyzed host port IP is consistent with the current host port IP, creating a sub-thread of the packet receiving thread to obtain the pre-created sub-thread; and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread, thereby avoiding manual connection and improving bandwidth and error redundancy.
Referring to fig. 5, an embodiment of the present application further discloses a port connection device, applied to a host, including:
the first message construction module 11 is configured to construct a host message based on a preset interaction protocol, and send the host message to a switch;
a second message receiving module 12, configured to receive a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message;
a message parsing module 13, configured to parse the target storage end message to obtain parsed message information;
and the information sending module 14 is configured to send the analyzed message information to a pre-created sub-thread, so as to perform corresponding port connection or disconnection operation in the sub-thread.
As can be seen, the present application includes: constructing a host message based on a preset interaction protocol, and sending the host message to a switch; receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message; analyzing the target storage end message to obtain analyzed message information; and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread. Therefore, according to the method and the device, the message at the host end is constructed through the preset interactive protocol and sent to the switch, so that the message at the target storage end in the same service domain is obtained, then the information contained in the message at the target storage end is sent to the sub-thread, and the corresponding port connection or disconnection operation is carried out based on the information, so that the manual connection is avoided, and the bandwidth and the error redundancy are improved.
In some specific embodiments, the first packet constructing module 11 specifically includes:
a first time information transmitting unit for transmitting first time information to the exchange through an automatic connection device in the host; the switch receives the second time information sent by the storage at the same time; the second time information comprises a second message notification time interval and a second message validity period;
the information determining unit is used for determining a communication protocol and a port IP; the port IP comprises a host port IP and a storage port IP;
an interactive protocol determining unit, configured to determine the preset interactive protocol based on the first time information, the second time information, the communication protocol, and the port IP;
a port information acquiring unit, configured to acquire all network card port information of the host in a packet sending thread;
the device comprises a to-be-connected port determining unit, a to-be-connected port determining unit and a selecting unit, wherein the to-be-connected port determining unit is used for determining a to-be-connected port according to a preset screening rule;
an IP obtaining unit, configured to obtain the host port IP corresponding to the port to be connected;
a host message construction unit, configured to construct the host message based on the first time information, the port to be connected, and the host port IP;
the host message sending unit is used for sending the host message to the switch; the first time information comprises a first message notification time interval and a first message validity period;
the port information regular query unit is used for regularly querying the port information of the host in a detection thread;
a host message updating unit, configured to update the host message with the latest port information when the port information changes, so as to obtain an updated message, so that the host sends the updated message to the switch;
an abnormal condition detection unit, configured to detect whether an abnormal condition exists at the host port;
a first link controller query unit, configured to query, if the first link controller exists, all the link controllers corresponding to the host ports in the preset storage system through the automatic connection device;
and the first link controller disconnection unit is used for disconnecting all the link controllers through the sub-thread. In some specific embodiments, the second packet receiving module 12 specifically includes:
a target storage end message receiving unit, configured to receive, in a packet receiving thread, the target storage end message sent by the switch;
the target storage end message judging unit is used for judging whether the target storage end message is accurate or not based on a preset message verification rule;
and the message accurate information sending unit is used for sending message accurate information to the switch if the target storage end message is accurate.
In some specific embodiments, the message parsing module 13 specifically includes:
the target storage end message analysis unit is used for analyzing the target storage end message to obtain an analyzed host port IP, an analyzed storage port IP and an action state bit corresponding to the analyzed storage port IP;
an IP judging unit, configured to judge whether the analyzed host port IP is consistent with a current host port IP;
and the target storage end message deleting unit is used for deleting the target storage end message if the target storage end message is inconsistent with the target storage end message.
In some specific embodiments, the information sending module 14 specifically includes:
a sub-thread creating unit, configured to create a sub-thread of the packet receiving thread when the analyzed host port IP is consistent with the current host port IP, so as to obtain the pre-created sub-thread;
the analyzed message information sending unit is used for sending the analyzed message information to a pre-created sub-thread if the analyzed message information is consistent with the pre-created sub-thread;
a connection establishment judging unit, configured to query, in a preset storage system, through the automatic connection device, whether a connection is established between the storage port and a host port when the action status bit indicates that the storage port is in an online status; the storage port is a port corresponding to the analyzed storage port IP, and the host port is a port corresponding to the analyzed host port IP;
the connection establishing unit is used for automatically establishing corresponding connection if the connection between the storage port and the host port is not established;
a connection holding unit for holding if a connection has been established between the storage port and the host port;
a second link controller querying unit, configured to query, by using the automatic connection device, link controllers corresponding to the storage port and the host port in the preset storage system when the action status bit indicates that the storage port is in an offline status;
and the second link controller disconnection unit is used for disconnecting if the link controller is found.
Further, the embodiment of the application also provides electronic equipment. FIG. 6 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. 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 for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the port connection method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide a working 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 an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to acquire external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage manner may be a transient storage manner or a permanent storage manner.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, and may be Windows Server, netware, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the port connection method by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application further discloses a storage medium, in which a computer program is stored, and when the computer program is loaded and executed by a processor, the steps of the port connection method disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The port connection method, apparatus, device and storage medium provided by the present invention are described in detail above, and the principle and implementation of the present invention are explained herein by applying specific examples, and the description of the above examples is only used to help understanding the method and core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A port connection method is applied to a host, and comprises the following steps:
constructing a host message based on a preset interaction protocol, and sending the host message to a switch;
receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message;
analyzing the target storage end message to obtain analyzed message information;
and sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
2. The port connection method according to claim 1, wherein before constructing the host-side packet based on the preset interaction protocol, the method further comprises:
sending first time information to the switch through an automatic connection device in the host; the switch receives second time information sent by the storage end at the same time; the second time information comprises a second message notification time interval and a second message validity period;
determining a communication protocol and a port IP; the port IP comprises a host port IP and a storage port IP;
and determining the preset interaction protocol based on the first time information, the second time information, the communication protocol and the port IP.
3. The port connection method according to claim 2, wherein the constructing a host message based on a preset interaction protocol and sending the host message to a switch comprises:
acquiring all network card port information of the host in a packet sending thread, and determining ports to be connected according to a preset screening rule;
acquiring the host port IP corresponding to the port to be connected;
constructing the host message based on the first time information, the port to be connected and the host port IP, and sending the host message to a switch; the first time information includes a first message notification time interval and a first message validity period.
4. The port connection method according to claim 2 or 3, wherein the receiving the target storage side packet sent by the switch includes:
receiving the target storage end message sent by the switch in a packet receiving thread;
judging whether the target storage end message is accurate or not based on a preset message verification rule;
and if the target storage end message is accurate, sending message accurate information to the switch.
5. The port connection method according to claim 4, wherein the parsing the target storage side packet to obtain parsed packet information includes:
analyzing the target storage end message to obtain an analyzed host port IP, an analyzed storage port IP and an action state bit corresponding to the analyzed storage port IP;
judging whether the analyzed host port IP is consistent with the current host port IP;
if the message information is consistent with the message information, sending the analyzed message information to a pre-created sub thread;
and if the messages are not consistent, deleting the target storage end message.
6. The port connection method according to claim 5, wherein the sending the parsed packet information to a pre-created child thread so as to perform a corresponding port connection or disconnection operation in the child thread, comprises:
when the analyzed host port IP is consistent with the current host port IP, creating a sub-thread of the packet receiving thread to obtain the pre-created sub-thread;
sending the analyzed message information to a pre-created sub-thread;
when the action state bit represents that the storage port is in an on-line state, inquiring whether connection is established between the storage port and a host port in a preset storage system through the automatic connection device; the storage port is a port corresponding to the analyzed storage port IP, and the host port is a port corresponding to the analyzed host port IP;
if the connection between the storage port and the host port is not established, the corresponding connection is automatically established, and if the connection between the storage port and the host port is established, the connection is maintained;
and when the action state bit indicates that the storage port is in an off-line state, querying a link controller corresponding to the storage port and the host port in the preset storage system through the automatic connecting device, and disconnecting the link controller if the link controller is found.
7. The port connection method according to claim 6, further comprising:
periodically inquiring the port information of the host in a detection thread;
when the port information changes, updating the host message by using the latest port information to obtain an updated message so that the host can send the updated message to the switch;
and detecting whether the host port has an abnormal condition, if so, inquiring all the link controllers corresponding to the host port in the preset storage system through the automatic connecting device, and concurrently disconnecting all the link controllers through the sub-thread.
8. A port connecting device applied to a host computer comprises:
the first message construction module is used for constructing a host message based on a preset interaction protocol and sending the host message to the switch;
a second message receiving module for receiving a second message, the system comprises a switch, a target storage end message and a data processing module, wherein the switch is used for receiving a target storage end message sent by the switch; the target storage end message is a message which is determined from all storage end messages sent by the switch from a storage end and is in the same service domain as the host end message;
the message analysis module is used for analyzing the target storage end message to obtain analyzed message information;
and the information sending module is used for sending the analyzed message information to a pre-created sub-thread so as to carry out corresponding port connection or disconnection operation in the sub-thread.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the port connection method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the porting method of any of claims 1 to 7.
CN202210753281.2A 2022-06-29 2022-06-29 Port connection method, device, equipment and storage medium Pending CN115145764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210753281.2A CN115145764A (en) 2022-06-29 2022-06-29 Port connection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210753281.2A CN115145764A (en) 2022-06-29 2022-06-29 Port connection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115145764A true CN115145764A (en) 2022-10-04

Family

ID=83410120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210753281.2A Pending CN115145764A (en) 2022-06-29 2022-06-29 Port connection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115145764A (en)

Similar Documents

Publication Publication Date Title
US10715411B1 (en) Altering networking switch priority responsive to compute node fitness
US7552213B2 (en) Remote network node management system and method
US9331870B2 (en) Switch, information processing apparatus, and information processing system
US7944812B2 (en) Redundant intermediary switch solution for detecting and managing fibre channel over ethernet FCoE switch failures
KR101498413B1 (en) Fibre channel forwarder fabric login sequence
EP2656552B1 (en) Third party initiation of communications between remote parties
US20090245242A1 (en) Virtual Fibre Channel Over Ethernet Switch
CN105450779B (en) The method of one household appliance connection multiserver
JP2003258903A (en) Communication line monitor system
US20120209977A1 (en) Program Update Management Server And Program Update Management Method
WO2022052953A1 (en) Failed link handover method and system, and related device
US11403319B2 (en) High-availability network device database synchronization
JP5387227B2 (en) Setting change method and program by network manager device, control method and program for network device, network manager device and network device
CN108882262B (en) Equipment state synchronization method and system, intelligent terminal and readable storage medium
US8201017B2 (en) Method for queuing message and program recording medium thereof
CN101404594A (en) Hot backup performance test method and apparatus, communication equipment
CN115145764A (en) Port connection method, device, equipment and storage medium
CN104333469A (en) Method and system for managing fiber channel (FC) sessions of storage system
CN113849127A (en) SAN storage dual-active network-based arbitration method and device and electronic equipment
US9705823B2 (en) Port status synchronization method, related device, and system
CN115801642B (en) RDMA communication management module, method, equipment and medium based on state control
CN115426258B (en) Information configuration method, device, switch and readable storage medium
CN116599869A (en) TCP link detection method and device
CN108259228B (en) Network equipment virtualization system and equipment configuration method and device thereof
CN112153754A (en) Point-to-point connection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination