Serial port information acquisition method, controller, system and storage medium
By setting target components in the server and establishing communication links using preset configuration rules and identification information, serial port access to different components is achieved, and the problem of high hardware resource occupation is solved, simplifying the debugging process and improving efficiency.
Patent Information
- Application Number
- CN202510308054.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-04
AI Technical Summary
In the server, the difference in serial port types of different components leads to a large amount of hardware resources, and it is more inconvenient to set up different physical serial ports for different components.
By receiving the serial port access instructions of the upper computer in the target component, using preset configuration rules and component identification information, a communication link with the to-processed component is established to achieve serial port access to all components, and only one physical serial port or network access is required.
It saves hardware resources, simplifies the debugging process, and improves debugging efficiency. Especially when debugging smart network cards from different manufacturers, there is no need to prepare different forms of serial port lines, which facilitates remote debugging and multi-component serial port information display.
Smart Images

Figure CN120256364A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of servers, and particularly to a method for obtaining serial port information, a controller, a system, and a storage medium. Background Art
[0002] In the technical field of servers, a server can be monitored and managed through a baseboard management controller configured by itself or an externally connected smart network card. When a baseboard management controller, a smart network card, or a central processing unit in the server fails, physical serial ports are usually required for debugging. However, the serial port types required by different components may vary. If corresponding serial ports are respectively set on the server panel for different components, it will occupy a large amount of panel hardware resources, which is rather inconvenient. Summary of the Invention
[0003] This application provides a method, an apparatus, a controller, a system, a storage medium, and a program product for obtaining serial port information, so as to at least solve the problem of occupying too much hardware resources in related technologies.
[0004] This application provides a method for obtaining serial port information. The method is applied to a serial port information acquisition system, which includes multiple components. The method is executed by a target component among the multiple components, and the method includes:
[0005] Receiving a serial port access instruction sent by a host computer, where the serial port access instruction includes identification information of a component to be processed, and the component to be processed is any one of the multiple components;
[0006] According to a preset configuration rule and the identification information of the component to be processed, selecting a communication link construction element corresponding to the component to be processed from the communication link construction elements respectively corresponding to the multiple components, and establishing a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed;
[0007] Reading the serial port information of the component to be processed via the communication link corresponding to the component to be processed;
[0008] Feeding back the serial port information of the component to be processed to the host computer for the host computer to perform a debugging operation on the component to be processed according to the serial port information.
[0009] This application also provides a serial port information acquisition apparatus, including:
[0010] A receiving module, configured to receive a serial port access instruction sent by a host computer, where the serial port access instruction includes identification information of a component to be processed, and the component to be processed is any one of the multiple components;
[0011] A building module, configured to select, according to preset configuration rules and identification information of a component to be processed, a communication link construction element corresponding to the component to be processed from communication link construction elements respectively corresponding to multiple components, and establish a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed;
[0012] A reading module, configured to read serial port information of the component to be processed via the communication link corresponding to the component to be processed;
[0013] A feedback module, configured to feedback the serial port information of the component to be processed to a host computer, so that the host computer performs a debugging operation on the component to be processed according to the serial port information.
[0014] This application also provides a controller, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above serial port information acquisition methods when executing the computer program.
[0015] This application also provides a serial port information acquisition system, where the serial port information acquisition system includes multiple components, and the multiple components include the controller as described above, and the controller is the target component as described above; the target component is configured to execute any of the above serial port information acquisition methods.
[0016] This application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above serial port information acquisition methods are implemented.
[0017] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above serial port information acquisition methods are implemented.
[0018] Through this application, a target component for executing the serial port information acquisition method is set among multiple components, and only the target component interacts with the host computer. In this way, after receiving a serial port access instruction sent by the host computer, the target component can select a communication link construction element corresponding to the component to be processed according to preset configuration rules and the identification information of the component to be processed carried in the serial port access instruction, and establish a communication link corresponding to the component to be processed based on this. The target component can then obtain the serial port information of the component to be processed through the communication link corresponding to the component to be processed. Through the method provided by this solution, only one physical serial port needs to be provided for the target component or network access is performed through the target component, so that the host computer can access the serial ports of all components, and there is no need to set different physical serial ports for different components, which can save hardware resources and is relatively convenient. Description of the Drawings
[0019] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0020] Figure 1 It is a schematic diagram of the architecture of a serial port information acquisition system provided by an embodiment of the present application;
[0021] Figure 2 It is a schematic flowchart of a method for acquiring serial port information provided by an embodiment of the present application;
[0022] Figure 3 It is a display interface diagram of serial port information provided by an embodiment of the present application;
[0023] Figure 4 It is a display interface diagram of firmware information provided by an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of the architecture of another serial port information acquisition system provided by an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of the architecture of yet another serial port information acquisition system provided by an embodiment of the present application;
[0026] Figure 7 It is a schematic diagram of the session path provided by an embodiment of the present application;
[0027] Figure 8 It is a schematic diagram of the architecture of a serial port information acquisition device provided by an embodiment of the present application;
[0028] Figure 9 It is a schematic diagram of the architecture of a controller provided by an embodiment of the present application. Detailed implementation manners
[0029] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0030] It should be noted that in the description of this application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0031] To enable those skilled in the art of this technology to better understand the solution of this application, the following further detailed description of this application will be given in conjunction with the accompanying drawings and specific embodiments.
[0032] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the serial port information acquisition method depends, the specific application environment architecture or specific hardware architecture will be described herein.
[0033] The serial port information acquisition method provided by the embodiments of this application can be implemented by a serial port information acquisition system. As Figure 1 shown, the serial port information acquisition system can include multiple components, and there is a target component among the multiple components that executes the serial port information acquisition method. Among them, the multiple components can be components included in a server, and each component is respectively connected to the target component. The target component can establish a physical communication link with a host computer through a physical serial port provided on the server panel, or can also establish a network communication link with the host computer.
[0034] Among them, the target component can be a controller, specifically, it can be a management controller and a logic controller, etc. For example, the management controller can be the first Baseboard Management Controller (BMC) in the server used to monitor and manage the operation of the server. The logic controller can be a Complex Programmable Logic Device (CPLD) in the server. Other components among the multiple components except the target component can include the second baseboard management controller and the system-on-chip in the intelligent network card, as well as the Central Processing Unit (CPU), Platform Controller Hub (PCH), etc. The host computer can be a laptop computer, etc.
[0035] A plurality of serial communication interfaces can be provided on the first baseboard management controller, and each component in other components can be connected to one or more serial communication interfaces on the first baseboard management controller. Specifically, the complex programmable logic controller can be electrically connected to each serial communication interface respectively, and any other component except the complex programmable logic controller can be indirectly connected to one serial communication interface on the baseboard management controller in the server. The serial communication interface can be a Universal Asynchronous Receiver / Transmitter (UART).
[0036] An embodiment of the present application provides a serial port information acquisition method, which can be executed by the above-mentioned target component, such as Figure 2 shown, and may include the following steps:
[0037] Step S201, receive a serial port access instruction sent by the host computer.
[0038] Among them, the serial port access instruction includes the identification information of the component to be processed, and the component to be processed is any one of the multiple components. The serial port (Serial Port) is fully called the serial communication interface (Serial Communication Interface), which is a standard interface for data transmission between devices.
[0039] Specifically, since problems such as hardware failures or firmware failures may occur in the components in the server, in these cases, technicians can debug the faulty components through the host computer to discover and solve problems. First, the technician can input the identification information of the component to be processed on the host computer. For example, the identification information can be a numerical value or a string. Then, the host computer can generate a serial port access instruction according to the identification information of the component to be processed input by the technician and send it to the target component that has established a communication connection with the host computer. In this way, the target component can receive the serial port access instruction sent by the host, and after parsing the serial port access instruction, obtain the serial port information of the component to be processed for subsequent acquisition of the serial port information of the component to be processed.
[0040] Step S202, select the communication link construction element corresponding to the component to be processed from the communication link construction elements corresponding to the multiple components according to the preset configuration rules and the identification information of the component to be processed, and establish a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed.
[0041] Among them, the preset configuration rules include the rule for selecting the communication link construction element corresponding to the component to be processed, and the rule for establishing a first communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed.
[0042] Specifically, the target component can be a component with control functions, which can communicate with other components through relevant control functions and is generally referred to as a controller. Taking the target component as a logic controller and a management controller respectively, the process of establishing a communication link corresponding to the component to be processed will be described in detail below.
[0043] Case 1: The target component is a logic controller.
[0044] When the component to be processed is not the target component, the target component can construct a communication link corresponding to the component to be processed through the following specific steps.
[0045] Step 1: Use the identification information of the component to be processed to determine, in the communication enabling circuit included in the logic controller, the communication enabling branch corresponding to the identification information of the component to be processed as the communication link construction element corresponding to the component to be processed.
[0046] Among them, the communication enabling circuit can be a selection circuit, including communication enabling branches corresponding to the identification information of multiple components respectively. For example, the communication enabling circuit can be a multiplexer, and the communication enabling branch can be a switch.
[0047] Step 2: Adjust the communication enabling branch corresponding to the identification information of the component to be processed to the first state to connect the physical communication link between the component to be processed and the target component.
[0048] Among them, the physical communication link is the communication link corresponding to the component to be processed.
[0049] Specifically, the target component can use the identification information of the component to be processed to determine, among the multiple communication enabling branches included in its own communication enabling circuit, the communication enabling branch corresponding to the identification information of the component to be processed. Furthermore, the target component can adjust the communication enabling branch corresponding to the identification information of the component to be processed to the first state (for example, adjust the corresponding switch to the high level state). In this way, the physical communication link between the target component and the component to be processed is connected, that is, the communication link between the host computer and the component to be processed is connected.
[0050] When the component to be processed is the target component, the target component can use the communication enabling branches corresponding to all components respectively included in its own communication enabling circuit as the communication link construction elements corresponding to itself, and adjust the communication enabling branches corresponding to all components respectively to the second state (for example, adjust all switches to the low level state) to disconnect the link between the target component and other components, so that the target component can establish a communication link between its own processor and memory (that is, the communication link corresponding to the component to be processed), and thus directly read the serial port information from its own memory.
[0051] In this way, only the target component needs to be connected to a physical serial port to implement the debugging operation of different components, which can save the hardware resources of the server panel.
[0052] Case 2: The target component is a management controller.
[0053] Step 1: Use the identification information of the component to be processed. Respectively, use the identification information of the component to be processed to determine the first network monitoring queue corresponding to the component to be processed in the network monitoring queues corresponding to multiple components, determine the first session monitoring queue corresponding to the component to be processed in the serial port virtual function monitoring queues corresponding to multiple pre-built components, determine the first serial port descriptor corresponding to the component to be processed in the serial port descriptors corresponding to multiple pre-built components, and determine the first data buffer corresponding to the component to be processed in the data buffers corresponding to multiple pre-built components.
[0054] Among them, the serial port descriptor is generally also called the underlying serial port descriptor, which is used to represent the serial communication port. The first network monitoring queue, the first session monitoring queue, the first serial port descriptor, and the first data buffer together serve as the communication link construction elements corresponding to the component to be processed.
[0055] Step 2: Construct the first session path corresponding to the component to be processed according to the first network monitoring queue, the first session monitoring queue, the first data buffer, and the first serial port descriptor.
[0056] Among them, the first session path is the communication link corresponding to the component to be processed. The network monitoring queue can be used to schedule the data packets received through the network interface and the data packets sent to the network interface. The session monitoring queue can be used to process the data related to the session function. For example, the network monitoring queue can be "lanifcq", the session monitoring queue can be "solifcq", the first network monitoring queue can be "lanifcq1", and the first session monitoring queue can be "solifcq1".
[0057] Specifically, the management controller generally configures network management functions and session management functions. To facilitate the debugging and processing of different components, this solution sets corresponding network monitoring queues for different components based on the network management function, and sets corresponding session monitoring queues for different components based on the session management function. For example, the session management function can be Serial Over LAN (SOL). In addition, continuous data stream transmission is involved in the debugging process. Therefore, this solution sets corresponding data buffers for different components to temporarily store data.
[0058] After the management controller parses the identification information of the component to be processed from the serial port access instruction, it can determine the first network monitoring queue, the first session monitoring queue, and the first data buffer corresponding to the component to be processed according to the identification information of the component to be processed. At the same time, the management controller can determine the first serial port descriptor corresponding to the component to be processed in the pre-built serial port descriptors corresponding to multiple components respectively, for subsequent configuration operations on the component to be processed.
[0059] Step S203, read the serial port information of the component to be processed via the communication link corresponding to the component to be processed.
[0060] Case 1, when the target component is a logic controller, the target component can directly read the serial port information from the component to be processed via the physical communication link.
[0061] Case 2, when the target component is a management controller, the target component can read the serial port information of the component to be processed through the first session path.
[0062] Step 1, open the file corresponding to the first serial port descriptor according to the first serial port descriptor.
[0063] Step 2, configure at least one serial port parameter of the first session path in the file.
[0064] Among them, the serial port parameters can be baud rate, transmission rate, data buffer size, port number, etc. The port number can be a User Datagram Protocol (UDP) port number.
[0065] Step 3, after packing all the serial port parameters in at least one serial port parameter, obtain the serial port information of the component to be processed and store it in the first data buffer.
[0066] Step 4, transmit the serial port information of the component to be processed in the first data buffer to the first session monitoring queue.
[0067] Step 5, read the serial port information of the component to be processed from the first session monitoring queue and add it to the first network monitoring queue for transmission.
[0068] Step 6, read the serial port information of the component to be processed from the first network monitoring queue.
[0069] Specifically, the target component can first open the file corresponding to the component to be processed according to the first serial port descriptor (i.e., open the session port corresponding to the first serial port descriptor), and then, according to the preset configuration rules, configure at least one serial port parameter of the first session path in the session port. After packing all the serial port parameters, a session data packet is obtained, that is, the serial port information of the component to be processed is obtained and stored in the first data buffer. In this way, when it is determined that it is the turn to process the serial port information of the component to be processed according to the pre-configured data reading rules, the target component can transmit the serial port information of the component to be processed in the first data buffer to the first session monitoring queue. Then, based on the session management function, when it is determined that it is the turn to process the serial port information of the component to be processed, the target component can read the serial port information of the component to be processed from the first session monitoring queue and add it to the first network monitoring queue for transmission. Finally, based on the network management function, when it is determined that it is the turn to process the serial port information of the component to be processed, the target component can read the serial port information of the component to be processed from the first network monitoring queue and transmit it to the network interface to feedback the serial port information of the component to be processed to the host computer.
[0070] In this way, there is no need for technicians to physically switch the physical serial port on-site. Instead, the component to be processed can be remotely debugged through Ethernet, which is more convenient. Moreover, in this solution, technicians only need to input commands to obtain the serial port information of the corresponding component, without performing switching operations on the physical link. The serial port information corresponding to multiple components can be displayed simultaneously, facilitating the debugging operation by technicians. Additionally, by using the network monitoring queue, session monitoring queue, and data buffer to feedback the serial port information to the host computer in multiple steps, the data can be transmitted to the destination safely and accurately. And in case of a failure, the problem can be accurately located through the information of each node (queue and buffer).
[0071] In some alternative embodiments, when the target component is a management controller, serial port information acquisition plugins corresponding to each component can be pre-configured in the management controller. Among them, the serial port information acquisition plugin is used to process the serial communication protocol, baud rate, data format, etc. of a specific component. Correspondingly, the target component can determine the first plugin corresponding to the component to be processed in the serial port information acquisition plugins corresponding to each component according to the identification information of the component to be processed. Using the first plugin, the session port corresponding to the component to be processed is opened. The target component can configure at least one serial port parameter in this session port to obtain the serial port information of the component to be processed. In this way, since each plugin can independently process the communication tasks of a specific component, even if a certain plugin has a problem, it will not affect the normal communication of other devices, enhancing the reliability of the system.
[0072] Step S204: Feedback the serial port information of the component to be processed to the host computer.
[0073] Specifically, after the target component feeds back the serial port information of the component to be processed to the host computer, the host computer can send a debugging instruction to the component to be processed through the first communication link according to the serial port information and relevant operations of the technical personnel, so as to complete the relevant debugging operations on the component to be processed.
[0074] In some alternative embodiments, when receiving a firmware information acquisition instruction sent by the host computer, the firmware information on the component to be processed is read through the established first communication link.
[0075] Among them, the firmware information acquisition instruction is generated and sent by the host computer when a target input operation is detected in the display interface of the serial port information of the component to be processed.
[0076] Specifically, Figure 3 is the display interface of the serial port information of the component to be processed in the host computer. Among them, the component to be processed is the management controller itself, including port number, baud rate, data buffer size, etc. In Figure 3 In the host computer display interface shown, the technical personnel can perform a target input operation. After the host computer detects the target input operation, it can generate a firmware information acquisition instruction and send the firmware information acquisition instruction to the target component. The target component can then read the firmware information on the component to be processed through the first communication link. For example, the display interface can be the command line interface (CLI) provided by SOL, and the target input operation can be clicking the "Shift key". Furthermore, the host computer can display the firmware information. As Figure 4 shown, what is displayed is the firmware information of the Basic Input / Output System (BIOS), including manufacturer name, firmware version number, release date, starting address loaded into memory, content size occupied during runtime, and supported functional features, etc.
[0077] When the first communication link is a physical communication link between the component to be processed and the target component, the target component can directly read the firmware information from the target component through the first communication link. Alternatively, when the first communication link is the first session path described above, the firmware information can be read from the file of the component to be processed and stored in the first buffer. In this way, when it is determined according to the pre-configured data reading rule that it is the turn to process the serial port information of the component to be processed, the target component can transmit the firmware information in the first data buffer to the first session monitoring queue. Then, based on the session management function, when it is determined that it is the turn to process the firmware information, the target component can read the firmware information from the first session monitoring queue and add it to the first network monitoring queue for transmission. Finally, based on the network management function, when it is determined that it is the turn to process the firmware information, the target component can read the firmware information from the first network monitoring queue and transmit it to the network interface to feedback the serial port information of the component to be processed to the host computer.
[0078] In some alternative embodiments, a technician can also obtain the hardware device information, software information, etc. of the component to be processed by inputting other operation instructions on the component to be processed.
[0079] In some alternative embodiments, when it is detected that the establishment of the first session path fails and the component to be processed is not a management controller or a logic controller, the identification information of the component to be processed is sent to the logic controller, so that the logic controller can establish a physical communication link between itself and the component to be processed and read the serial port information of the component to be processed and feedback it to the management controller.
[0080] Specifically, the session function of the target component may malfunction. Therefore, in this case, the establishment of the first session path will fail. The communication enabling branch corresponding to the management controller in the communication enabling circuit included in the logic controller can default to the first state, that is, the physical communication link between the logic controller and the management controller is connected. When the component to be processed is not the management controller and the logic controller, and after the logic controller receives the identification information of the component to be processed sent by the management controller, it can determine the communication enabling branch corresponding to the identification information of the component to be processed in the communication enabling circuit included in the logic controller as the communication link construction element corresponding to the component to be processed. Adjust the communication enabling branch corresponding to the identification information of the component to be processed to the first state to connect the physical communication link between the component to be processed and the logic controller, and the logic controller can directly read the serial port information from the component to be processed through this physical communication link. After reading the serial port information, the logic controller can adjust the communication enabling branch corresponding to the identification information of the component to be processed to the second state, and adjust the communication enabling branch corresponding to the management controller included in itself to the first state, thereby connecting the physical communication link between itself and the management controller, and sending the serial port information of the component to be processed to the management controller through this physical communication link. The management controller then feeds back the serial port information of the component to be processed to the host computer.
[0081] In this way, in the case of a failure of one transmission method, other alternative methods can be timely adopted to transmit the serial port information, without the need for technicians to re-obtain the serial port information after solving the failure, which can improve the transmission efficiency of the serial port information, and thus can improve the debugging efficiency.
[0082] In some alternative embodiments, after detecting a failure of the communication link corresponding to the component to be processed, the target component can send a failure indication information to the host computer, so that technicians can timely switch the debugging method.
[0083] In some alternative embodiments, after obtaining the identification information of the component to be processed, the target component may first identify its current load indication value, and determine the priority of the component to be processed according to the identification information of the component to be processed and the correspondence between the component identification information and the priority (wherein, the priority may be determined according to the average daily processed data volume of the component to be processed, that is, the more the average daily processed data volume, the higher the priority). Then, the target component may determine the queue size and buffer size of the component to be processed according to the load indication information and the priority of the component to be processed (for example, a basic queue size and a basic buffer size may be predefined in the target component, first determine the difference between the load indication value and the preset load threshold, then determine the ratio of the difference to the first preset difference, determine the sum value of the ratio and the priority as the target coefficient value, take the product of the target coefficient value and the basic queue size as the queue size of the component to be processed, and take the product of the target coefficient value and the basic buffer size as the buffer size of the component to be processed). Furthermore, based on the queue size of the component to be processed, construct a first network queue and a first session queue equal to the queue size, and based on the buffer size, construct a first data buffer equal to the buffer size. In this way, the target component may construct a first session path based on the first network queue, the first session queue, the first data buffer constructed in real time, and the first serial port descriptor. In this way, based on the real-time load condition and the characteristics of the component to be processed, the queue size and buffer size are jointly determined, with high flexibility. At the same time, it can also reduce the impact on other services in the management controller during the debugging process.
[0084] In the serial port information acquisition method provided by the embodiments of the present application, a target component for executing the serial port information acquisition method is set among multiple components, and only the target component interacts with the host computer. In this way, after receiving the serial port access instruction sent by the host computer, the target component may select the communication link construction element corresponding to the component to be processed according to the preset configuration rule and the identification information of the component to be processed carried in the serial port access instruction, and establish the communication link corresponding to the component to be processed based on this. The target component can then obtain the serial port information of the component to be processed through the communication link corresponding to the component to be processed. Through the method provided by this solution, only one physical serial port needs to be provided for the target component, or the target component can be directly accessed through the network, and the host computer can access the serial ports of all components, without setting different physical serial ports for different components, which can save hardware resources. Taking an intelligent network card as an example, the models of intelligent network cards generated by different manufacturers are different, and the forms of serial port interfaces are also inconsistent. When technicians debug the intelligent network card, they need to prepare serial port cables corresponding to different forms of interfaces, which is rather inconvenient. Through this solution, there is no need to prepare serial port cables, but the intelligent network card can be indirectly debugged through the controller.
[0085] Taking the serial port information acquisition system including a logic controller, a first baseboard management controller, a central processing unit, a second baseboard management controller in an intelligent network card, and a system on chip, and the complex programmable logic controller as the target component as an example, the serial port information acquisition method will be described in detail below.
[0086] As Figure 5 shown, there can be 4 universal asynchronous receiver / transmitters (UARTs) on the first baseboard management controller, which are respectively identified as UART 1, UART 2, UART 3, and UART 4. The universal asynchronous receiver / transmitter is a serial communication interface. There can be a multiplexer on the logic controller. The central processing unit 1 is electrically connected to UART 1, and UART 1 is electrically connected to the multiplexer. The second baseboard management controller is electrically connected to UART 2, and UART 2 is electrically connected to the multiplexer. The system on chip in the intelligent network card is electrically connected to UART 3, and UART 3 is electrically connected to the multiplexer. The complex programmable logic controller is electrically connected to UART 1, UART 2, UART 3, and UART 4 respectively.
[0087] In the structure as Figure 5 shown, the serial port information of the central processing unit is connected to the inside of the first baseboard management controller through the Embedded Serial Peripheral Interface (ESPI) physical link, and the ESPI processor in the first baseboard management controller routes this information to the universal asynchronous receiver / transmitter. The serial port information of the second baseboard management controller can be transmitted to UART 2 through the TX / RX signal, and the serial port information of the system on chip can be transmitted to UART 3 through the TX / RX signal. The universal asynchronous receiver / transmitter in the first baseboard management controller is for its own serial port debugging information. The complex programmable logic controller controls the communication enabling branch corresponding to the identification information of the component to be processed in the multiplexer to be adjusted to the first state according to the received identification information of the component to be processed, so as to connect the physical communication link between the component to be processed and the complex programmable logic controller, and then read the identification information of the component to be processed.
[0088] For example, when the identification information of the component to be processed is "&*1", the serial port information of the first baseboard management controller is output. When the identification information of the component to be processed is "&*0", the serial port information of the central processing unit is output. When the identification information of the component to be processed is "&*2", the serial port information of the system on chip of the intelligent network card is output. When the identification information of the component to be processed is "&*3", the serial port information of the second baseboard management controller is output.
[0089] In the serial port information acquisition method provided by the embodiments of the present application, each component has its own universal asynchronous receiver / transmitter (UART) for debugging information output, which facilitates independent debugging and diagnosis by technicians and improves the efficiency of problem troubleshooting. Additionally, a complex programmable logic controller dynamically adjusts the state of a multiplexer according to the identification information of the component to be processed, thereby selecting the correct communication link. This design enables the system to easily add or remove components as needed without reconfiguring the entire communication architecture.
[0090] The following takes a serial port information acquisition system including a first management controller, a central processing unit, a second baseboard management controller, and a system on chip, with the management controller as the target component, as an example to elaborate on the serial port information acquisition method in detail. The serial information acquisition system can be as Figure 6 shown. Three UARTs can be set on the management controller, which are respectively identified as UART 5, UART 6, and UART 7. The central processing unit 1 is electrically connected to UART 5. The second baseboard management controller is electrically connected to UART 6. The system on chip in the intelligent network card is electrically connected to UART 7. Under the above structure, the acquisition of serial port information and firmware information can be carried out according to the following steps:
[0091] Step 1, after the host computer obtains the Internet Protocol (IP) address of the first baseboard management controller, it can perform network access to the first baseboard management controller based on this IP address.
[0092] Step 2, establish an Intelligent Platform Management Interface (IPMI) session. The host computer can send specified IPMI and Remote Management Control Protocol Plus (RMCP+) / RemoteAccess Keyed Payload (RAAKP) messages to the first baseboard management controller to establish a session path. For example, issue the instruction "ipmitool solactivate instance=1" to establish a connection, and the BMC passes messages internally through the monitoring queue lanifcq1.
[0093] Step 3: Obtain channel payload support information. After the host computer recognizes the establishment of the IPMI session with the first baseboard management controller, it can send a first acquisition instruction to the first baseboard management controller to read the availability information and version information of the SOL. For example, the first acquisition instruction can be the Get Channel Payload Support command. The availability information can be used to indicate whether the SOL function is occupied by other sessions.
[0094] Step 4: Activate the payload. When the host computer receives the availability information and version information of the SOL sent by the first baseboard management controller, it can determine whether the SOL is activated on other sessions according to the availability information. When it is determined that the SOL is not activated on other sessions, a first activation instruction can be sent to the management controller of the server. For example, the first activation instruction can be the Activate Payload command.
[0095] Step 5, as Figure 7 shown, the central processing unit corresponds to network session instance 1, the first baseboard management controller corresponds to network session instance 2, the second baseboard management controller corresponds to network session instance 3, and the system on chip corresponds to network session instance 4. Under each session instance, there are corresponding network queues, session IDs, session queues, data buffers, and corresponding serial port descriptors (i.e., / dev / ttys1, / dev / ttys2, / dev / ttys3, / dev / ttys4 in the figure).
[0096] After the first baseboard management controller receives the first activation instruction, it can send a preset message to session queue 1 to enter the SOL process processing logic. At this time, the first baseboard management controller can open the SOL port and perform serial port parameter configuration operations. That is, according to the identification information "1" in "ipmitool sol activate instance=1", the serial port descriptor " / dev / ttys1" corresponding to the central processing unit can be obtained. Based on " / dev / ttys1", the port corresponding to the central processing unit can be opened. The first baseboard management controller can configure serial port parameters such as data buffer size, UDP port number, baud rate, and transmission rate in this port, and package these serial port parameters to obtain an SOL data packet (serial port information), cache it in data buffer 1 corresponding to the central processing unit, and then send it to session queue 1, and then through network queue 1, and then send it to the host computer through the Socket network connection.
[0097] For example, after the host computer sends "ipmitool sol activate instance=1", the serial port information of the central processing unit is displayed; after the host computer sends "ipmitool sol activate instance=2", the serial port information of the first baseboard management controller is displayed; after the host computer sends "ipmitool sol activate instance=3", the serial port information of the second baseboard management controller is displayed; after the host computer sends "ipmitool sol activate instance=4", the serial port information of the system-on-chip of the intelligent network card is displayed.
[0098] Step 6: After the technician performs a target input operation in the command line interface of the SOL provided by the host computer, the data stream (firmware information) continues to be sent to the host computer according to the flow direction in Step 5 above.
[0099] In the serial port information acquisition method provided by the embodiments of the present application, through IPMI and SOL, an administrator can access various components of the server from a remote location and obtain their serial port information, which can simplify management and maintenance work. In addition, this solution does not require switching on the hardware link and can display the serial port information corresponding to multiple components simultaneously.
[0100] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner.
[0101] The embodiments of the present application also provide a serial port information acquisition device, as Figure 8 shown, including:
[0102] A receiving module 801, configured to receive a serial port access instruction sent by the host computer, where the serial port access instruction includes identification information of a component to be processed, and the component to be processed is any one of multiple components;
[0103] A establishing module 802, configured to select a communication link construction element corresponding to the component to be processed from the communication link construction elements corresponding to multiple components according to a preset configuration rule and the identification information of the component to be processed, and establish a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed;
[0104] A reading module 803, configured to read the serial port information of the component to be processed via the communication link corresponding to the component to be processed;
[0105] A feedback module 804 is configured to feedback the serial port information of the component to be processed to the host computer, so that the host computer can perform debugging operations on the component to be processed according to the serial port information.
[0106] In some alternative embodiments, when the target component is a logic controller and the component to be processed is not the target component, the establishment module 802 is specifically configured to:
[0107] Use the identification information of the component to be processed to determine, in the communication enabling circuit included in the logic controller, the communication enabling branch corresponding to the identification information of the component to be processed as the communication link construction element corresponding to the component to be processed;
[0108] Adjust the communication enabling branch corresponding to the identification information of the component to be processed to the first state to connect the physical communication link between the component to be processed and the target component, where the physical communication link is the communication link corresponding to the component to be processed.
[0109] In some alternative embodiments, when the target component is a management controller, the establishment module 802 is specifically configured to:
[0110] Use the identification information of the component to be processed to respectively determine, in the network monitoring queues corresponding to multiple components, the first network monitoring queue corresponding to the component to be processed, in the pre-constructed serial port virtual function monitoring queues corresponding to multiple components, the first session monitoring queue corresponding to the component to be processed, in the pre-constructed serial port descriptors corresponding to multiple components, the first serial port descriptor corresponding to the component to be processed, and in the pre-constructed data buffers corresponding to multiple components, the first data buffer corresponding to the component to be processed, where the first network monitoring queue, the first session monitoring queue, the first serial port descriptor, and the first data buffer together serve as the communication link construction element corresponding to the component to be processed;
[0111] Construct a first session path corresponding to the component to be processed according to the first network monitoring queue, the first session monitoring queue, the first data buffer, and the first serial port descriptor, where the first session path is the communication link corresponding to the component to be processed.
[0112] In some alternative embodiments, the reading module 803 is specifically configured to:
[0113] Directly read the serial port information from the component to be processed via the physical communication link.
[0114] In some alternative embodiments, the reading module 803 is specifically configured to:
[0115] Open a file corresponding to the first serial port descriptor according to the first serial port descriptor;
[0116] Configure at least one serial port parameter of the first session path in the file;
[0117] After packing all the serial port parameters in the at least one serial port parameter, obtain the serial port information of the component to be processed, and store it in the first data buffer;
[0118] Transmit the serial port information of the component to be processed in the first data buffer to the first session monitoring queue;
[0119] Read the serial port information of the component to be processed from the first session monitoring queue and transmit it to the first network monitoring queue;
[0120] Read the serial port information of the component to be processed from the first network monitoring queue.
[0121] In some alternative embodiments, the reading module 803 is further configured to:
[0122] When receiving a firmware information acquisition instruction sent by the host computer, read the firmware information on the component to be processed through the established communication link corresponding to the component to be processed, where the firmware information acquisition instruction is generated and sent by the host computer when a target input operation is detected in the display interface of the serial port information of the component to be processed.
[0123] In some alternative embodiments, the device further includes a monitoring module 805, and the monitoring module 805 is configured to:
[0124] When it is detected that the establishment of the first session path fails and the component to be processed is not a management controller and a logic controller, send the identification information of the component to be processed to the logic controller, so that the logic controller connects the physical communication link between itself and the component to be processed, and reads the serial port information of the component to be processed and feeds it back to the management controller.
[0125] For the description of the features in the corresponding embodiment of the serial port information acquisition device, reference may be made to the relevant description in the corresponding embodiment of the serial port information acquisition method, which will not be elaborated here one by one.
[0126] An embodiment of the present application further provides a controller, as Figure 9 shown, including a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above embodiments of the serial port information acquisition method.
[0127] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any of the above embodiments of the serial port information acquisition method when running.
[0128] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media that can store computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), external hard drives, magnetic disks, or optical discs.
[0129] The embodiments of the present application also provide a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the serial port information acquisition method.
[0130] The embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the serial port information acquisition method.
[0131] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0132] The above has introduced in detail a serial port information acquisition method, device, controller, system, storage medium, and program product provided by this application. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for obtaining serial port information, characterized in that, The method is applied to a serial port information acquisition system, which includes multiple components. The method is executed by a target component among the multiple components, and the method includes: Receiving a serial port access instruction sent by a host computer, where the serial port access instruction includes identification information of a component to be processed, and the component to be processed is any one of the multiple components; Selecting a communication link construction element corresponding to the component to be processed from the communication link construction elements respectively corresponding to the multiple components according to a preset configuration rule and the identification information of the component to be processed, and establishing a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed; Reading the serial port information of the component to be processed via the communication link corresponding to the component to be processed; Feeding back the serial port information of the component to be processed to the host computer for the host computer to perform a debugging operation on the component to be processed according to the serial port information.
2. The serial port information acquisition method according to claim 1, wherein When the target component is a logic controller and the component to be processed is not the target component, the step of selecting a communication link construction element corresponding to the component to be processed from the communication link construction elements respectively corresponding to the multiple components according to a preset configuration rule and the identification information of the component to be processed, and establishing a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed includes: Using the identification information of the component to be processed to determine, in the communication enabling circuit included in the logic controller, a communication enabling branch corresponding to the identification information of the component to be processed as the communication link construction element corresponding to the component to be processed; Adjusting the communication enabling branch corresponding to the identification information of the component to be processed to a first state to connect the physical communication link between the component to be processed and the target component, where the physical communication link is the communication link corresponding to the component to be processed.
3. The serial port information acquisition method according to claim 1, wherein When the target component is a management controller, the step of selecting a communication link construction element corresponding to the component to be processed from the communication link construction elements respectively corresponding to the multiple components according to a preset configuration rule and the identification information of the component to be processed, and establishing a communication link corresponding to the component to be processed by using the communication link construction element corresponding to the component to be processed includes: Using the identification information of the component to be processed, respectively, in the network monitoring queues corresponding to multiple components, determine the first network monitoring queue corresponding to the component to be processed using the identification information of the component to be processed. In the pre-constructed serial port virtual function monitoring queues corresponding to multiple components, determine the first session monitoring queue corresponding to the component to be processed. In the pre-constructed serial port descriptors corresponding to multiple components, determine the first serial port descriptor corresponding to the component to be processed. In the pre-constructed data buffers corresponding to multiple components, determine the first data buffer corresponding to the component to be processed. Wherein, the first network monitoring queue, the first session monitoring queue, the first serial port descriptor, and the first data buffer together serve as communication link construction elements corresponding to the component to be processed; According to the first network monitoring queue, the first session monitoring queue, the first data buffer, and the first serial port descriptor, construct the first session path corresponding to the component to be processed, where the first session path is the communication link corresponding to the component to be processed.
4. The serial port information acquisition method according to claim 2, wherein The reading of the serial port information of the component to be processed via the communication link corresponding to the component to be processed includes: Directly read the serial port information from the component to be processed via the physical communication link.
5. The serial port information acquisition method according to claim 3, wherein The reading of the serial port information of the component to be processed via the communication link corresponding to the component to be processed includes: According to the first serial port descriptor, open the file corresponding to the first serial port descriptor; Configure at least one serial port parameter of the first session path in the file; After packing all the serial port parameters in at least one of the serial port parameters, obtain the serial port information of the component to be processed and store it in the first data buffer; Transmit the serial port information of the component to be processed in the first data buffer to the first session monitoring queue; Read the serial port information of the component to be processed from the first session monitoring queue and transmit it to the first network monitoring queue; Read the serial port information of the component to be processed from the first network monitoring queue.
6. The serial port information acquisition method according to claim 3 or 5, characterized in that After the serial port information of the component to be processed is fed back to the host computer, the method further includes: When receiving the firmware information acquisition instruction sent by the host computer, read the firmware information on the component to be processed through the established communication link corresponding to the component to be processed, where the firmware information acquisition instruction is generated and sent by the host computer when a target input operation is detected in the display interface of the serial port information of the component to be processed.
7. The serial port information acquisition method according to claim 3, characterized in that, The method further includes: When it is detected that the establishment of the first session path fails and the component to be processed is not the management controller and the logic controller, send the identification information of the component to be processed to the logic controller, so that the logic controller connects the physical communication link between itself and the component to be processed and reads the serial port information of the component to be processed and feeds it back to the management controller.
8. A controller, characterized in that, Includes: A memory for storing computer programs; A processor for implementing the steps of the serial port information acquisition method according to any one of claims 1 to 7 when executing the computer program.
9. A serial port information acquisition system, characterized in that, The serial port information acquisition system includes a plurality of components, and among the plurality of components, there is a controller as described in claim 8, and the controller is the target component as described in any one of claims 1-7; The target component is used to execute the serial port information acquisition method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the serial port information acquisition method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Cited By
Serial port switching method and electronic equipment
CN122285581A