Universal method, device, electronic device and storage medium for obtaining terminal connection status
By dividing it into the main switch and the secondary switch in the FC switch network, and processing the response according to the first sending of the terminal requested connection frame, the terminal access problem caused by the diversity of FC protocol clusters is solved, and the universal access and connection status acquisition of the terminal under multiple FC protocol clusters is realized.
Patent Information
- Application Number
- CN202211235549.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-10
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-10-10
AI Technical Summary
Due to the diversity of FC protocol clusters, there is currently a lack of a common method to achieve terminal access to FC switching network.
The main switch and secondary switch are divided into main switches and secondary switches in the FC switch network. The main switch is responsible for maintaining the connection status of the terminals throughout the network, and the secondary switch only maintains the connection status of its own terminals. When the terminal requests a connection, it is determined whether the requested connection frame is sent to the main switch for the first time. If so, the terminal information is extracted and the requested reply frame is encapsulated. If not, the response will not be answered, so as to avoid the possibility of repeated reception of the requested reply frame.
The universal access FC switching network of terminals under multiple FC protocol clusters is realized, which maximizes the avoidance of terminal access failures caused by different protocols.
Smart Images

Figure CN115604206B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of protocol communication technology, and in particular to a universal method, device, electronic device and computer-readable storage medium for obtaining terminal connection status based on an FC switching network. Background Art
[0002] Fiber Channel (FC) protocol is a high-speed serial communication protocol with high bandwidth, high reliability, low latency, flexible topology and openness. In order to meet the application requirements of FC protocol in avionics communication systems, multiple FC protocol clusters suitable for avionics environments have been developed.
[0003] However, currently, the terminals in the aerospace field are connected to the switches in the FC switching network using static configuration, that is, the network operation parameters are manually specified before initialization, and the device information is identified according to the initial operation parameters after the system is started, so as to carry out network communication. There is also an access method based on dynamic configuration, which is mainly completed through the DHCP protocol and WINS service. The DHCP protocol is used by the server to dynamically assign IP addresses to terminals, and the WINS service is used to centrally manage the access information of terminals in the network for querying the destination computer information during communication.
[0004] The above static configuration and dynamic configuration can effectively complete the terminal access to the FC switching network, but due to the diversity of FC protocol clusters, there is currently no universal method for terminals that meet multiple groups of FC protocol clusters to access the FC switching network. Summary of the invention
[0005] The present invention provides a method, device and computer-readable storage medium for universally acquiring terminal connection status based on an FC switching network, the main purpose of which is to solve the problem that the terminal cannot universally access the FC switching network due to the diversity of FC protocol clusters.
[0006] To achieve the above object, the present invention provides a general method for obtaining terminal connection status based on an FC switching network, comprising:
[0007] receiving a connection request frame from a terminal, and sending the connection request frame to a pre-built main switch;
[0008] Determining whether the connection request frame is sent to the main switch for the first time;
[0009] If the connection request frame is sent to the main switch for the first time, extracting the terminal information in the main switch, and encapsulating the terminal information to obtain a request response frame;
[0010] If the connection request frame is not sent to the primary switch for the first time, no response is made to the connection request frame;
[0011] The request response frame is transmitted back to the terminal to obtain terminal connection status information.
[0012] Optionally, the method for generating a connection request frame of the receiving terminal includes:
[0013] Generate a universal frame according to the structure information of the pre-built universal frame and the FC network standard;
[0014] Changing the frame type of the general frame to obtain a connection request frame with information to be completed;
[0015] Obtaining the ID of the main switch and the ID of the terminal;
[0016] The ID of the main switch and the ID of the terminal are combined with the connection request frame whose information is to be completed to obtain the connection request frame.
[0017] Optionally, the changing the frame type of the general frame to obtain a connection request frame with information to be completed includes:
[0018] Obtain a frame type value table, and search the frame type value corresponding to the connection request frame in the frame type value table;
[0019] The frame sequence number of the connection request frame sent by the terminal is extracted, and the frame sequence number and the frame type value are filled into the general frame to obtain the connection request frame with information to be completed.
[0020] Optionally, determining whether the connection request frame is sent to the primary switch for the first time includes:
[0021] Extracting the frame sequence number and the terminal ID from the connection request frame;
[0022] According to whether the main switch has a historical frame sequence number and ID that are the same as the frame sequence number and the ID of the terminal, it is determined whether the connection request frame is sent to the main switch for the first time.
[0023] Optionally, the method for generating terminal information includes:
[0024] transmitting the login protocol of the terminal to a switch connected to the terminal;
[0025] The allocated address of the terminal is generated in the switch, and the allocated address is filled into a pre-built login response frame and transmitted back to the terminal. At the same time, terminal information including the terminal name, terminal address, and connected switch identifier of the terminal is obtained and stored in the whole network terminal access information table of the main switch to obtain the terminal information.
[0026] Optionally, encapsulating the request response frame according to the terminal information includes:
[0027] Generate an original response frame according to the structure information of the general frame and the FC network standard;
[0028] Changing the frame type of the original response frame to obtain a request response frame with information to be completed;
[0029] The terminal information is encapsulated into the request response frame whose information is to be completed, to obtain the request response frame.
[0030] Optionally, sending the connection request frame to a pre-built main switch includes:
[0031] Determining whether the terminal is directly connected to the main switch;
[0032] If the terminal is directly connected to the main switch, sending the connection request frame to the main switch;
[0033] If the terminal is not directly connected to the main switch, the connection request frame is forwarded several times by the pre-built secondary switch to reach the main switch.
[0034] In order to solve the above problem, the present invention also provides a general terminal connection status acquisition device based on an FC switching network, the device comprising:
[0035] A connection request frame sending module, used for receiving a connection request frame from a terminal, and sending the connection request frame to a pre-built main switch;
[0036] A connection request frame judging module, used to judge whether the connection request frame is sent to the main switch for the first time;
[0037] a request response frame generating module, configured to extract the terminal information in the main switch and encapsulate the terminal information to obtain the request response frame if the request connection frame is sent to the main switch for the first time; and not respond to the request connection frame if the request connection frame is not sent to the main switch for the first time;
[0038] The request response frame return module is used to return the request response frame to the terminal to obtain terminal connection status information.
[0039] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0040] a memory storing at least one instruction; and
[0041] The processor executes the instructions stored in the memory to implement the above-mentioned general method for obtaining the terminal connection status based on the FC switching network.
[0042] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned general method for obtaining terminal connection status based on FC switching network.
[0043] Based on the background technology: static configuration and dynamic configuration can effectively complete the terminal access to the FC switching network, but due to the diversity of FC protocol clusters, there is currently no universal method for terminals that meet multiple groups of FC protocol clusters to access the FC switching network. To solve this problem, the embodiment of the present invention divides the switches in the FC switching network into two types: main switches and auxiliary switches, wherein the main switch is responsible for maintaining the terminal connection status of the entire network, and the auxiliary switch is only responsible for maintaining its own terminal connection. The connection of any terminal ultimately depends on the main switch's control of the terminal connection status of the entire interactive network. When the terminal requests the network connection status, by judging whether the request connection frame is sent to the main switch for the first time, a different response strategy is executed for the request connection frame. If the request connection frame sent by the terminal is sent to the main switch for the first time, the terminal information corresponding to the terminal is obtained, and the request response frame is encapsulated according to the terminal information. If the request connection frame is not sent to the main switch for the first time, no response is made to the request connection frame to avoid the possibility of repeatedly receiving the request response frame. Therefore, the present invention makes an organic interface between the two access strategies, which can maximize the phenomenon of terminal access failure caused by different protocols. Therefore, the universal method, device, electronic device and computer-readable storage medium for obtaining terminal connection status based on FC switching network proposed in the present invention can solve the problem that terminals cannot universally access FC switching network due to the diversity of FC protocol clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 An interaction diagram between a switch and a terminal based on an FC switching network provided by an embodiment of the present invention;
[0045] Figure 2 A data interaction diagram of a terminal accessing a switch based on an FC switching network provided by another embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a flow chart of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention;
[0047] Figure 4 for Figure 3 A detailed implementation flow chart of one of the steps in the process;
[0048] Figure 5 A general frame structure diagram of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention;
[0049] Figure 6 A frame header structure diagram of a general frame of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention;
[0050] Figure 7 A diagram showing the payload format of a connection request frame of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention;
[0051] Figure 8 A payload format diagram of a request response frame of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention;
[0052] Fig. 9 A functional module diagram of a general terminal connection status acquisition device based on an FC switching network provided by an embodiment of the present invention;
[0053] Fig.10 A schematic diagram of the structure of an electronic device for implementing the universal method for acquiring terminal connection status based on an FC switching network provided by an embodiment of the present invention.
[0054] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0056] The embodiment of the present application provides a general method for obtaining the terminal connection status based on the FC switching network. The execution subject of the general method for obtaining the terminal connection status based on the FC switching network includes but is not limited to at least one of the electronic devices such as the server and the terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the general method for obtaining the terminal connection status based on the FC switching network can be executed by software or hardware installed on the terminal device or the server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0057] Before describing an embodiment of the present invention in detail, the following definitions are provided for ease of understanding and simplification of terminology:
[0058] FC: Fiber Channel
[0059] LOGI: Login (a communication protocol used when a terminal accesses a switching network, also known as the Login Switching Network Communication Protocol)
[0060] LOGO: Logout (logout, the communication protocol used when the device exits the switching network, referred to as the exit switching network communication protocol)
[0061] LS_ACC: Link Service Accept (the reply frame when the responder receives the service request)
[0062] FC-LS: Fiber Channel-Link Services
[0063] NC: Network Controller
[0064] NT stands for Network Terminal
[0065] ID: Identifier (refers to the unique address identifier of the device in the FC network, with a length of 3 bytes)
[0066] SW: Switch
[0067] FLOGI: Fabric Login (login protocol when establishing a connection between a terminal and a switch, referred to as login protocol)
[0068] LS_REQ: Link State Request (Network Node Link State Request Protocol, Link State Request Protocol for short)
[0069] LS_ACK: Link State Acknowledge (Network Node Link State Response Protocol, Link State Response Protocol for short)
[0070] FLOGI LS_ACC: The frame that the switch responds to when receiving the terminal FLOGI, also known as the login response frame.
[0071] LOGO LS_ACC: The frame that the switch replies when receiving the terminal LOGO, also known as the exit response frame.
[0072] ELS: Extended Link Servises
[0073] PLOGI: Port Login (login protocol when establishing a connection between two node devices)
[0074] S_ID: Source ID (source ID, the ID of the device that sends the FC frame)
[0075] D_ID: Destination ID (Destination ID, the device ID that receives the FC frame)
[0076] Cascade port: a port used to interconnect switches
[0077] Payload: In this article, it refers to the content in the FC frame except the locator, CRC checksum and frame header at the frame header and frame footer.
[0078] In addition, the main application scenario of the embodiment of the present invention is FC, which is mainly used in avionics communication systems and is suitable for avionics environments. The protocol that supports FC operation of avionics communication systems is called FC protocol. In the FC protocol, there will be different terminals and switches at the same time to serve the normal operation of the avionics communication system.
[0079] It should be explained that in different FC protocols, the terminal types are different, and the interaction modes between terminals are also different. For example, in the FC-AE-1553 protocol, the terminals are divided into network controllers (NC) and network terminals (NT), and the interaction mode between the two is command-response; in the FC-AE-ASM protocol, each terminal is an equal relationship, but different FC protocols generally rely on Figure 1 switching network.
[0080] Figure 1 It is a common FC switching network. In the FC switching network, when there is a need for communication between terminals or between terminals and switches in the switching network, they all rely on the switching network.
[0081] It should be explained that the automatic maintenance of the connection status of each terminal in the FC switching network link in the embodiment of the present invention depends on the main switch and the sub-switch. There is only one main switch in the switching network, and the others are sub-switches; the main switch is responsible for maintaining the terminal connection status of the entire network, and provides a unified interface for other terminals to query the terminal connection status inside the switching network, and the sub-switch is only responsible for maintaining its own terminal connection status; when the terminal connection information of the sub-switch changes, the change information needs to be synchronized to the main switch.
[0082] The embodiment of the present invention takes the first terminal and the second terminal as examples, and for the convenience of description, the terminal access information request terminals of the first terminal and the second terminal are separated out respectively, and the process of the first terminal and the second terminal being connected to the switch is described. In addition, the first terminal is connected to the main switch, and the second terminal is connected to the secondary switch. For detailed example diagrams, please refer to Figure 2 .
[0083] It should be explained in sequence that the terminal access information table specifically refers to a collection of terminal information that is connected to the FC switching network and can communicate normally. Each terminal information includes the terminal name, terminal address, connected switch identifier, etc., and other information can be added according to actual needs. In the embodiment of the present invention, the terminal access information table includes the whole network and local, wherein the whole network terminal access information table is maintained by the main switch, and the local terminal access information table is maintained by the secondary switch.
[0084] Furthermore, when the terminal is started and accesses the switching network for the first time or again after being disconnected, an address needs to be allocated to the terminal. Taking the first terminal as an example, the detailed execution process includes:
[0085] Transmitting the login protocol of the first terminal to the main switch;
[0086] An allocated address of the first terminal is generated in the main switch, and the allocated address is filled into the login response frame and transmitted back to the first terminal. Meanwhile, terminal information including a terminal name, a terminal address, and an identifier of a connected switch of the first terminal is obtained and stored in the whole network terminal access information table of the main switch.
[0087] In addition, in another embodiment of the present invention, when the first terminal actively exits the switching network, it also needs to perform data interaction with the main switch. The detailed execution process includes:
[0088] Based on the exit exchange network communication protocol, generating an exit exchange network communication request at the first terminal, and sending the request to the main switch;
[0089] When the main switch receives the request to exit the switching network communication, the terminal information of the first terminal is deleted from the whole network terminal access information table of the main switch;
[0090] When the terminal information of the first terminal is deleted successfully, the exit response frame is generated and fed back to the first terminal, completing the process of the first terminal actively exiting the switching network.
[0091] Similarly, refer to Figure 2 As shown, the second terminal corresponds to the secondary switch. When the second terminal logs in or out of the switching network, the execution process is similar to that of the first terminal. The main difference is that the second terminal information can be directly written or deleted in the local terminal access information table of the secondary switch. And the second terminal information needs to use the secondary switch to connect to the main switch, and then insert or delete the second terminal information in the full network terminal access information table of the main switch.
[0092] Reference Figure 3FIG. 1 is a flow chart of a general method for obtaining terminal connection status based on an FC switching network provided by an embodiment of the present invention. In this embodiment, taking a first terminal as an example, the general method for obtaining terminal connection status based on an FC switching network includes:
[0093] S1. Receive a connection request frame from a terminal, and send the connection request frame to a pre-built main switch;
[0094] It should be explained that there is only one main switch in the switching network, and the others are sub-switches. The main switch is responsible for maintaining the terminal connection status of the entire network and providing a unified interface for other terminals to query the terminal connection status within the switching network. The sub-switches are only responsible for maintaining their own terminal connection status. When the terminal connection information of the sub-switch changes, the change information needs to be synchronized to the main switch.
[0095] In the embodiment of the present invention, when the terminal is ready to enter the switching network, it needs to directly perform communication protocol conversion with the switch, and the terminal is not allowed to enter the switching network until the communication protocol conversion requirements are met.
[0096] It should be explained that the terminal and the main switch or the secondary switch both include LS_REQ: Link State Request (network node connection state request protocol, referred to as the connection state request protocol) and LS_ACK: Link State Acknowledge (network node connection state response protocol, referred to as the connection state response protocol).
[0097] Specifically, see Figure 4 As shown, generating a connection request frame according to the connection state request protocol includes:
[0098] S11, generating a universal frame according to the structure information of the pre-constructed universal frame and the FC network standard;
[0099] S12, changing the frame type of the general frame to obtain a connection request frame with information to be completed;
[0100] S13, obtaining the ID of the main switch and the ID of the terminal;
[0101] S14. Combine the ID of the main switch and the ID of the terminal with the connection request frame whose information is to be completed to obtain the connection request frame.
[0102] It should be explained that the general frame of the present invention is a protocol supporting the FC operation avionics communication system, that is, a general frame format of the FC protocol. Figure 5As shown in FIG. 1 , it mainly includes SOF, CRC, EOF, general frame header and Data_Field. Among them, SOF, CRC, EOF and Data_Field are common technical identifiers in the communication field and will not be described here.
[0103] Combination Figure 5 As shown, the structure of the general frame header is further refined. Figure 6 As shown. Figure 6 As shown, the general frame header includes R_CTL, D_ID, S_ID, Payload, etc., where D_ID is the ID of the device receiving the FC frame, S_ID is the ID of the device sending the FC frame, R_CTL is set to 0x22, and Payload is referred to as load. In the embodiment of the present invention, it refers to other information content except SOF, CRC, etc.
[0104] In the embodiment of the present invention, the step of changing the frame type of the general frame to obtain a connection request frame with information to be completed includes:
[0105] Obtain a frame type value table, and search the frame type value corresponding to the connection request frame in the frame type value table;
[0106] The frame sequence number of the connection request frame sent by the terminal is extracted, and the frame sequence number and the frame type value are filled into the general frame to obtain the connection request frame with information to be completed.
[0107] In the embodiment of the present invention, the frame type value of the connection request frame is 0xA7.
[0108] It should be explained that the frame number of the connection request frame refers to the Req_Num field in the payload format of the LS_REQ frame, which is gradually increased by the number of times. For example, when the terminal sends a connection request for the first time, the corresponding frame number is 0, and when it sends a connection request for the second time, the corresponding frame number is 1.
[0109] For details, see the payload format of the request connection frame. Figure 7 As shown in the figure, the payload format of the LS_REQ frame consists of 8 bytes. Req_Num is the sequence number of the LS_REQ frame sent by the terminal, which is used to identify each LS_REQ frame.
[0110] In the embodiment of the present invention, the step of sending the connection request frame to a pre-built main switch includes:
[0111] Determining whether the terminal is directly connected to the main switch;
[0112] If the terminal is directly connected to the main switch, sending the connection request frame to the main switch;
[0113] If the terminal is not directly connected to the main switch, the connection request frame is forwarded several times by the pre-built secondary switch to reach the main switch.
[0114] In detail, when the request connection frame needs to be forwarded by the secondary switch, the secondary switch identifies whether it is the first time to receive the frame according to S_ID and Req_Num, and forwards the frame from the cascade port if it is, otherwise it is directly discarded. The request connection frame reaches the main switch after being forwarded several times by the secondary switch.
[0115] S2. Determine whether the connection request frame is sent to the main switch for the first time;
[0116] In the embodiment of the present invention, the step of determining whether the connection request frame is sent to the main switch for the first time includes:
[0117] Extracting the frame sequence number and the terminal ID from the connection request frame;
[0118] According to whether the main switch has a historical frame sequence number and ID that are the same as the frame sequence number and the ID of the terminal, it is determined whether the connection request frame is sent to the main switch for the first time.
[0119] Furthermore, the generation process of the request response frame is similar to that of the request connection frame, and the main difference lies in the frame type value corresponding to the request response frame in the frame type value table. For example, the frame type value of the above-mentioned request connection frame is 0xA7, and the frame type value of the request response frame is 0xA8.
[0120] For details, the payload format of the request response frame is shown in Figure 8 As shown. The length of the request response frame depends on the number of pieces of terminal information. Each piece of terminal connection information in the request response frame includes: SW_Num (the identifier of the switch to which the terminal is connected), Node_ID (the address of the terminal) and Node_Name (the name of the terminal).
[0121] In the embodiment of the present invention, the method for determining whether the connection request frame is sent to the secondary switch for the first time is the same as the method for determining whether the connection request frame is sent to the primary switch for the first time. It mainly checks whether the historical frame sequence number and ID that are the same as the frame sequence number and the terminal ID can be found in the secondary switch, which will not be described in detail here.
[0122] If the connection request frame is sent to the main switch for the first time, executing S3, extracting the terminal information in the main switch, and encapsulating the terminal information to obtain a request response frame;
[0123] In the embodiment of the present invention, the terminal information can be obtained from the whole network terminal access information table of the host switch. The terminal information includes the terminal name, terminal address, connected switch identifier, etc. Other information can be added according to actual needs.
[0124] In an embodiment of the present invention, the method for generating terminal information includes:
[0125] transmitting the login protocol of the terminal to a switch connected to the terminal;
[0126] The allocated address of the terminal is generated in the switch, and the allocated address is filled into a pre-built login response frame and transmitted back to the terminal. At the same time, terminal information including the terminal name, terminal address, and connected switch identifier of the terminal is obtained and stored in the whole network terminal access information table of the main switch to obtain the terminal information.
[0127] Since the specific implementation process of writing the terminal information into the local terminal access information table is similar to the above, it will not be repeated here.
[0128] In the embodiment of the present invention, encapsulating the request response frame according to the terminal information includes:
[0129] Generate an original response frame according to the structure information of the general frame and the FC network standard;
[0130] Changing the frame type of the original response frame to obtain a request response frame with information to be completed;
[0131] The terminal information is encapsulated into the request response frame whose information is to be completed, to obtain the request response frame.
[0132] It should be explained that the embodiment of the present invention encapsulates the terminal information into the Payload in the request response frame.
[0133] If the connection request frame is not sent to the primary switch for the first time, executing S4, not responding to the connection request frame;
[0134] It is understandable that, since there may be multiple routes between the two switches, the same request connection frame may be forwarded to the main switch through different routes, causing the main switch to repeatedly receive the request connection frame. Therefore, when the request connection frame is not sent to the main switch for the first time, there is no need to respond to the request connection frame.
[0135] S5. Send the request response frame back to the terminal to obtain terminal connection status information.
[0136] In detail, when the request response frame needs to be forwarded by the secondary switch, the secondary switch identifies whether the frame is received for the first time according to D_ID and Ack_Num, and forwards the frame from the cascade port if it is, otherwise discards it. The request response frame reaches the requesting end after being forwarded several times by the secondary switch. The terminal connection status information includes a collection of terminal information that is connected to the FC switching network and can communicate normally.
[0137] Based on the background technology: static configuration and dynamic configuration can effectively complete the terminal access to the FC switching network, but due to the diversity of FC protocol clusters, there is currently no universal method for terminals that meet multiple groups of FC protocol clusters to access the FC switching network. To solve this problem, the embodiment of the present invention divides the switches in the FC switching network into two types: main switches and auxiliary switches, wherein the main switch is responsible for maintaining the terminal connection status of the entire network, and the auxiliary switch is only responsible for maintaining its own terminal connection. The connection of any terminal ultimately depends on the main switch's control of the terminal connection status of the entire interactive network. When the terminal requests the network connection status, by judging whether the request connection frame is sent to the main switch for the first time, a different response strategy is executed for the request connection frame. If the request connection frame sent by the terminal is sent to the main switch for the first time, the terminal information corresponding to the terminal is obtained, and the request response frame is encapsulated according to the terminal information. If the request connection frame is not sent to the main switch for the first time, no response is made to the request connection frame to avoid the possibility of repeatedly receiving the request response frame. Therefore, the present invention makes an organic interface between the two access strategies, which can maximize the phenomenon of terminal access failure caused by different protocols. Therefore, the universal method, device, electronic device and computer-readable storage medium for obtaining terminal connection status based on FC switching network proposed in the present invention can solve the problem that terminals cannot universally access FC switching network due to the diversity of FC protocol clusters.
[0138] like Fig. 9 FIG. 1 is a functional module diagram of a general terminal connection status acquisition device based on an FC switching network provided by an embodiment of the present invention.
[0139] The terminal connection status universal acquisition device 100 based on FC switching network of the present invention can be installed in an electronic device. According to the functions to be implemented, the terminal connection status universal acquisition device 100 based on FC switching network can include a request connection frame sending module 101, a request connection frame judgment module 102, a request response frame generation module 103 and a request response frame return module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, which are stored in the memory of the electronic device.
[0140] The connection request frame sending module 101 is used to receive a connection request frame from a terminal and send the connection request frame to a pre-built main switch;
[0141] The connection request frame determination module 102 is used to determine whether the connection request frame is sent to the main switch for the first time;
[0142] The request response frame generating module 103 is configured to extract the terminal information in the main switch and encapsulate the terminal information to obtain the request response frame if the request connection frame is sent to the main switch for the first time; and not respond to the request connection frame if the request connection frame is not sent to the main switch for the first time.
[0143] The request response frame return module 104 is used to return the request response frame to the terminal to obtain terminal connection status information.
[0144] In detail, the modules in the FC switching network-based terminal connection status universal acquisition device 100 in the embodiment of the present invention are used in the same manner as described above. Figure 1 The same technical means as the general method for obtaining terminal connection status based on FC switching network described in the specification and the like can produce the same technical effects, which will not be described in detail here.
[0145] like Fig.10 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a universal method for acquiring terminal connection status based on an FC switching network provided by an embodiment of the present invention.
[0146] The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a general terminal connection status acquisition program 12 based on an FC switching network.
[0147] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the terminal connection status general acquisition program 12 based on the FC switching network, but also be used to temporarily store data that has been output or is to be output.
[0148] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, a general acquisition program for terminal connection status based on an FC switching network, etc.), and calls data stored in the memory 11, so as to execute various functions of the electronic device 1 and process data.
[0149] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0150] Fig.10 Only an electronic device with components is shown, and those skilled in the art will understand that Fig.10The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0151] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0152] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0153] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0154] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0155] The FC switching network-based terminal connection status general acquisition program 12 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0156] receiving a connection request frame from a terminal, and sending the connection request frame to a pre-built main switch;
[0157] Determining whether the connection request frame is sent to the main switch for the first time;
[0158] If the connection request frame is sent to the main switch for the first time, extracting the terminal information in the main switch, and encapsulating the terminal information to obtain a request response frame;
[0159] If the connection request frame is not sent to the primary switch for the first time, no response is made to the connection request frame;
[0160] The request response frame is transmitted back to the terminal to obtain terminal connection status information.
[0161] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 8 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0162] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0163] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0164] receiving a connection request frame from a terminal, and sending the connection request frame to a pre-built main switch;
[0165] Determining whether the connection request frame is sent to the main switch for the first time;
[0166] If the connection request frame is sent to the main switch for the first time, extracting the terminal information in the main switch, and encapsulating the terminal information to obtain a request response frame;
[0167] If the connection request frame is not sent to the primary switch for the first time, no response is made to the connection request frame;
[0168] The request response frame is transmitted back to the terminal to obtain terminal connection status information.
[0169] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0170] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0172] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0173] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0174] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0175] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A general method for obtaining terminal connection status based on a Fibre Channel (FC) switching network, characterized in that: The method comprises: Receive a connection request frame from a terminal, and send the connection request frame to a pre-built main switch, wherein the main switch is in a pre-built FC switching network, there is only one main switch in the FC switching network, and the others are sub-switches, the main switch is responsible for maintaining the terminal connection status information of the entire network, and provides a unified interface for other terminals to query the terminal connection status information inside the FC switching network, the sub-switch is only responsible for maintaining its own terminal connection status information, when the terminal connection status information maintained by the sub-switch changes, the changed terminal connection status information needs to be synchronized to the main switch, the terminal connection status information refers to a collection of terminal information that is connected to the FC switching network and can communicate normally, and the terminal information includes the terminal name, the terminal address, and the connected switch identifier; Determining whether the connection request frame is sent to the main switch for the first time; If the connection request frame is sent to the main switch for the first time, extracting the terminal information in the main switch, and encapsulating the terminal information to obtain a request response frame; If the connection request frame is not sent to the primary switch for the first time, no response is made to the connection request frame; The request response frame is transmitted back to the terminal to obtain terminal connection status information.
2. The method for obtaining terminal connection status based on FC switching network according to claim 1, characterized in that: The method for generating a connection request frame of the receiving terminal comprises: Generate a universal frame according to the structure information of the pre-built universal frame and the FC network standard; Changing the frame type of the general frame to obtain a connection request frame with information to be completed; Obtaining the ID of the main switch and the ID of the terminal; The ID of the main switch and the ID of the terminal are combined with the connection request frame whose information is to be completed to obtain the connection request frame.
3. The universal method for obtaining terminal connection status based on FC switching network according to claim 2, characterized in that: The step of changing the frame type of the general frame to obtain a connection request frame with information to be completed includes: Obtain a frame type value table, and search the frame type value corresponding to the connection request frame in the frame type value table; The frame sequence number of the connection request frame sent by the terminal is extracted, and the frame sequence number and the frame type value are filled into the general frame to obtain the connection request frame with information to be completed.
4. The universal method for obtaining terminal connection status based on FC switching network according to claim 3, characterized in that: The determining whether the connection request frame is sent to the main switch for the first time includes: Extracting the frame sequence number and the terminal ID from the connection request frame; According to whether the main switch has a historical frame sequence number and ID that are the same as the frame sequence number and the ID of the terminal, it is determined whether the connection request frame is sent to the main switch for the first time.
5. The universal method for obtaining terminal connection status based on FC switching network according to claim 4, characterized in that: The step of encapsulating the request response frame according to the terminal information includes: Generate an original response frame according to the structure information of the general frame and the FC network standard; Changing the frame type of the original response frame to obtain a request response frame with information to be completed; The terminal information is encapsulated into the request response frame whose information is to be completed, to obtain the request response frame.
6. The universal method for obtaining terminal connection status based on FC switching network according to claim 4, characterized in that: The step of sending the connection request frame to a pre-built main switch comprises: Determining whether the terminal is directly connected to the main switch; If the terminal is directly connected to the main switch, sending the connection request frame to the main switch; If the terminal is not directly connected to the main switch, the connection request frame is forwarded several times by the pre-built secondary switch and reaches the main switch.
7. A general terminal connection status acquisition device based on an FC switching network for implementing the method as claimed in claim 1, characterized in that: The device comprises: A connection request frame sending module, used for receiving a connection request frame from a terminal, and sending the connection request frame to a pre-built main switch; A connection request frame determination module, used to determine whether the connection request frame is sent to the main switch for the first time; a request response frame generating module, configured to extract the terminal information in the main switch and encapsulate the terminal information to obtain the request response frame if the request connection frame is sent to the main switch for the first time; and not respond to the request connection frame if the request connection frame is not sent to the main switch for the first time; The request response frame return module is used to return the request response frame to the terminal to obtain terminal connection status information.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the general method for acquiring terminal connection status based on the FC switching network as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the universal method for obtaining terminal connection status based on an FC switching network as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Transmission switch, FC-AE device and Ethernet device communication method
CN114143295A
Connection setting method in multilink connection
JP3008096B1