CN115599721A - Port switching method, system, computing device and chip - Google Patents

Port switching method, system, computing device and chip Download PDF

Info

Publication number
CN115599721A
CN115599721A CN202211158093.1A CN202211158093A CN115599721A CN 115599721 A CN115599721 A CN 115599721A CN 202211158093 A CN202211158093 A CN 202211158093A CN 115599721 A CN115599721 A CN 115599721A
Authority
CN
China
Prior art keywords
port
data
bmc
serial
switching
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
CN202211158093.1A
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.)
Henan Kunlun Technology Co ltd
Original Assignee
XFusion Digital Technologies 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 XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202211158093.1A priority Critical patent/CN115599721A/en
Publication of CN115599721A publication Critical patent/CN115599721A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3027Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0002Serial port, e.g. RS232C

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The application discloses a port switching method, a port switching system, a computing device and a chip, relates to the technical field of computers, and improves the efficiency of switching a data transmission port used by BMC. The method comprises the following steps: the baseboard management controller BMC receives first data based on the first serial port; the BMC transmits first data to a first device through a first port, wherein a current data transmission port of the first port is the first port; the BMC receives second data based on the first port; if the second data comprises the port switching information, the BMC switches the data transmission port of the first serial port to a second port and transmits the second data to the second device through the second port.

Description

Port switching method, system, computing device and chip
Technical Field
The present application relates to the field of computer technologies, and in particular, to a port switching method, system, computing device, and chip.
Background
The port of each device is packaged in the system, and when the external device is in communication connection with the port of one device in the system, the external device needs to be switched to the port for communication connection through a program of a port switching tool, so that the external device and each device can be communicated respectively.
The above scheme of performing transmission of the port switching instruction through the additional port switching tool to implement communication connection between the external device and the devices corresponding to different ports may result in low efficiency of switching the ports in communication connection with the external device.
Disclosure of Invention
The embodiment of the application provides a port switching method, a system, a computing device and a chip, which do not need to operate an additional port switching tool, and avoid the situation that the switching efficiency of a data transmission port is low because the port switching tool is additionally used for transmitting a port switching instruction in the process of switching the data transmission port used for the communication connection between a Baseboard Management Controller (BMC) and a device. When the BMC needs to switch the data transmission port to transmit data to different devices, the BMC can switch the data transmission port while receiving the data to be transmitted, so that the efficiency of switching the used data transmission port by the BMC is improved.
In order to achieve the technical purpose, the following technical scheme is adopted in the application:
in a first aspect, a method for port switching is provided, where the method includes: the baseboard management controller BMC receives first data based on the first serial port; the BMC transmits first data to a first device through a first port, wherein a current data transmission port of the first port is the first port; the BMC receives second data based on the first port; and if the second data is detected to comprise port switching information, the BMC switches the data transmission port of the first serial port to the second port.
According to the technical scheme, in the process that the BMC transmits data to the managed device, the first port in the BMC can receive the first data, the BMC can transmit the first data to the first device by using the first port on the first port which is currently used as the data transmission port, if the BMC detects that the second data comprises port switching information, and after the first port in the BMC receives the second data, the first port of the BMC can be switched to the second port from the data transmission port used on the first port, and the second data are transmitted to the second device through the second port. Because the BMC can analyze the input data in the process of sending the input data to the first serial port, and when the input data is analyzed to include the port switching information, the BMC can switch the data transmission port of the first serial port from the first port to the second port without running an additional port switching tool to send an additional instruction to the BMC, the condition that port switching instruction transmission is carried out on the BMC through the port switching tool besides the data transmitted to the device and transmitted to the first serial port in the process of switching the data transmission port used by the first serial port is avoided, when the BMC needs to switch the data transmission port to transmit data to different devices, the BMC can realize switching the used data transmission port while receiving the data to be transmitted, and therefore the efficiency of switching the used data transmission port by the BMC is improved.
In one possible implementation, the port switching information includes a switching instruction; the switching instruction comprises the identifier of the second port; alternatively, the port switching information is an identification of the second port.
This possible implementation gives two kinds of port switching information determined from the second data. In one case, the port switching information may be a switching instruction for controlling port switching, and the switching instruction may include an identifier of the second port; in another case, the indication information may be directly the identity of the second port. The two possible port switching information can realize that the BMC switches the data transmission port used by the first port to the second port indicated by the port switching information, and because the port switching information contains the identifier of the second port, the port switching can be accurately realized, and the accuracy of switching the data transmission port used by the first port is improved.
In a possible implementation manner, the second data further includes a baud rate used in data analysis; if it is detected that the second data includes port switching information, before the BMC switches the data transmission port of the first serial port to the second port and transmits the second data to the second device through the second port, the method further includes: the BMC analyzes the second data according to the Baud rate; and acquiring port switching information included in the second data.
In the possible implementation mode, a mode of analyzing the second data needing to be transmitted to the device through the baud rate is provided, the condition of second data analysis error is avoided to a certain extent, the accuracy of analyzing the second data to obtain the port switching information is improved, and therefore the accuracy of switching the data transmission port used by the first serial port is improved.
In a possible implementation manner, the second data further includes a baud rate used in data analysis; the BMC switches the data transmission port of the first serial port into a second port, and comprises the following steps: and when the baud rate included in the second data is less than or equal to a specified threshold, the BMC switches the data transmission port of the first serial port to the second port.
In this possible implementation manner, a situation that the BMC supports switching of the data transmission port is given, that is, when the second data includes the baud rate, and the baud rate is a value within a specified threshold that can be reached by the port, the BMC may switch the data transmission port of the first serial port to the second port. And the second data passes through the validity detection to realize the purpose of switching the used data transmission port and transmitting the data to the device connected with the switched data transmission port.
In a possible implementation manner, the switching, by the BMC, the data transmission port of the first serial port to the second port includes: and when the second port is a port which is configured in advance and supports communication connection with the device, the BMC switches the data transmission port of the first serial port to the second port.
In this possible implementation manner, a case that the BMC supports switching of the data transmission port is given, that is, after the second port is determined by analyzing the second data to obtain the port switching information in the second data, whether the second port is a port that supports communication connection with the device is determined in advance, so that when the second port is determined to be a port that supports communication connection with the device, and is configured in advance, the purpose of switching the port that is in communication connection with the external device is achieved. And the input data can also pass through the legality detection so as to realize the purposes of switching the used data transmission port and transmitting the data to the device connected with the switched data transmission port.
In a possible implementation manner, before the BMC switches the data transmission port of the first serial port to the second port, the method further includes: and if the second data is detected to comprise the port switching information and the second data is detected to further comprise the configuration parameters of the second port, configuring the second port according to the configuration parameters.
In this possible implementation, a manner of configuring the parameter of the second port according to the second data is given. By acquiring the configuration parameters of the second port included in the second data and configuring the second port according to the configuration parameters, after the data transmission port is switched to the second port, the subsequent BMC can normally perform data transmission with the second device through the second port, so that the normal use of the second port is ensured.
In a second aspect, a port switching system is provided, where the port switching system is applied in a BMC, and includes an external serial port component, a detection control component, and a serial port routing component; the serial port routing component comprises a first serial port; the first serial port comprises a data transmission port for transmitting data to the device, the data transmission port comprises a first port and a second port, and the first port is used for transmitting data to the first device; the second port is used for transmitting data to a second device; the external serial port component is used for receiving input data transmitted to the BMC by external equipment, wherein the input data comprises first data and second data; the external serial port component sends the received input data to the detection control component; the detection control component is used for detecting whether the input data contains port switching information; if the input data is detected to be first data which does not contain port switching information, the detection control assembly is further used for sending the first data to the first serial port, and the first serial port transmits the first data to the first device through the first port; the first port is a current data transmission port of the first serial port; if the input data is detected to be second data containing port switching information, the detection control component is further configured to switch a data transmission port of the first serial port from the first port to the second port, and send the second data to the first serial port, where the first serial port transmits the second data to the second device through the second port.
In one possible implementation, the external serial port component includes an external serial port or a server-side component.
That is to say, the external serial port component may include two implementation manners, in one case, the external serial port component may be an external serial port, and the external serial port component is connected to the serial port of the external device through the external serial port; in another case, the external serial port component may be a service end component, and may be connected to the external device through a network via the service end component. Therefore, the external device can realize data transmission with each device managed by the BMC in a near-end or remote mode.
In a third aspect, a port switching device is provided. The port switching device is configured to perform any one of the port switching methods provided by the first aspect.
In a possible implementation manner, the present application may perform the division of the function modules for the port switching device according to the method provided by the foregoing first aspect. For example, the functional blocks may be divided for the respective functions, or two or more functions may be integrated into one processing block. For example, the port switching device may be divided into an input module and a processing module according to functions. The above description of possible technical solutions and beneficial effects executed by each divided functional module may refer to the technical solutions provided by the first aspect or the corresponding possible implementation manners, and will not be described herein again.
In a fourth aspect, an embodiment of the present application provides a computing device, which includes a processor and a memory, where the memory stores at least one computer program, and the at least one computer program is loaded by the processor and executed to implement the port switching method according to the foregoing aspect.
In a fifth aspect, an embodiment of the present application provides a chip system, where the chip system is applied to a port switching system. The system-on-chip includes an interface circuit and a processor. The interface circuit and the processor are interconnected by a line. The processor receives and executes computer instructions from a memory of the port switching system via the interface circuit to cause the processor to implement any of the port switching methods as provided by the first aspect and any of its possible implementations.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the port switching method according to the above aspect.
In a seventh aspect, the present application provides a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the terminal executes the port switching method provided in the various alternative implementations of the above aspect.
For specific descriptions of the second aspect to the seventh aspect and various implementations thereof in this application, reference may be made to the detailed description of the first aspect and various implementations thereof; moreover, for the beneficial effects of the second aspect to the seventh aspect and the various implementation manners thereof, reference may be made to beneficial effect analysis in the first aspect and the various implementation manners thereof, which is not described herein again.
These and other aspects of the present application will be more readily apparent from the following description.
Drawings
FIG. 1 is a diagram illustrating an application scenario architecture in accordance with an illustrative embodiment;
FIG. 2 is a schematic diagram illustrating a port switching process in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of port switching in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating the detection of received data by a BMC involved in the embodiment of FIG. 3;
fig. 5 is a schematic structural diagram of a port switching system 200 involved in the embodiment shown in fig. 3;
fig. 6 is a schematic structural diagram of a port switching application scenario when the external serial port component is connected to an external device in the embodiment shown in fig. 3;
fig. 7 is a schematic structural diagram of a port switching application scenario when the embodiment shown in fig. 3 is connected to an external device through a serial lan;
fig. 8 is a schematic structural diagram of a port switching apparatus according to an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of a chip system according to an exemplary embodiment of the present application.
Detailed Description
In the embodiments of the present application, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the embodiments of the present application, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more unless otherwise specified.
First, some concepts related to a port switching method, a port switching system, a computing device, and a chip provided in an embodiment of the present application are explained:
BMC: also referred to as an out-of-band controller, is an out-of-band processor that is independent of the central processor CPU. The out-of-band controller may include a monitoring management unit outside the computer device, a management system in a management chip outside the processor, a computer device baseboard management unit (BMC), a System Management Module (SMM), and the like. In some embodiments, the BMC is a core component in a server management architecture defined by an IPMI (intelligent platform management interface) protocol, and the BMC is a special microcontroller embedded in a motherboard of a computing device (typically, a server). The BMC may be responsible for managing ports between server management software and devices, the server management software being used to manage the server and running on the BMC.
Serial port: the serial port can be an input/output protocol, the serial port can be called an interface under the condition that the serial port has a physical entity, and the serial port can also be a virtual serial port under the condition that the serial port does not have the physical entity. Wherein, the BMC can be connected with external equipment through an external serial port, and can also be connected with a device managed by the BMC through an internal serial port,
port (port): the port may be a logical window, that is, the port is an Identity (ID) of a serial port, different IDs correspond to different ports, and different ports correspond to different devices.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario structure related to an embodiment of the present application, where the port switching method may be applied to a baseboard management controller 101, the baseboard management controller 101 may be a controller for managing several devices, the baseboard management controller 101 may be disposed in a computing device 100, and the computing device 100 may be a smart phone, a tablet computer, an e-book reader, a personal portable computer, a server, or the like. The computing device 100 may also operate as a remote computing device connected to a network via a network, such as the internet. That is, the computing device 100 may be connected to the network through a network interface unit coupled to the system bus, or may be connected to other types of networks or remote computing device systems using the network interface unit. The baseboard management controller 101 may further include a memory 105, where the memory 105 is a component of the computing device 100 for storing and reading and writing data, the memory 105 may include one or more programs, the one or more programs are stored in the memory 105, and a central processing unit (not shown in fig. 1) of the computing device 100 implements all or part of the steps of the method shown in the embodiment of the present application by executing the one or more programs.
The device supported by the baseboard management controller 101 may include hardware or may include a software system. For example, the device supported by the baseboard management controller 101 may be a RAID (redundant array of independent disks) 102 or an Operating System (OS) 103. Baseboard management controller 101 can be communicatively coupled to disk array 102 and operating system 103, respectively. The disk array 102 may be a large disk group composed of a plurality of disks, and the disk array 102 may be an external storage device for storing or reading data.
In addition, in a scenario where data transmission is performed on each device managed by the baseboard management controller 101, there is an external device 104 that transmits data to the baseboard management controller 101, so that the baseboard management controller 101 transmits the received data to the device, where the external device 104 may be a computing device or an electronic device, for example, the external device 104 may be a smart phone, a tablet computer, an electronic book reader, a personal portable computer, or the like. The external device may be in communication connection with the baseboard management controller 101 to enable the external device 104 to transmit data to the baseboard management controller 101, and the baseboard management controller 101 is in communication connection with the disk array 102 or the operating system 103 to enable the external device 104 to transmit data to the disk array 102 or the operating system 103.
That is to say, in the embodiment of the present application, the baseboard management controller 101 may receive data transmitted by an external device, where the transmitted data may be data for debugging a device, and the debugging device may test whether the device can be used normally by transmitting the data, or configure relevant parameters for the device by transmitting the data. When the data sent by the external device and received by the BMC may indicate to switch a currently used data transmission port on a first serial port communicatively connected to the device, the baseboard management controller 101 may switch the data transmission port used by the first serial port, so that the input data may be transmitted to the device corresponding to the port through the switched data transmission port on the first serial port.
In the related art, when the BMC uses a serial port to interact with the outside, usually only one external serial port is provided, and the external serial port may be connected to an external device, and an internal serial port may be provided inside the BMC, and may be connected to a different device that the BMC supports management, and the internal serial port may be the first serial port. The method comprises the steps that different devices correspond to respective ports, data transceiving can be respectively realized between the different devices for supporting BMC management and external equipment, the external equipment is connected with the BMC through an external serial port, when the internal serial port is used, the BMC needs to switch the port used by the internal serial port, namely, port switching is carried out, wherein the port switching can be to switch the currently used data transmission port for connecting the corresponding device to other ports to realize connection of the device corresponding to the switched port, and the external equipment can switch the data transmission port used by the internal serial port as required when being connected with the BMC through the same external serial port, so that after the external equipment transmits data to the BMC through the external serial port, the BMC carries out data transmission with the device corresponding to the port through the data transmission port used in the internal serial port. Currently, after an external device is communicatively connected to a BMC through an external serial port, if a port used for interaction between the BMC and a device needs to be switched, an additional program needs to be controlled, that is, a window for realizing device communication between the external device and the port through the port may be displayed on the external device, then a window of a port switching tool may be displayed on the external device, the BMC is controlled to be switched to use a data transmission port indicated in the port switching tool to perform communication connection with the corresponding device through an input port switching instruction in the window corresponding to the port switching tool, and then a window for performing communication with the corresponding device through the switched port may be displayed on the external device.
That is to say, by performing communication connection between the external device and each device managed by the BMC, when a device connected to the BMC needs to be switched, a corresponding port switching instruction may be input in a window corresponding to the port switching tool by operating a preset port switching tool, and the port switching tool may switch a port currently implementing communication connection between the external device and the device according to the received port switching instruction, implement an external window input port switching instruction outside a window in communication with the currently connected device, and complete switching a port of the device connected to the external device. The method includes that a port switching tool performs port switching on a window outside a communication window, and an external device needs to frequently switch ports connected with the external device for multiple times in a practical application scene so as to achieve the purpose of communicating with each device.
For example, devices that the BMC supports management include device 1, device 2, and device 3. Port 1 corresponds to device 1, port 2 corresponds to device 2, and port 3 corresponds to device 3. At this time, if the port 1 is already connected to the device 1, the communication window 1 for communicating with the device 1 may be displayed on an external device, the external device communicates with the device 1 through input and output of the communication window 1, when it is necessary to connect the port 3 to the device 3, a port switching tool may be additionally run on the external device, an external window of the port switching tool is displayed, and an port switching instruction is input in the external window, the port switching instruction indicates that the port is switched to the port 3, a program of the port switching tool switches a port of a connection device used by the BMC according to the port switching instruction, the port 1 is switched to the port 3, a communication window 3 for communicating with the device 3 may be displayed on a subsequent external device, if port switching is further required subsequently, the port switching tool needs to be re-run, port switching is performed through the port switching tool, that is, if there is a requirement for frequently performing port switching many times, it is necessary to frequently perform additional program running in a port switching process through the additional port switching tool, and meanwhile, it is necessary to make the step of switching between the port switching frequently performed by the BMC and the BMC perform complicated operations between the external device and the professional BMC.
The embodiment of the application provides a port switching method, which can be applied to a scene that when data transmission is performed between external equipment and a device managed by a BMC (baseboard management controller), the BMC switches a port for performing data transmission to a different device, and can also be applied to a scene that when the BMC performs data transmission with a one-to-one data transmission device connected with a non-port, the port switching in the embodiment of the application is replaced by connection switching under the condition that the BMC has controllable interconnection capacity, and the requirement of connection switching between the BMC and the device can be met. For example, the method includes, but is not limited to, applying the method to a scenario in which an external device debugs each device managed by the BMC, when each device is separately debugged, the external device needs to be in communication connection with each device managed by the BMC, and when the external device is switched from a first device for debugging to a second device for debugging, the external device needs to cut off the communication connection with the first device and change the communication connection to the second device, at this time, the external device needs to perform communication connection between the BMC and the first port of the first device and switch the communication connection between the BMC and the second port of the second device by using the scheme shown in this application, so that the external device can debug each device managed by the BMC as required.
For example, fig. 2 is a schematic diagram of a port switching process according to an embodiment of the present disclosure, as shown in fig. 2, when the BMC uses an internal first serial port, that is, a port 2 on a serial port 2 is already connected to a device 1, the BMC may receive data sent by an external device 104 by using an external serial port, that is, a port 1 on the serial port 1, the port 1 sends the obtained data to a detection control component 202, the detection control component 202 detects whether port switching information exists in the obtained data, if no port switching information exists, the data may obtain a port address of the port 2 on the currently connected serial port 2 through a serial port routing component, and send the data to the device 1 through the port 2 according to the port address of the port 2; if port switching information exists and the port switching information is used for indicating the port 3, the serial port routing component can trigger switching of a data transmission port used on the serial port 2 to be the port 3, a port address corresponding to the port 3 is obtained, and data can be sent to the device 2 through the port 3 according to the port address of the port 3.
That is to say, compared with the prior art, the port switching method provided in the embodiment of the present application may avoid an additional port switching tool from being operated, and avoid a situation that an input port switching instruction is identified by the port switching tool, and a data transmission port used for data transmission between the BMC and the device is switched, which may cause frequent operation. Meanwhile, the BMC can complete the process of switching the data transmission port connected with the device in the normal data transmission process, so that the operation of controlling the BMC to switch the used data transmission port is simplified, and the efficiency of switching the data transmission port is improved.
The methods in the following embodiments may all be implemented in the application scenario as shown in fig. 1. The method of the embodiments of the present application will be described below with reference to the drawings.
Fig. 3 is a flowchart illustrating a port switching method according to an embodiment of the present application. For example, the external device may be the external device 104 shown in fig. 1, the BMC may be the baseboard management controller 101 in the computing device 100 shown in fig. 1, the first device may be the disk array 102 in the computing device 100 shown in fig. 1, and the second device may be the operating system 103 in the computing device 100 shown in fig. 1. The port switching method comprises the following steps:
s101, the external device sends first data to the BMC.
The external device may transmit first data to the BMC through an external serial port, where the first data may be data that needs to be transmitted to a device corresponding to a currently used data transmission port, and the first data does not include port switching information. In this case, the first data may include data to be transmitted to a device connected to the currently used data transmission port, and may further include parsing a baud rate of the first data.
The port switching information may be information included in data sent by the external device to the BMC, and is used to indicate to switch a data transmission port used by the first port of the BMC.
In a possible implementation manner, the external serial port may include an external port, or the external serial port may include a virtual port. The external port is an actually existing connection port, the external device can transmit data to the BMC through wired connection with the external port, the virtual port can be a logic port, and the external device can be connected with the external serial port in a wireless mode and transmit data to the BMC through the external serial port in a wireless mode.
For example, if the data transmission port used by the BMC for data transmission with the device is the first port, the BMC may receive first data transmitted by the external device, where the first data may include data that the external device needs to transmit to the device connected to the first port currently used by the BMC, and in a scenario where the external device debugs the device managed by the BMC, the first data may be data used for debugging the first device connected to the first port.
The embodiment of the present application does not limit the type of the external device. The external device may be any device that supports data transmission with the BMC, or may be any device that supports debugging of a device managed by the BMC. For example, the external device may be a computer device, a smart terminal, or the like.
The first port is not limited in the embodiment of the present application. The first port may be a data transfer port used by the BMC to communicate with any device being managed, and the first port is a data transfer port used by the current BMC to transfer data with the device. For example, if the current communication connection with the BMC is RAID, the first port may be a data transmission port on a first port of the BMC used when the RAID is connected with the BMC; if the current communication connection with the external device is the OS, the first port may be a data transmission port on the first port of the BMC used when the OS is connected with the BMC.
In a possible implementation manner, the BMC may connect each device that the BMC supports management through a data transmission port in a first serial port, where the first port is used to connect the first device, and the second port is used to connect the second device. The first device and the second device may be devices managed by the BMC, the first device may be a device that the BMC performs communication connection through a first port currently used, and the second device may be any device excluding the first device among the devices managed by the BMC.
The number of devices that the BMC can manage is not limited, and the devices that the BMC manages may be implemented as hardware or as a software system.
In a possible implementation manner, the embodiment of the present application does not limit a manner in which the external device transmits data to the BMC. For example, in one case, the external device may establish a wired communication connection with the BMC through an external port included in the external serial port, so that the external device transmits data to the BMC through the external port; in one case, the external device may establish a wireless communication connection with the BMC through a virtual port included in the external serial port, thereby implementing that the external device transmits data to the BMC through the virtual port; in another case, the external device may establish a network connection in the form of a client and a server, thereby implementing data transmission.
In a possible implementation manner, if the external device includes a sending end and a receiving end, the BMC includes an external serial port, the external device may send data to the receiving end in the external serial port of the BMC through the sending end, and the external device may also receive data sent by the BMC through the sending end of the external serial port through the receiving end, so as to implement the communication connection between the external device and the BMC. If the external device includes a first client, the BMC includes a first service end, and the first client and the first service end may perform network connection through a Local Area Network (LAN), that is, the external device performs data transmission with the first service end through the first client, and the first service end receives data sent by the first client through the receiving end and sends data to the first client through the sending end.
The first client may be a Serial Over LAN (SOL) client, and the first server may be an SOL server.
S102, the BMC detects the first data.
In this embodiment of the application, after receiving first data transmitted by an external device, the BMC may analyze the first data, and detect whether the first data includes port switching information, where the port switching information may be used to instruct the BMC to switch a data transmission port used in a first serial port.
In a possible implementation manner, when the two serial ports are asynchronously connected, the serial ports respectively have asynchronous clocks, and when the clocks of the two connected serial ports are different, if the data transmitted to the BMC by the external device does not have the content indicating the baud rate, the data transmitted to the BMC by the external device cannot be correctly analyzed after being transmitted from one serial port to the other serial port, so that the data transmitted to the BMC by the external device may further include the baud rate used in data analysis, so as to realize normal analysis of the data transmitted to the BMC by the external device.
In a possible implementation manner, when the first data further includes a baud rate used in data analysis; the BMC can analyze the first data according to the baud rate and detect whether the first data contains port switching information.
That is to say, in order to ensure that the first data can be normally analyzed when the first data is transmitted between the serial ports or between the serial ports, the first data may include a baud rate, and the baud rate is used to analyze the first data to determine that the first data does not include the port switching information.
S103, after detecting that the first data does not contain port switching information and receiving the first data through the first serial port, the BMC transmits the first data to the first device through the first port which is currently used as a data transmission port.
In this embodiment of the application, the BMC may perform key character detection on the analyzed first data, detect whether the first data includes a key character for indicating switching of the data transmission port, and send the first data to the first serial port because the BMC detects that the first data does not include the key character for indicating switching of the data transmission port, where the first serial port transmits the first data to the first device connected to the first serial port through the currently used data transmission port, that is, the first port, after receiving the first data.
If the BMC determines that the first data does not include the port switching information after analyzing the first data, the BMC may transmit the first data to the first device corresponding to the first port through the first port that has currently established communication connection with the device, so as to achieve a purpose of transmitting the first data sent by the external device to the first device.
And S104, the external device sends second data to the BMC.
In a possible implementation manner, the external device may send the second data to the BMC through the external serial port. The possible implementation manner of the external serial port is as described in S101 above, and is not described herein again.
The embodiment of the present application does not limit the specific content of the second data sent by the external device to the BMC. The specific content of the second data may include port switching information indicating a data transmission port used for switching the first port, and may further include a baud rate used for the second data parsing.
For example, if the external device transmits second data to the BMC, the data transmission port currently used by the first port in the BMC is the first port, and the second data is data that the external device sends to the BMC when the BMC switches the device establishing communication connection with the BMC because the external device needs to send an instruction, where the second data may include port switching information, configuration parameters for configuring the switched port, data that needs to be transmitted to the device connected to the switched port, and a baud rate for analyzing the second data.
The configuration parameters configuring the switched port may include communication parameters of the switched port, for example, the communication parameters of the switched port include data bits of the switched port, and the data bits are parameters for measuring actual data bits in communication; a stop bit of the switched port, the stop bit for identifying the last bit of a single packet, which may be used to correct clock synchronization; the check bit of the switched port is used for indicating an error detection mode in communication; data flow control parameters of the switched port, and the like.
S105, the BMC detects the second data.
In this embodiment of the application, after acquiring the second data, the BMC may analyze the second data, so as to detect port switching information included in the second data.
In one possible implementation, the port switching information may include a switching instruction; the switching instruction may include an identifier of the second port; alternatively, the port switch information may be an identification of the second port.
That is, the port switching information may be used to instruct the BMC to switch the data transmission port used by the first port, and may also be used to determine the switched data transmission port.
In another possible implementation manner, only the switching instruction for instructing the BMC to switch the data transmission port used by the first port may be included in the port switching information, that is, the port switching information may not include the identifier of the second port.
That is to say, when the port switching information cannot determine the switched data transmission port, the BMC may switch the data transmission port used by the first port at random after detecting the port switching information, so as to switch the data transmission port used by the first port.
And S106, switching the data transmission port of the first serial port to the second port when detecting that the second data contains port switching information.
In this embodiment, if the BMC detects port switching information included in the second data after analyzing the second data, the BMC may be controlled to switch the data transmission port used by the first port according to the port switching information.
That is to say, after acquiring the port switching information, the BMC may switch the data transmission port currently used by the first port from the first port to the second port, and when the port switching information includes the identifier of the second port, the second port may be determined according to the identifier of the second port in the port switching information; when the port switching information does not include the identifier of the second port, the second port may be any one of other data transmission ports of the first serial port except for the currently used first port.
In a possible implementation manner, after obtaining the second data, the BMC parses the second data, and if it is detected that the second data includes port switching information, it may be determined that the second data is used to switch a data transmission port on a first port used by the BMC for communication connection with the device. In one case, the port switching information includes a switching instruction, when the BMC parses the second data and determines that the second data includes the switching instruction, it may be determined that the second data may be used to switch a data transmission port on a first port used by the BMC for communication connection with the device, and then, if the switching instruction includes an identifier of the second port, the BMC may obtain an identifier of the second port included in the switching instruction, and the BMC may switch the data transmission port from the first port to the second port according to the identifier of the second port. In another case, the port switching information directly includes an identifier of the second port, and after the BMC parses the second data, it is determined that the second data includes the identifier of the second port, it may be determined that the second data may be used to switch the data transmission port used on the first serial port of the BMC, and the data transmission port may be directly switched from the first port to the second port based on the identifier of the second port. In another case, the port switching information only includes the switching instruction, and the switching instruction does not include the identifier of the second port, so that the BMC may randomly determine one of the data transmission ports of the first serial port other than the first port as the second port, and switch the currently used data transmission port from the first port to the second port.
In addition, after the BMC determines the port switching information included in the second data by analyzing the second data, it is necessary to perform validity detection on the second data, and if the second data passes the validity detection, it may be determined that the BMC may switch the currently used data transmission port from the first port to the second port according to the port switching information in the second data.
In a possible implementation manner, after determining that the second data includes the port switching information, the BMC may stop using the first port currently used as the data transmission port, and then according to an identifier of the second port in the port switching information, the BMC may switch to use the second port to establish a communication connection between the BMC and the second device.
When the BMC determines that the second data comprises port switching information used for indicating switching of the currently used data transmission port, the BMC can stop using the first port, and establishes communication connection between the second port and the corresponding second device according to the port address of the second port, so that the currently used data transmission port is switched from using the first port to using the second port, and communication connection between the BMC and the second device is achieved.
The specific content of the BMC performing the validity detection on the second data may include detecting whether the baud rate in the second data meets the requirement, and may also include detecting whether the second port indicated by the port switching information meets the requirement.
For example, the BMC may detect whether the baud rate in the second data meets the requirement, where the BMC determines the baud rate in the second data, that is, whether the baud rate required for analyzing the second data is within an achievable range, and when the BMC determines that the baud rate of the second data is less than or equal to a specified threshold, which may be the achievable range, determines that the second data passes the validity detection under the condition; the BMC may determine whether the second port indicated by the port switching information in the second data is a port that supports communication connection and is set in advance, and if it is determined that the second port indicated by the port switching information is a port that can support communication connection and is set in advance, determine that the second data passes the validity detection under the condition.
After determining that the second data meets the validity detection under each condition, the BMC may perform a subsequent process of switching the data transmission port on the first port currently used by the BMC.
In a possible implementation manner, after acquiring the second data transmitted by the external device, the BMC may detect whether a key character exists in the second data, where the key character may be a character used for indicating a switching instruction or a character used for indicating a second port identifier.
When the BMC detects that the second data has the character used for indicating the switching instruction, the second data can be determined to be used for switching the data transmission port used by the BMC, and then the identifier of the second port is determined by detecting the character string corresponding to the switching instruction. When the BMC directly detects that a character string indicating a second port identifier exists in the second data, it may be directly determined that the second data is for switching a data transmission port used by the BMC, and the BMC may switch the data transmission port used by the first port from the first port to the second port according to the second port identifier.
In one possible implementation, the BMC transmits the second data to the second device through a second port, where the second port is connected to the second device. Optionally, the BMC may also transmit the data excluding the port switching information in the second data to the second device. Optionally, the second data is port switching information, and the BMC does not transmit the second data to the second device, but retransmits the data received after the data transmission port is switched to the second device until the data transmission port is switched next time.
For example, fig. 4 is a schematic diagram illustrating a process of detecting received data by a BMC according to an embodiment of the present application. As shown in fig. 4, the steps of the BMC detecting the data transmitted by the external device are as follows:
and S11, after receiving the data transmitted by the external equipment, the BMC can detect whether key characters used for switching a data transmission port used for communication connection between the BMC and the device exist in the data.
And S12, when the BMC detects that the key characters used for switching the data transmission port used for the communication connection between the BMC and the device exist in the data, the BMC continues to perform validity detection on the data.
And S13, when the BMC determines that the data passes the validity detection, the BMC switches the data transmission port used by the communication connection between the BMC and the device from the first port to the second port.
That is to say, after the BMC determines that the data passes the validity detection, the BMC may determine the port address of the second port through the identifier of the second port indicated in the key character, and use the second port to connect the second device according to the port address of the second port, thereby switching the data transmission port used for the communication connection between the BMC and the device from using the first port to using the second port.
And S14, when the BMC detects that the key character for switching the data transmission port used for the communication connection between the BMC and the device does not exist in the data, or detects that the key character for switching the data transmission port used for the communication connection between the BMC and the device exists in the input data but determines that the data does not pass the validity detection, the BMC does not switch the data transmission port and directly writes the subsequent character string into a sending register of the first port to realize that the BMC continuously carries out data communication with the first device through the first port. After the BMC switches the data transmission port used for communication connection with the device from the first port to the second port, the BMC may write the subsequent character string into the sending register of the second port, so as to implement data communication between the BMC and the second device through the second port after switching the data transmission port.
In a possible implementation manner, the identifier of the second port included in the port switching information may be a port address of the second port, so that when the data transmission port used for subsequently performing communication connection between the BMC and the device is switched from the first port to the second port, the communication connection may be accurately performed according to the port address of the second port.
When the second data passes the validity detection under any condition or passes the validity detection under each condition, the BMC can switch the data transmission port used for communication connection with the device into the second port after receiving the second data.
In a possible implementation manner, according to validity detection under a condition, if the second data further includes a baud rate used in data analysis, when the baud rate included in the second data is less than or equal to a specified threshold, the BMC may switch a data transmission port used for communication connection with the device from the first port to the second port. Or according to the validity detection under another condition, when the second port is a pre-configured port supporting communication connection with the device, the BMC may switch the data transmission port used for communication connection with the device from the first port to the second port.
In addition, the BMC analyzes the second data, determines that the second data comprises port switching information, and after the validity detection is carried out, the second data can also comprise configuration parameters of a second port, and completes the process that the BMC switches a data transmission port used for communication connection with the device from the first port to the second port while configuring the second port according to the configuration parameters of the second port.
That is to say, when the second data includes the serial port configuration parameter of the second port, the BMC may configure the second port according to the serial port configuration parameter, and simultaneously complete switching of the used data transmission port, so that the BMC may perform communication connection with the second device through the second port.
S107, the BMC transmits the second data to the second device through the second port.
In this embodiment, after the data transmission port used for the communication connection between the BMC and the device is switched from the first port to the second port, the BMC may send the second data and subsequent first data, for which port switching information is not detected, to the second device through the second port.
In the application scenario shown in fig. 1, the above-mentioned port switching method may be applied to a port switching system 200, and in terms of hardware implementation, the port switching system may be implemented as a chip deployed on the baseboard management controller 101. Fig. 5 is a schematic structural diagram of a port switching system 200 according to an embodiment of the present application. As shown in fig. 5, the port switching system 200 may include an external serial port component 201, a detection control component 202, and a serial port routing component 203.
The external serial port component 201 may be a component for establishing a communication connection with the external device 104. The external serial port component 201 may be an external serial port in the above embodiment. The detection control component 202 may be configured in the baseboard management controller 101 to parse received data transmitted by an external device, and determine whether the data received by the BMC may be used to switch a data transmission port used by the BMC to connect with the device, where the data transmission port may include a first port of the first serial port and a second port. The detection control component may also be implemented as a piece of program in the baseboard management controller 101 or a chip integrating the piece of program. The serial routing component 203 includes a first serial port for connecting devices, and the first serial port includes a data transmission port used for connecting different devices, the serial routing component 203 may be configured to control the data transmission port used by the switching board management controller 101 through the first serial port, the first serial port may only use one data transmission port to perform data transmission with the devices at the same time, that is, the first serial port and the second serial port may not be used simultaneously to transmit data to the respective corresponding devices, and the serial routing component may further store a correspondence between an identifier of each port and a port address.
The serial port routing component 203 comprises a first serial port and a serial port interconnection register, the first serial port comprises a first port and a second port, and the first port is used for connecting a first device; the second port is used for connecting a second device; the serial port interconnection register may be configured to store a configuration parameter of the data transmission port, and may also store a correspondence between the port identifier and the port address, where the configuration parameter of the port may include a communication parameter of the data transmission port corresponding to each device that the BMC supports management. Serial port routing component 203 may be configured to configure a data transfer port used by the first serial port.
In one possible implementation manner, the first port may be a port corresponding to the disk array 102, and the second port may be any one of ports included in the serial port routing component 203 except the first port, where the second port may be a port corresponding to the operating system 103. That is, according to the first port and the second port, the first device may be the disk array 102, and the second device may be the operating system 103.
Specifically, the external serial port component 201 may be configured to receive input data transmitted from the external device 104 to the BMC, where the input data includes first data and second data; the external serial port component 201 sends the received input data to the detection control component 202; the detection control component 202 is configured to detect whether the input data includes port switching information; if the input data is detected to be first data which does not contain port switching information, the detection control component 202 is further configured to send the first data to a first serial port, and the first serial port transmits the first data to the first device through the first port; the first port is a current data transmission port of the first serial port; if it is detected that the input data is second data including port switching information, the detection control component 202 is further configured to switch a data transmission port of the first serial port from the first port to the second port, and send the second data to the first serial port, where the first serial port transmits the second data to the second device through the second port.
The external serial port assembly 201 may not include a controller. The detection control component 202 may be implemented as hardware or may be implemented as software. For example, if the detection control component 202 is deployed as hardware, the detection control component 202 may be integrated on the bmc 101 in the form of a chip; if the detection control component 202 is deployed as software, the detection control component 202 may be stored in the form of a section of algorithm or program, and the processor analyzes the input data according to the program, so as to implement a process of triggering switching of the connection data transmission port. The serial port interconnection register included in the serial port routing component 203 can support configuration parameters written into the data transmission port, so that data transmission is performed by using the configured data transmission port, and input data can be transmitted through the data transmission port normally.
In addition, the external serial port component 201 may be implemented as an external serial port, and may also be implemented as a server-side component.
In a possible implementation manner, when the external serial port component 201 is implemented as an external serial port, in a possible case, the external serial port includes an external port, and the external device 104 can transmit data to the BMC through the external port by using a wired connection with the external port; in another possible case, the external serial port includes a virtual port, and the external device 104 may transmit data to the BMC through the virtual port by wireless connection with the virtual port.
Fig. 6 is a schematic structural diagram of a port switching application scenario when an external serial port is connected to an external device according to an embodiment of the present application. As shown in fig. 6, if the current baseboard management controller 101 is in communication connection with the disk array 102 through the first port, the external serial port in the baseboard management controller 101 includes an external port for the external device 104, the baseboard management controller 101 may receive the first data transmitted by the external device 104 through the external port in the external serial port, and after receiving the first data through the external port, the external serial port analyzes the first data through the detection control component 202, specifically, key character detection may be performed on the first data, and when it is not detected that the first data includes a character string for instructing to switch a data transmission port, the first data may be sent to the first serial port in the serial routing component 203, and the first serial port transmits the first data to the corresponding disk array 102 through the currently used data transmission port, that is, the first port. If the substrate management controller 101 receives the second data transmitted by the external device 104 through the external port in the external serial port, and the external serial port analyzes the second data through the detection control component 202 after receiving the second data through the external port, specifically, the key character detection may be performed on the second data, when it is detected that the second data includes a character string for indicating a data transmission port corresponding to the operating system, the validity detection may be continued on the character string, and if the second data passes the validity detection, the configuration parameter for configuring the data transmission port corresponding to the operating system 103 in the second data may be written into the serial port interconnection register in the serial port routing component 203, and meanwhile, the data transmission port used for connecting devices in the current first serial port is switched to the second port corresponding to the operating system 103, and subsequently, the data used for transmitting the second data to the operating system 103 in the second data is transmitted to the operating system 103 through the switched data transmission port, so that when the external device 104 transmits the data used for transmitting the operating system 103 to the BMC, the process of switching the data transmission port corresponding to the operating system 103 is performed.
Because the condition that an additional operation program is used for switching the ports is avoided, the input data containing the key characters is directly input in the communication window of the currently used data transmission port, and the data transmission port used for the communication connection between the BMC and the device can be switched. The problem of complicated user operation caused by switching the data transmission port used for communication connection between the BMC and the device is solved, and the effect of switching the data transmission port can be realized only by inputting the input data containing the key characters into the communication window of the currently used data transmission port by the user.
In a possible implementation manner, when the external serial port component 201 is implemented as a server-side component, the server-side component may include an SOL server and an SOL serial port.
The SOL server includes a virtual port for an external device, and the SOL server may include a detection control component, and the detection control component may be stored and run in the form of a program algorithm in the SOL server, or may be integrated on a chip in the SOL server. The SOL serial port is a serial port which is used for being in communication connection with the SOL server on the BMC, comprises a receiving port and a sending port aiming at the SOL server, and can realize the communication connection between the SOL server and the serial port routing component.
Fig. 7 is a schematic structural diagram of an application scenario of port switching when the application scenario is connected to an external device through a serial lan according to an embodiment of the present application. As shown in fig. 7, if the bmc 101 is communicatively connected to the disk array 102 through the first port, the serial LAN service end 32 in the bmc 101 includes a virtual port for the external device 104, the external device 104 includes the serial LAN client 34, and the serial LAN client 34 can send the first data to the serial LAN service end 32 through the LAN. The bmc 101 may receive, through the serial lan service end 32, first data sent from the external device 104 through the serial lan client 34 of the external device 104, where the serial lan service end 32, after receiving the first data, analyzes the first data through the internal detection control component 202, specifically, key character detection may be performed on the first data, it may be detected that the first data does not include a character string for instructing to switch a data transmission port, the first data may be sent to the serial lan serial port 33, after being received by a receiving port in the serial lan serial port 33, the first data is transmitted to a first serial port in the serial routing component 203, and the data transmission port currently used on the first serial port, that is, the first port, transmits the first data to the corresponding disk array 102. If the baseboard management controller 101 may receive, through the serial lan service end 32, second data from the external device 104 through the serial lan client 34 of the external device 104, and the serial lan service end 32 parses the second data through the internal detection control component 202 after receiving the second data, specifically, key character detection may be performed on the second data, when it is detected that the second data includes a character string indicating a data transmission port corresponding to the operating system 103, validity detection may be continuously performed on the character string, and if the second data passes the validity detection, the second data may be sent to the serial lan serial port 33, and after being received by a receiving port in the serial lan serial port 33, the second data is transmitted to the serial routing component 203, and the serial routing component 203 writes configuration parameters used for configuring the second port corresponding to the operating system 103 in the input data into an interconnection register in the serial routing component 203, and at the same time, the detection control component 202 may trigger switching of a data transmission port used on the first serial port of the connection device of the baseboard management controller 101 from the first port to the operating system 103 to a subsequent data transmission port corresponding to the operating system 103, and when the second data is sent to the external device 103 through the serial routing component 103, and the external data is switched to the operating system 103, and the serial data transmission process of the operating system 103.
Because the SOL window of the currently used data transmission port is displayed on the external equipment in the SOL mode, preset characters can be directly input into the SOL window to switch the data transmission ports, so that the external equipment can transmit data to the device through the data transmission ports corresponding to the preset characters. The BMC detects characters in input data sent by the SOL client based on the SOL server, and can write configuration parameters of a data transmission port corresponding to configuration included in the input data into a serial port interconnection register in a serial port route if the characters are determined to be preset key characters so as to realize switching of the used data transmission port. By the scheme, the problem of frequent operation when the ports need to be switched in the SOL mode after the ports are connected in the SOL mode is solved, and the effect that the data transmission ports connected with the BMC and the device can be switched by inputting key characters to the SOL client side by a user can be realized without additionally running a program.
The external device related to the above embodiment may be a device having a display function and a data input function, and in a scenario of performing data transmission on a device managed by the BMC, if the BMC currently uses a port of the device 1 and establishes a communication connection with the device 1, a debug window for debugging the device 1 may be displayed by the external device, input data including port switching information indicating a port of the device 2 is input in the debug window for debugging the device 1, and the input data is sent to the BMC, and the BMC configures a port of the device 2 by analyzing the input data, and switches a data transmission port used by the BMC to a port corresponding to the device 2, where the debug window is used to debug the device 2. The device 1 and the device 2 are both BMC managed devices.
The foregoing has described aspects of the embodiments of the present application primarily from a method and system perspective. In order to implement the above functions, it includes a hardware structure and/or a software module for performing each function. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the port switching device may be divided into the functional modules according to the above method, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and another division manner may be available in actual implementation.
Fig. 8 shows a schematic structural diagram of a port switching device according to an embodiment of the present application. The port switching device is used for executing the port switching method, and can be applied to BMC. For example, the port switching method shown in fig. 3 is performed. For example, the port switching device may include an input module 110 and a processing module 120.
An input module 110, configured to receive first data based on the first port by the BMC;
the processing module 120 is configured to transmit, by the BMC, the first data to the first device through the first port, where a current data transmission port of the first port is the first port;
the input module 110 is further configured to receive, by the BMC, second data based on the first port;
the processing module 120 is further configured to, if it is detected that the second data includes port switching information, switch the data transmission port of the first serial port to a second port by the BMC, and transmit the second data to the second device through the second port.
For example, in conjunction with fig. 2, the input module 110 may be configured to perform S101, S104, and the processing module 120 may be configured to perform S102, S103, and S105 to S107.
In one possible implementation, the port switching information includes a switching instruction; the switching instruction comprises the identification of the second port; alternatively, the port switch information is an identification of the second port.
In a possible implementation manner, the second data further includes a baud rate used in data analysis; the processing module 120 further includes:
if the second data is detected to comprise port switching information, the BMC switches the data transmission port of the first serial port to a second port, and analyzes the second data according to the baud rate before the second data is transmitted to the second device through the second port; and acquiring the port switching information included in the second data.
In a possible implementation manner, the second data further includes a baud rate used in data analysis; the processing module 120 further includes:
and when the baud rate included in the second data is less than or equal to a specified threshold, the BMC switches the data transmission port of the first serial port to the second port.
In a possible implementation manner, the processing module 120 further includes:
and when the second port is a port which is configured in advance and supports communication connection with the device, the BMC switches the data transmission port of the first serial port to the second port.
In one possible implementation, the apparatus further includes:
and the write-in module is used for configuring the second port according to the configuration parameters when the second data is detected to comprise port switching information and the second data is detected to further comprise the configuration parameters of the second port before the BMC switches the data transmission port of the first serial port to the second port.
For the detailed description of the above alternative modes, reference may be made to the foregoing method embodiments, which are not described herein again. In addition, for the explanation and the description of the beneficial effects of any one of the port switching devices provided above, reference may be made to the corresponding method embodiments described above, and details are not repeated.
As an example, in conjunction with fig. 5, some or all of the functions implemented in the input module 110 may be implemented by the external serial port component 201. Some or all of the implementation of processing module 120 may be implemented by detection control component 202 and serial routing component 203.
In an exemplary embodiment, a computer readable storage medium is further provided, which stores at least one instruction, at least one program, a code set, or a set of instructions, which is loaded and executed by a processor to implement all or part of the steps of the above-mentioned scene picture exhibition method. For example, the computer-readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a compact disc-read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read by a processor of the computing device from a computer-readable storage medium, and the processor executes the computer instructions to cause the computing device to perform all or part of the steps of the method shown in any one of the embodiments of fig. 3 described above.
In some embodiments, the methods illustrated in the embodiments of the present application may be implemented as computer program instructions encoded on a computer-readable storage medium in a machine-readable format or encoded on other non-transitory media or articles of manufacture.
The embodiment of the present application further provides a chip system 130, as shown in fig. 9, the chip system 130 may be applied to a port switching system. The system-on-chip includes at least one processor 131 and at least one interface circuit 132.
By way of example, when the chipset system 130 comprises one processor and one interface circuit, then the one processor may be the processor 131 shown in the solid line block in fig. 8 (or the processor 131 shown in the dashed line block), and the one interface circuit may be the interface circuit 132 shown in the solid line block in fig. 8 (or the interface circuit 132 shown in the dashed line block). When the system-on-chip 130 includes two processors and two interface circuits, then the two processors include a processor 131 shown in a solid line block and a processor 131 shown in a dashed line block in fig. 9, and the two interface circuits include an interface circuit 132 shown in a solid line block and an interface circuit 132 shown in a dashed line block in fig. 9. This is not limitative.
The processor 131 and the interface circuit 132 may be interconnected by wires. For example, the interface circuit 132 may be used to receive signals. As another example, interface circuit 132 may be used to send signals to other devices (e.g., processor 131). Illustratively, interface circuit 132 may read computer instructions stored in a memory of the serial port switching system and send the computer instructions to processor 131. The processor 131 executes the instructions and implements the steps of the above embodiments, for example, the steps executed by the port switching system in the method embodiment shown in fig. 2, in conjunction with the input/output device of the port switching system. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions of the technical solutions that substantially contribute to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Claims (10)

1. A method for port switching, the method comprising:
the baseboard management controller BMC receives first data based on the first serial port;
the BMC transmits the first data to a first device through a first port, wherein the current data transmission port of the first port is the first port;
the BMC receives second data based on the first port;
and if the second data is detected to comprise port switching information, the BMC switches the data transmission port of the first serial port to a second port.
2. The method of claim 1, wherein the port switching information comprises a switch instruction; the switching instruction comprises an identifier of the second port; or, the port switching information is an identifier of the second port.
3. The method according to claim 1 or 2, wherein the second data further comprises a baud rate used in data parsing;
if it is detected that the second data includes port switching information, before the BMC switches the data transmission port of the first serial port to the second port and transmits the second data to the second device through the second port, the method further includes:
the BMC analyzes the second data according to the Baud rate;
and acquiring the port switching information included in the second data.
4. The method according to any one of claims 1 to 3, wherein the second data further comprises a baud rate used in data parsing;
the BMC switches the data transmission port of the first serial port to a second port, and comprises:
and when the baud rate included in the second data is less than or equal to a specified threshold, the BMC switches the data transmission port of the first serial port to the second port.
5. The method of any of claims 1 to 4, wherein the BMC switching the data transfer port of the first serial port to a second port comprises:
and when the second port is a port which is configured in advance and supports communication connection with a device, the BMC switches the data transmission port of the first serial port to the second port.
6. The method of any of claims 1 to 5, wherein before the BMC switches the data transfer port of the first serial port to the second port, the method further comprises:
and if the second data is detected to comprise the port switching information and the second data is detected to further comprise the configuration parameters of the second port, configuring the second port according to the configuration parameters.
7. A port switching system is characterized in that the port switching system is applied to a Baseboard Management Controller (BMC), and comprises an external serial port assembly, a detection control assembly and a serial port routing assembly; the serial port routing component comprises a first serial port; the first serial port comprises a data transmission port used for transmitting data to a device, the data transmission port comprises a first port and a second port, and the first port is used for transmitting data to the first device; the second port is used for transmitting data to a second device;
the external serial port component is used for receiving input data transmitted to the BMC by the external equipment, wherein the input data comprises first data and second data;
the external serial port assembly sends the received input data to the detection control assembly; the detection control component is used for detecting whether the input data contains port switching information or not;
if the input data is detected to be first data which does not contain the port switching information, the detection control component is further used for sending the first data to the first serial port, and the first serial port transmits the first data to the first device through the first port; the first port is a current data transmission port of the first serial port;
if the input data is detected to be second data containing the port switching information, the detection control component is further configured to switch the data transmission port of the first serial port from the first port to the second port, and send the second data to the first serial port, where the first serial port transmits the second data to the second device through the second port.
8. The system of claim 7, wherein the external serial port component comprises an external serial port or a service end component.
9. A computing device, wherein the computing device comprises a processor and a memory; the processor is coupled with the memory; the memory is used for storing computer instructions which are loaded and executed by the processor to cause a computing device to implement the port switching method according to any one of claims 1 to 6.
10. A chip system is characterized in that the chip system is applied to a port switching system; the chip system comprises an interface circuit and a processor; the interface circuit and the processor are interconnected through a line; the processor receives and executes computer instructions from the memory of the port switching system via the interface circuit to cause the processor to implement the port switching method of any of claims 1 to 6.
CN202211158093.1A 2022-09-22 2022-09-22 Port switching method, system, computing device and chip Pending CN115599721A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211158093.1A CN115599721A (en) 2022-09-22 2022-09-22 Port switching method, system, computing device and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211158093.1A CN115599721A (en) 2022-09-22 2022-09-22 Port switching method, system, computing device and chip

Publications (1)

Publication Number Publication Date
CN115599721A true CN115599721A (en) 2023-01-13

Family

ID=84844741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211158093.1A Pending CN115599721A (en) 2022-09-22 2022-09-22 Port switching method, system, computing device and chip

Country Status (1)

Country Link
CN (1) CN115599721A (en)

Similar Documents

Publication Publication Date Title
CN105868149B (en) Serial port information transmission method and device
KR20080016685A (en) Point-to-point link negotiation method and apparatus
CN106294040B (en) Method and device for acquiring optical module state information
CN103401726A (en) Network path detecting method, device and system
US20080034122A1 (en) Apparatus and Method to Detect Miscabling in a Storage Area Network
WO2016082522A1 (en) Management path determination method and device
CN108829619A (en) A kind of continuous topological structure of hard disk ID and hard disk ID localization method
CN114003445B (en) BMC I2C monitoring function test method, system, terminal and storage medium
CN112015689B (en) Method, system and device for switching serial port output paths and switch
CN105940384A (en) Universal serial bus emulation of peripheral devices
CN114338493A (en) NCSI test method, system, device and storage medium based on network protocol stack
CN109428778B (en) Mainboard network connectivity test method and device
CN111948971A (en) Intelligent card management device and data switching method thereof
US8391162B2 (en) Apparatus and method for testing SMNP cards
CN109547274A (en) A kind of enclosure board switching method, device and first network equipment
CN116032746B (en) Information processing method and device of resource pool, storage medium and electronic device
WO2014000299A1 (en) Serial port redirection processing method, device, and system
CN115599311B (en) Polarity inversion method and apparatus, storage medium, and electronic apparatus
CN109885420B (en) PCIe link fault analysis method, BMC and storage medium
CN115599721A (en) Port switching method, system, computing device and chip
CN112148537A (en) Bus monitoring device and method, storage medium, and electronic device
CN107144751B (en) Multi-channel vector network parameter analysis system and method
CN216388068U (en) PCIE interface verification board and test system
CN114970428A (en) Verification system and method for Flexray bus controller in SoC
CN114265731A (en) PCIE interface verification board, test system and test method

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231117

Address after: 450046, 10th Floor, North Chuangzhi Tiandi Building, Shigeng Street, Longzihu Wisdom Island Middle Road East, Zhengdong New District, Zhengzhou City, Henan Province

Applicant after: Henan Kunlun Technology Co.,Ltd.

Address before: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Applicant before: xFusion Digital Technologies Co., Ltd.