Command processing method and device, baseboard management controller, program product and medium

By introducing a high-responsive first operating system to receive and respond to server out-of-band management commands in the substrate management controller, and handing over the rights after the second operating system is fully started, the slow response during the startup of the substrate management controller is solved. Problem, achieving a smooth transition of fast response and rich management functions.

CN119201255AActive Publication Date: 2024-12-27LANGCHAO ELECTRONIC INFORMATION IND CO LTD

Patent Information

Application Number
CN202411732229.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2024-12-27
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The substrate management controller cannot respond quickly to server out-of-band management commands during startup, and the operating system starts for a long time, which cannot meet users' needs for rapid response.

Method used

The first operating system and the second operating system are introduced into the substrate management controller. The first operating system has a faster response speed, which is used to receive and respond to server out-of-band management commands, and to determine whether the second operating system is used through the inter-core communication channel. Initialization is completed, and the received response right is then handed over to the second operating system.

Benefits of technology

It realizes rapid response to server out-of-band management commands during the startup of the substrate management controller, meets user needs, and provides richer management functions after the second operating system is fully started to ensure service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201255A_ABST
    Figure CN119201255A_ABST
Patent Text Reader

Abstract

The invention provides a command processing method and device, a baseboard management controller, a program product and a medium, and relates to the field of baseboard management controllers, the command processing method and device are applied to a first operating system in the baseboard management controller, the baseboard management controller further comprises a second operating system, and the response speed of the first operating system is higher than that of the second operating system. The method comprises the following steps: when a substrate management controller triggers a starting operation, executing a system initialization operation, and establishing an inter-core communication channel with a second operating system; the starting operation is used for triggering the first operating system and the second operating system to execute system initialization operation; receiving and responding to a server out-of-band management command when it is determined that self initialization is completed; judging whether the second operating system is initialized or not by utilizing the inter-core communication channel; when it is determined that initialization of the second operating system is completed, the receiving response right of the out-of-band management command of the server is transferred to the second operating system; and an out-of-band management command of the server can be quickly responded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of baseboard management controllers, and in particular to a command processing method, a device, a baseboard management controller, a program product and a medium. Background Art

[0002] The Baseboard Management Controller (BMC) is an important component in the server. It has a server out-of-band management interface that can receive and respond to input server out-of-band management commands to implement server out-of-band management.

[0003] In the related art, the baseboard management controller cannot respond to the input server out-of-band management command during the process of controlling the startup of the operating system inside it; and the startup time of the operating system in the baseboard management controller is relatively long, so it cannot meet the user's demand for a quick response of the baseboard management controller. Summary of the invention

[0004] The object of the present invention is to provide a command processing method, device, baseboard management controller, program product and medium, which can add a first operating system with a faster response speed in the baseboard management controller, and can add a receiving and responding mechanism for server out-of-band management commands in the first operating system, thereby achieving a rapid response to the server out-of-band management commands during the startup process of the baseboard management controller.

[0005] To solve the above technical problems, the present invention provides a command processing method, which is applied to a first operating system in a baseboard management controller, wherein the baseboard management controller further includes a second operating system, and the response speed of the first operating system is higher than the response speed of the second operating system. The method comprises:

[0006] When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the second operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation;

[0007] When determining that it has completed initialization, it receives and responds to the server out-of-band management command;

[0008] Determining whether the second operating system has completed initialization by using the inter-core communication channel;

[0009] When it is determined that the second operating system has completed initialization, the right to receive and respond to the server out-of-band management command is transferred to the second operating system, so that the second operating system receives and responds to the server out-of-band management command.

[0010] Optionally, receiving and responding to server out-of-band management commands includes:

[0011] A server out-of-band management command sent by an external device is received through a network, the server out-of-band management command is executed to obtain an execution result, and the execution result is sent to the external device through the network.

[0012] Optionally, receiving a server out-of-band management command sent by an external device through a network, executing the server out-of-band management command to obtain an execution result, and sending the execution result to the external device through the network includes:

[0013] Using the first thread to receive a request command through a connection socket interface between the first thread and the external device, and sending the request command to the second thread;

[0014] Determine the type of the request command by using the second thread, process the session establishment command to obtain session establishment response information when the request command is determined to be a session establishment command, and send the session establishment response information to the fourth thread, or send the server out-of-band management command to the third thread when the request command is determined to be the server out-of-band management command;

[0015] Utilizing the third thread to execute the server out-of-band management command to obtain the execution result, and sending the execution result to the fourth thread;

[0016] The session establishment response information or the execution result is sent to the external device via the connection socket interface using the fourth thread.

[0017] Optionally, the first thread receives a request command through a connection socket interface with the external device, and sends the request command to the second thread, including:

[0018] Determining, using the first thread, whether the connection socket interface is triggered;

[0019] If the connection socket interface is triggered, a data header in a network data packet sent by the external device is received through the connection socket interface, and it is determined whether the data header is received successfully;

[0020] If the data header is received successfully, continue to receive the request command in the network data packet through the connection socket interface, and determine whether the request command is received successfully;

[0021] If the request command is received successfully, the request command is sent to the second thread.

[0022] Optionally, before the first thread determines whether the connection socket interface is triggered, the method further includes:

[0023] Determining, by using the first thread, whether a listening socket interface for receiving the out-of-band management command of the server is activated;

[0024] If the listening socket interface is activated, determining whether the listening socket interface is triggered by the external device;

[0025] If the listening socket interface is triggered by the external device, the listening socket interface is set to an accepting state, and a connecting socket interface corresponding to the external device is created.

[0026] Optionally, sending the request command to the second thread includes:

[0027] The request command is sent to the second thread via a message queue using the first thread.

[0028] Optionally, before using the first thread to receive a request command through a connection socket interface with the external device, the method further includes:

[0029] Determining a value of a first thread activation flag using the first thread;

[0030] If the first thread activation flag is a first value, entering a step of using the first thread to receive a request command through a connection socket interface between the first thread and the external device;

[0031] If the activation flag of the first thread is a second value, destroying the first thread;

[0032] Before using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface, the method further includes:

[0033] Determine the value of the second thread activation flag using the fourth thread;

[0034] If the second thread activation flag is the first value, entering the step of using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface;

[0035] If the second thread activation flag is the second value, the fourth thread is destroyed. Optionally, the receiving response right includes network control right and interface control right of the server out-of-band management command;

[0036] Transferring the receiving response right of the server out-of-band management command to the second operating system includes:

[0037] The network control right and the interface control right are transferred to the second operating system in sequence, and when the network control right is transferred, the execution result is sent to the external device through the second operating system, and when the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system.

[0038] Optionally, the network control right and the interface control right are sequentially transferred to the second operating system, the execution result is sent to the external device through the second operating system when the network control right is transferred, and the unexecuted server out-of-band management command is sent to the second operating system when the interface control right is transferred, including:

[0039] Stop receiving the server out-of-band management command, cache the unprocessed server out-of-band management command, and continue to execute the unprocessed server out-of-band management command;

[0040] transferring the network control right to the second operating system;

[0041] When the network control right is transferred, the execution result is sent to the second operating system through the inter-core communication channel, so that the second operating system sends the execution result to the external device through the network;

[0042] Handing over the interface control right to the second operating system;

[0043] When the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system through the inter-core communication channel.

[0044] Optionally, receiving and responding to server out-of-band management commands includes:

[0045] A locally input server out-of-band management command is received through a serial communication interface, the server out-of-band management command is executed to obtain an execution result, and the execution result is output through the serial communication interface.

[0046] Optionally, after transferring the receiving response right of the server out-of-band management command to the second operating system, the method further includes:

[0047] Detecting whether the second operating system encounters an abnormality by using the inter-core communication channel;

[0048] When it is determined that the second operating system encounters an exception, taking over the right to receive and respond to the out-of-band management command of the server.

[0049] The present invention also provides a command processing method, which is applied to a second operating system in a baseboard management controller, wherein the baseboard management controller further includes a first operating system, and the response speed of the first operating system is higher than the response speed of the second operating system. The method includes:

[0050] When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the first operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation, and when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel;

[0051] When determining that the initialization is completed, receiving the receiving response right of the server out-of-band management command transferred by the first operating system;

[0052] When the receiving response right completes receiving, the server out-of-band management command is received and responded to.

[0053] Optionally, the receiving response right includes network control right and interface control right of the server out-of-band management command;

[0054] Receiving the receiving response right of the server out-of-band management command transferred by the first operating system includes:

[0055] Receive the network control right and interface control right transferred by the first operating system in sequence, receive the execution result of the server out-of-band management command sent by the first operating system when the network control right is transferred, and send it to the corresponding external device through the network, and receive the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continue to execute it.

[0056] Optionally, receiving the network control right and the interface control right transferred by the first operating system in sequence, receiving the execution result of the server out-of-band management command sent by the first operating system when the network control right is transferred and sending it to an external device through the network, and receiving the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continuing to execute it, comprising:

[0057] receiving the network control right transferred by the first operating system;

[0058] When the network control right is transferred, receiving the execution result sent by the second operating system through the inter-core communication channel, and sending the execution result to the external device through the network;

[0059] receiving the interface control right transferred by the first operating system;

[0060] When the interface control right is transferred, the unprocessed server out-of-band management command sent by the first operating system is received through the inter-core communication channel, and the unprocessed server out-of-band management command continues to be executed.

[0061] The present invention also provides a command processing device, which is applied to a first operating system in a baseboard management controller, wherein the baseboard management controller further includes a second operating system, and the response speed of the first operating system is higher than the response speed of the second operating system. The device includes:

[0062] an initialization module, configured to execute a system initialization operation and establish an inter-core communication channel with the second operating system when the baseboard management controller triggers a startup operation; the startup operation is configured to trigger both the first operating system and the second operating system to execute the system initialization operation;

[0063] A command receiving and responding module is used to receive and respond to the server out-of-band management command when it is determined that the initialization is completed;

[0064] A determination module, configured to determine whether the second operating system has completed initialization by using the inter-core communication channel;

[0065] The handover module is used to transfer the receiving and responding right of the server out-of-band management command to the second operating system when it is determined that the second operating system has completed initialization, so that the second operating system receives and responds to the server out-of-band management command.

[0066] The present invention also provides a command processing device, which is applied to a second operating system in a baseboard management controller, wherein the baseboard management controller further includes a first operating system, wherein the response speed of the first operating system is higher than the response speed of the second operating system, and the device includes:

[0067] an initialization module, configured to execute a system initialization operation and establish an inter-core communication channel with the first operating system when the baseboard management controller triggers a startup operation; the startup operation is configured to trigger both the first operating system and the second operating system to execute the system initialization operation; when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel;

[0068] A handover module, configured to receive a receiving response right of the server out-of-band management command handed over by the first operating system when determining that the initialization of the server is completed;

[0069] The command receiving and responding module is used to receive and respond to the server out-of-band management command when the receiving response right completes receiving.

[0070] The present invention also provides a baseboard management controller, comprising:

[0071] A memory for storing an operating system program of the first operating system and an operating system program of the second operating system;

[0072] The processor is used to execute the command processing method as described above when loading the operating system program of the first operating system, or to execute the command processing method as described above when loading the operating system program of the second operating system.

[0073] Optionally, the processor includes a main processor and a coprocessor, the main processor runs the second operating system, and the coprocessor runs the first operating system.

[0074] The present invention also provides a computer program product, comprising a computer program or instructions, wherein the computer program or instructions implement the command processing method as described above when executed by a processor.

[0075] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the command processing method as described above is implemented.

[0076] The present invention provides a command processing method, which is applied to a first operating system in a baseboard management controller, wherein the baseboard management controller also includes a second operating system, and the response speed of the first operating system is higher than that of the second operating system. The method comprises: when the baseboard management controller triggers a startup operation, executing a system initialization operation and establishing an inter-core communication channel with the second operating system; the startup operation is used to trigger both the first operating system and the second operating system to execute the system initialization operation; when it is determined that the first operating system has completed initialization, receiving and responding to a server out-of-band management command; using the inter-core communication channel to determine whether the second operating system has completed initialization; when it is determined that the second operating system has completed initialization, transferring the receiving and responding right of the server out-of-band management command to the second operating system, so that the second operating system receives and responds to the server out-of-band management command.

[0077] The beneficial effect of the present invention is that the present invention can simultaneously set the first operating system and the second operating system in the baseboard management controller, wherein the first operating system is a newly added operating system, and its response speed is faster than the second operating system, so it can complete the system initialization in a shorter time; in addition, the first operating system in the present invention also has the ability to receive and respond to the server out-of-band management command. After the baseboard management controller triggers the startup operation and simultaneously triggers the first operating system and the second operating system to perform the system initialization operation, the first operating system can complete the initialization earlier than the second operating system, and preferentially receive and respond to the server out-of-band management command to meet the user's use needs. In addition, the first operating system can also establish an inter-core communication channel with the second operating system, and can use the inter-core communication channel to determine whether the second operating system has completed the initialization. When it is determined that the second operating system has completed the initialization, the first operating system can transfer the receiving and responding right of the server out-of-band management command to the second operating system, so that the second operating system continues to receive and respond to the server out-of-band management command, thereby also realizing the smooth transition of the server out-of-band management command receiving and responding service. The present invention also provides a command processing device, a baseboard management controller, a computer-readable storage medium and a computer program product, which have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0079] Figure 1 A flowchart of a command processing method provided by an embodiment of the present invention;

[0080] Figure 2 A flowchart of another command processing method provided by an embodiment of the present invention;

[0081] Figure 3 A schematic diagram of an IPMI system architecture provided by an embodiment of the present invention;

[0082] Figure 4 A flowchart of an IPMI processing flow on a real-time operating system side provided by an embodiment of the present invention;

[0083] Figure 5 A flowchart of thread interaction provided by an embodiment of the present invention;

[0084] Figure 6 A flowchart of a remote IPMI command execution process provided by an embodiment of the present invention;

[0085] Figure 7 A flowchart of socket creation and network data reception provided by an embodiment of the present invention;

[0086] Figure 8 A flowchart of a remote IPMI execution command sending process provided by an embodiment of the present invention;

[0087] Fig. 9 A flow chart of a receiving response right handover process provided by an embodiment of the present invention;

[0088] Fig.10 A structural block diagram of a command processing device provided by an embodiment of the present invention;

[0089] Fig.11 A structural block diagram of another command processing device provided by an embodiment of the present invention;

[0090] Fig.12 A structural block diagram of a baseboard management controller provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0091] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0092] The Baseboard Management Controller (BMC) is an important component in the server. It has a server out-of-band management interface that can receive and respond to input server out-of-band management commands to implement server out-of-band management. A common server out-of-band management interface may be an IPMI interface (Intelligent Platform Management Interface), and the corresponding server out-of-band management commands may be called IPMI commands.

[0093] In the related art, the baseboard management controller cannot respond to the input server out-of-band management command during the process of controlling the operating system inside it to start up; and the operating system startup time in the baseboard management controller is relatively long, so it cannot meet the user's demand for the baseboard management controller to respond quickly. In view of this, in order to solve the technical problem of how to quickly respond to the server out-of-band management command during the startup of the baseboard management controller, the present invention can add a first operating system with a shorter startup time to the baseboard management controller, and can add a receiving response mechanism for the server out-of-band management command to the first operating system, so that the server out-of-band management command can be quickly responded to during the startup of the baseboard management controller.

[0094] For ease of understanding, the first operating system and the second operating system are briefly introduced below.

[0095] In this embodiment, the response speed of the first operating system is higher than the response speed of the second operating system. For example, when the first operating system and the second operating system perform system initialization operations at the same time, the first operating system can complete the system initialization before the second operating system. This embodiment does not limit the specific form of the first operating system, and can be set according to actual application requirements, as long as it can meet the requirement of higher response speed than the second operating system. The first operating system can specifically be a real-time operating system (RTOS). A real-time operating system refers to an operating system that can ensure that a specific function is completed within a certain time limit, and has the characteristics of fast response speed and high reliability. During the startup process, the real-time operating system has a clear startup time, and this startup time is usually short. Therefore, this embodiment can use the real-time operating system as the first operating system, and add a receiving response mechanism for the server out-of-band management command in the first operating system, so as to first use the first operating system to respond to the server out-of-band management command.

[0096] The above-mentioned second operating system can be a non-real-time operating system. A non-real-time operating system, which can also be called a time-sharing operating system, refers to an operating system based on time slice rotation. This type of operating system has strong performance. If it is set in a baseboard management controller, it can provide a rich server out-of-band management function to the outside. However, a non-real-time operating system does not guarantee the completion of a specific task within a specified time, but focuses on the average response time of all tasks. For example, during the startup process, a non-real-time operating system usually has the problem of loading a lot of content and a long initialization process. The startup process is relatively slow, and the startup time cannot be guaranteed. At the same time, during this process, since the non-real-time operating system has not completed the loading of the kernel and driver related to the server out-of-band management interface, it is impossible to process the server out-of-band management command, which easily gives users a bad feeling of slow response of the baseboard management controller and unsmooth use. However, the performance of a non-real-time operating system is usually higher than that of a real-time operating system, so it can provide more abundant server out-of-band management services than the latter. In other words, a real-time operating system cannot completely replace a non-real-time operating system to provide complex server out-of-band management functions to the outside.

[0097] Combining the advantages and disadvantages of the above two operating systems, the present invention can set the first operating system and the second operating system in the baseboard management controller at the same time, and can add a lightweight server out-of-band management command reception and response mechanism in the first operating system, and can set the server out-of-band management command reception response right handover mechanism in the first operating system and the second operating system. In this way, during the startup of the baseboard management controller, the first operating system can complete the system initialization in advance and give priority to providing lightweight server out-of-band management functions to the outside world; and when the second operating system is started, the first operating system can transfer the reception response right to the second operating system, so that the latter can continue to provide more abundant server out-of-band management functions to the outside world. In this way, it can not only meet the user's demand for a fast response of the baseboard management controller, but also ensure the quality of the later server out-of-band management.

[0098] It is understandable that both of the above operating systems need to be run by the processor in the baseboard management controller. It should be noted that this embodiment does not limit the processor setting in the baseboard management controller, and it can be set with one processor or multiple processors (such as two). In the case of setting one processor, the first operating system and the second operating system can be run by different cores (Core) in the processor. In the case of setting multiple processors, the first operating system and the second operating system can be run by different processors. For example, a main processor and a coprocessor can be set in the baseboard management controller, and the main processor is responsible for running the second operating system, while the coprocessor is responsible for running the first operating system.

[0099] Based on the above introduction, the command processing method provided by this embodiment is introduced below. For easy understanding, please refer to Figure 1 , Figure 1 A flowchart of a command processing method provided by an embodiment of the present invention, the method is applied to a first operating system in a baseboard management controller, the baseboard management controller further includes a second operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the method may include:

[0100] S101. When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the second operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation.

[0101] In this step, when the baseboard management controller triggers the startup operation, it can trigger both the first operating system and the second operating system to perform system initialization operations. In addition, during the startup process, the first operating system needs to establish an inter-core communication channel with the second operating system. This channel can be used by the first operating system to detect whether the second operating system has completed initialization and transmit data. Please refer to the introduction in the subsequent embodiments.

[0102] It should be noted that this embodiment does not limit the form and establishment method of the inter-core communication channel. The inter-core communication channel can be implemented based on inter-process communication or shared memory, and can be set according to actual application requirements.

[0103] It should also be noted that, in order to realize the reception and response functions of lightweight server out-of-band management commands, the system initialization operation of the first operating system should include not only the system kernel initialization operation, but also the command reception function initialization operation and the command response function initialization operation. The command reception function initialization operation can be, for example, a network initialization operation, a serial bus interface initialization operation, etc.

[0104] S102: When it is determined that the initialization is completed, receiving and responding to the server out-of-band management command.

[0105] As described above, the first operating system can complete initialization before the second operating system. Therefore, in this step, when the first operating system determines that it has completed initialization, it can start receiving and responding to the server out-of-band management command in advance. In critical tasks or emergency management operations (such as restarting or shutting down), it can greatly reduce delays and improve system reliability and user experience.

[0106] It should be noted that this embodiment does not limit the input method of the server out-of-band management command. For example, it can be input by an external device through the network, or it can be input through a local serial communication interface. Furthermore, the first operating system can receive the server out-of-band management command sent by the external device through the network, and send the execution result of the command to the external device through the network; it can also receive the server out-of-band management command input locally through the serial communication interface, and output the execution result of the command through the serial communication interface. In other words, the first operating system can have the control capability of network devices (such as network card NIC) and serial communication interfaces.

[0107] Based on this, in one case, receiving and responding to the server out-of-band management command may include:

[0108] Step 11: receiving a server out-of-band management command sent by an external device through a network, executing the server out-of-band management command to obtain an execution result, and sending the execution result to the external device through the network.

[0109] It should be noted that this embodiment does not limit the type of external device, for example, it can be a personal computer, a server, a mobile device, etc.

[0110] In another embodiment, receiving and responding to a server out-of-band management command may include:

[0111] Step 21: receiving a locally input server out-of-band management command through a serial communication interface, executing the server out-of-band management command to obtain an execution result, and outputting the execution result through the serial communication interface.

[0112] It should be noted that this embodiment does not limit a specific serial communication interface, for example, it may be a KCS interface (Keyboard Controller Style, KCS interface protocol).

[0113] It should also be noted that this embodiment does not limit how the first operating system receives and responds to the server out-of-band management command, and can be set according to actual application requirements, for example, it can be set with reference to the functions of the IPMI driver.

[0114] S103: Using the inter-core communication channel, determine whether the second operating system has completed initialization. If the second operating system has completed initialization, proceed to step S104; if the second operating system has not completed initialization, proceed to step S103.

[0115] As described above, since the performance of the first operating system is weaker than that of the second operating system, it generally provides a lightweight server out-of-band management function and cannot completely replace the second operating system. Therefore, in this step, after the first operating system completes initialization, it is also necessary to determine whether the second operating system has completed initialization through the inter-core communication channel, so that when it is determined that the latter has completed initialization, the receiving response right of the server out-of-band management command is promptly transferred to the second operating system. It should be pointed out that step S102 and step S103 are executed in parallel.

[0116] It should also be noted that this embodiment does not limit how the first operating system determines whether the second operating system has completed initialization through the inter-core communication channel. For example, the first operating system can send an initialization status query request to the second operating system through the channel, and determine whether the second operating system has completed initialization based on the response of the second operating system; or the second operating system can actively send initialization completion information to the first operating system when initialization is completed, so that the latter can determine that the former has completed initialization.

[0117] S104: When it is determined that the second operating system has completed initialization, the right to receive and respond to the server out-of-band management command is transferred to the second operating system, so that the second operating system receives and responds to the server out-of-band management command.

[0118] In this step, when it is determined that the second operating system has completed initialization, the first operating system can transfer the right to receive and respond to the server out-of-band management command to the second operating system, so that the second operating system can continue to provide more complex server out-of-band management functions. This can ensure a smooth transition of the server out-of-band management function to ensure the service quality of subsequent management functions.

[0119] Based on the above embodiments, the present invention can simultaneously set the first operating system and the second operating system in the baseboard management controller, wherein the first operating system is a newly added operating system, and its response speed is faster than that of the second operating system, so it can complete the system initialization in a shorter time; in addition, the first operating system in the present invention also has the ability to receive and respond to the server out-of-band management command. After the baseboard management controller triggers the startup operation and simultaneously triggers the first operating system and the second operating system to perform the system initialization operation, the first operating system can complete the initialization earlier than the second operating system, and preferentially receive and respond to the server out-of-band management command to meet the user's use needs. In addition, the first operating system can also establish an inter-core communication channel with the second operating system, and can use the inter-core communication channel to determine whether the second operating system has completed initialization. When it is determined that the second operating system has completed initialization, the first operating system can transfer the receiving and responding rights of the server out-of-band management command to the second operating system, so that the second operating system continues to receive and respond to the server out-of-band management command, thereby also realizing a smooth transition of the server out-of-band management command receiving and responding service.

[0120] Based on the above embodiment, the specific method of receiving and responding to the server out-of-band management command through the network by the first operating system is introduced below. In one possible scenario, the first operating system includes a first thread (LANRECV), a second thread (LANHANDLER), a third thread (IPMIMSGHANDLER) and a fourth thread (LANSEND), and these four threads are responsible for command reception, session establishment, command processing and execution result return, respectively. Receiving a server out-of-band management command sent by an external device through the network, executing the server out-of-band management command to obtain an execution result, and sending the execution result to the external device through the network may include:

[0121] S201: Utilize the first thread to receive a request command through a connection socket interface between the first thread and the external device, and send the request command to the second thread.

[0122] In this embodiment, the first thread (LANRECV) is responsible for receiving the request command sent by the device from the network through the connection socket interface corresponding to the external device, and passing the command to the second thread (LANHANDLER). Among them, the external device has established a connection with the first operating system through the connection socket interface. In addition, after the external device has created the corresponding connection socket interface in the first operating system through interaction, it is also necessary to negotiate with the first operating system through the connection socket interface to establish a session (Session), and send a server out-of-band management command in this session. Therefore, the above request command can be either a session establishment command or a server out-of-band management command. Among them, the session establishment command is a request command involved in negotiating to establish a session. The specific request command receiving process of the first thread can be:

[0123] Step 31: Use the first thread to determine whether the connection socket interface is triggered. If the connection socket interface is triggered, proceed to step 32; if the connection socket interface is not triggered, proceed to step 31 after a preset sleep time.

[0124] In this step, the connection socket interface is triggered, which means that the external device has sent a network data packet to the connection socket interface. Therefore, when the first operating system controls the first thread, it needs to pay attention to the triggering of the connection socket interface and receive the network data packet in time. The above connection socket interface can be specifically stored in the recv group (receive queue), in which the connected socket interface is stored. The first operating system can control the first thread to use the FD_ISSET function to determine whether the connection socket interface in the recv group is triggered.

[0125] In addition, to reduce resource waste, when it is determined that the connection socket interface is not triggered, the first thread may be controlled to re-enter step 31 after sleeping for a preset time. This embodiment does not limit the specific preset time, which may be 1 millisecond, for example.

[0126] Step 32: If the connection socket interface is triggered, the data header in the network data packet sent by the external device is received through the connection socket interface, and it is determined whether the data header is received successfully. If the data header is received successfully, the process proceeds to step 33; if the data header is not received successfully, the process proceeds to step 31 after a preset sleep time.

[0127] In this step, the first operating system can first receive the data header in the network data packet through the first thread, and determine whether the data header is successfully received based on whether the data header is complete. Since the length of the data header is usually fixed, it can be determined whether it is complete based on the length of the received data header. In addition, considering network fluctuations, data reception may not be successful. At this time, in order to reduce resource waste, when it is determined that the data header is not successfully received, the first thread can be controlled to re-enter step 31 after sleeping for a preset period of time.

[0128] Step 33: If the data header is received successfully, continue to receive the request command in the network data packet through the connection socket interface, and determine whether the request command is received successfully. If the request command is received successfully, proceed to step 34; if the request command is not received successfully, proceed to step 31 after a preset sleep time.

[0129] In this step, the first operating system can continue to receive the request command in the network data packet through the first thread, and determine whether the data header is successfully received based on whether the request command is complete. The data header usually records the total length of the data packet, so the length of the request command can be determined based on the total length, and then the length of the received request command can be used to determine whether it is complete. In addition, considering network fluctuations, the request command may not be successfully received. At this time, in order to reduce resource waste, when it is determined that the request command is not successfully received, the first thread can be controlled to re-enter step 31 after sleeping for a preset period of time.

[0130] Step 34: If the request command is received successfully, the request command is sent to the second thread.

[0131] In this step, when it is determined that the request command is received successfully, the first thread can be controlled to send the request command to the second thread for further processing. This embodiment does not limit how the first thread sends the request command to the second thread, and can be set according to actual application requirements. Considering the large number of request commands, in order to facilitate the sequential processing of the second thread, a message queue (LANRECVMSGQ) can be set between the first thread and the second thread, and then the first thread can be controlled to send the request command to the second thread through the message queue.

[0132] Based on this, sending the request command to the second thread may include:

[0133] Step 41: Utilize the first thread to send the request command to the second thread through a message queue.

[0134] Furthermore, the first thread (LANRECV) may also be responsible for establishing the above connection socket interface with the external device. The specific creation process is as follows:

[0135] Step 51: using the first thread to determine whether the listening socket interface for receiving the server out-of-band management command is activated; if the listening socket interface is activated, proceed to step 52; if the listening socket interface is not activated, exit.

[0136] In this step, the listening socket interface is used to receive and respond to the network connection request of the external device, and is usually bound to the corresponding network address (IP address) and port number. The first thread needs to determine whether there is an external device access through the listening socket interface. Therefore, when the control first thread determines that the listening socket interface is activated, the subsequent steps can be continued; when it is determined that the listening socket interface is not activated, it is impossible to determine the access status of the external device and can be exited.

[0137] Step 52: If the listening socket interface is activated, determine whether the listening socket interface is triggered by the external device. If the listening socket interface is triggered by the external device, proceed to step 53; if the listening socket interface is not triggered by the external device, proceed to step 31.

[0138] The above-mentioned listening socket interface can be specifically stored in an accept group (access group), which stores the socket interface for accessing external devices; the first thread can be controlled to use the FD_ISSET function to determine whether the listening socket interface in the accept group is triggered.

[0139] Step 53: If the listening socket interface is triggered by the external device, the listening socket interface is set to an accepting state, and a connection socket interface corresponding to the external device is created.

[0140] In this step, if the listening socket interface is triggered by the external device, it means that the external device has been connected, and then the first thread can allocate a corresponding connection socket interface to the external device.

[0141] S202. Determine the type of the request command by using the second thread, and when it is determined that the request command is a session establishment command, process the session establishment command to obtain session establishment response information, and send the session establishment response information to the fourth thread; or when it is determined that the request command is the server out-of-band management command, send the server out-of-band management command to the third thread.

[0142] In this embodiment, the second thread (LANHANDLER) is responsible for responding to the session creation command and sending the session establishment response information to the fourth thread (LANSEND). The second thread is also responsible for sending the server out-of-band management command to the third thread (IPMIMSGHANDLER). Therefore, the second thread can be controlled to determine the type of the request command. If it is a session establishment command, it needs to be processed to obtain the session establishment response information, and the session establishment response information is sent to the fourth thread; if it is a server out-of-band management command, it needs to be sent to the third thread.

[0143] It should be noted that this embodiment does not limit the specific session creation command, and reference may be made to related technologies. For example, the session creation command may be a RMCP command (Remote Management Control Protocol), a RAKP command (Remote Access Reference Architecture Key Pad Protocol), or the like.

[0144] S203: Utilize the third thread to execute the server out-of-band management command to obtain the execution result, and send the execution result to the fourth thread.

[0145] In this embodiment, the third thread (LANHANDLER) is responsible for executing the server out-of-band management command to obtain the execution result, and sends the execution result to the fourth thread (LANSEND). It should be noted that this embodiment does not limit how the third thread executes the server out-of-band management command, nor does it limit what kind of execution result it can produce. Please refer to related technologies, such as related technologies of IPMI.

[0146] S204: Utilize the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface.

[0147] In this embodiment, the fourth thread (LANHANDLER) sends the session establishment response information or the execution result to the external device through the connection socket interface. In the case where a message queue is set between the first thread and the second thread, the fourth thread can be controlled to monitor the message queue, and when the session establishment response information or the execution result is taken out from the message queue, it is sent to the external device.

[0148] Furthermore, the first thread and the fourth thread may both have corresponding thread activation identifiers. For example, the thread activation identifier of the first thread may be gLanHandlerActive, and the thread activation identifier of the second thread may be gLanSendActive. The thread activation identifier corresponds to a first value or a second value, the first value is used to control the thread to work, and the second value is used to control the thread to shut down. For example, "1" is used to control the thread to work, and "0" is used to control the thread to shut down. In this way, when the first thread and the fourth thread are not needed, the two threads can be controlled to stop working by adjusting the corresponding thread activation identifiers.

[0149] Based on this, before using the first thread to receive the request command through the connection socket interface between the external device, the method may further include:

[0150] Step 61: using the first thread to determine a value of a first thread activation flag;

[0151] Step 62: If the first thread activation flag is the first value, entering the step of using the first thread to receive a request command through the connection socket interface between the first thread and the external device;

[0152] Step 63: If the activation flag of the first thread is a second value, destroying the first thread;

[0153] Before using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface, the method further includes:

[0154] Step 71: using the fourth thread to determine the value of the second thread activation flag;

[0155] Step 72: If the second thread activation flag is the first value, entering the step of using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface;

[0156] Step 73: If the second thread activation flag is a second value, destroy the fourth thread.

[0157] It can be seen that the present invention can provide a lightweight server out-of-band management command receiving and response mechanism by setting the above four threads, thereby ensuring that the first operating system can temporarily replace the second operating system to receive and respond to commands, thereby improving service quality.

[0158] Based on the above embodiment, when the first operating system receives and responds to the server out-of-band management command through the network, the receiving and responding rights of the command may specifically include the network control right and the interface control right (such as IPMI control right) of the server out-of-band management command, wherein the network control right refers to the control right of the network card device, and the interface control right refers to the receiving and responding right of the server out-of-band management command. The transfer process of the network control right and the interface control right will be described below.

[0159] Based on this, transferring the receiving response right of the server out-of-band management command to the second operating system may include:

[0160] S301. Transfer the network control right and the interface control right to the second operating system in sequence, send the execution result to the external device through the second operating system when the transfer of the network control right is completed, and send the unprocessed server out-of-band management command to the second operating system when the transfer of the interface control right is completed.

[0161] In this embodiment, in order to ensure that the existing tasks are not interrupted, that is, to ensure that the first operating system can continue to process the server out-of-band management commands that it has received but has not completed processing, the above-mentioned network control rights and interface control rights will be transferred from the first operating system to the second operating system in sequence, and the transfer order is to transfer the network control rights first, and then transfer the interface control rights after completing the transfer of the network control rights. At the same time, when the network control rights have been transferred and the interface control rights have not been transferred, the first operating system can send the execution result of the server out-of-band management command to the second operating system, and the second operating system sends the execution result to the external device through the network card device. In addition, when the interface control rights have been transferred, the first operating system can send the server out-of-band management commands that have not yet been processed to the second operating system for continued processing. In this way, a smooth transition of network control rights and interface control rights can be achieved without interrupting the response to the server out-of-band management commands.

[0162] Specifically, the network control right and the interface control right are sequentially transferred to the second operating system, the execution result is sent to the external device through the second operating system when the network control right is transferred, and the unexecuted server out-of-band management command is sent to the second operating system when the interface control right is transferred, which may include:

[0163] Step 81: Stop receiving the server out-of-band management command, cache the unprocessed server out-of-band management command, and continue to execute the unprocessed server out-of-band management command.

[0164] In this step, when the first operating system determines that the second operating system has completed initialization and is ready to start handing over permissions, it will stop receiving server out-of-band management commands and temporarily cache unprocessed server out-of-band management commands. It is worth noting that at this time, the first operating system can still continue to execute unprocessed server out-of-band management commands.

[0165] Step 82: Transferring the network control right to the second operating system.

[0166] Step 83: When the network control right is transferred, the execution result is sent to the second operating system through the inter-core communication channel, so that the second operating system sends the execution result to the external device through the network.

[0167] In steps 82 and 83, the first operating system may transfer the network control right to the second operating system. After the transfer is successful, the first operating system will not be able to control the network card device, that is, the first thread and the fourth thread in the first operating system will not work. To avoid response interruption, the first operating system may regard the second operating system as a network agent, and may send the execution result to the second operating system through the inter-core communication channel, so that the second operating system can send the execution result to the external device through the network.

[0168] Step 84: Hand over the interface control right to the second operating system.

[0169] Step 85: When the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system through the inter-core communication channel.

[0170] In steps 84 and 85, the first operating system may transfer the interface control right to the second operating system. After the transfer is successful, the first operating system will not be able to continue to execute the server out-of-band management command. To avoid response interruption, the first operating system may regard the second operating system as an interface agent, and may send the server out-of-band management commands that have not been processed to the second operating system, so that the latter can continue to execute these server out-of-band management commands. After the server out-of-band management command is transmitted, the first operating system may determine that the authority transfer is completed.

[0171] It can be seen that the present invention ensures that the server out-of-band management commands can be processed stably and efficiently in different operation stages of the system through a smooth control handover mechanism. The first operating system is responsible for receiving and processing the key remote server out-of-band management commands at the initial startup, while the second operating system takes over after full startup and provides a more complete command processing mechanism. This staged task processing method not only improves the stability of the system, but also increases the reliability of the baseboard management controller when handling emergencies or high-load tasks.

[0172] Based on the above embodiment, after the first operating system transfers the receiving response right of the server out-of-band management command to the second operating system, the abnormal monitoring mode may be entered. The specific working content of the abnormal monitoring mode is introduced below.

[0173] Based on this, after the receiving response right of the server out-of-band management command is transferred to the second operating system, the method may further include:

[0174] S401. Utilize the inter-core communication channel to detect whether the second operating system encounters an abnormality.

[0175] S402: When it is determined that the second operating system encounters an exception, take over the right to receive and respond to the out-of-band management command of the server.

[0176] In this embodiment, the first operating system can also use the inter-core communication channel to detect whether the second operating system encounters an abnormality. For example, the second operating system can periodically send a heartbeat signal to the first operating system through the inter-core communication channel, and the latter can determine whether the former is working normally based on the heartbeat signal. If the first operating system determines that the second operating system encounters an abnormality and cannot respond to the server out-of-band management command, it will immediately take over the above-mentioned receiving response authority to continue to respond to the command, thereby ensuring the quality of service.

[0177] Based on the above embodiment, another command processing method provided by this embodiment is introduced below. For easy understanding, please refer to Figure 2 , Figure 2 A flowchart of another command processing method provided by an embodiment of the present invention, the method is applied to a second operating system in a baseboard management controller, the baseboard management controller further includes a first operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the method may include:

[0178] S501. When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the first operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation; when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel.

[0179] In this step, when the baseboard management controller triggers the startup operation, it can trigger both the first operating system and the second operating system to perform the system initialization operation. In addition, during the startup process, the first operating system needs to establish an inter-core communication channel with the second operating system. The first operating system can determine whether the second operating system has completed initialization through the inter-core communication channel. For example, the first operating system can send an initialization status query request to the second operating system through the channel, and determine whether the second operating system has completed initialization based on the response of the second operating system; or the second operating system can actively send initialization completion information to the first operating system when initialization is completed, so that the latter can determine that the former has completed initialization.

[0180] S502: When it is determined that the initialization is completed, receive the receiving response right of the server out-of-band management command transferred by the first operating system.

[0181] In this step, when it is determined that the initialization is completed, the second operating system can perform the handover process of the server out-of-band management command receiving response right with the first operating system. As mentioned above, when responding to the command sent by the external device through the network, the above-mentioned receiving response right can include the network control right and the interface control right. In order to ensure that the existing task is not interrupted, that is, to ensure that the first operating system can continue to process the server out-of-band management command that it has received but has not completed processing, the above-mentioned network control right and the interface control right will be transferred from the first operating system to the second operating system in sequence, and the transfer order is to transfer the network control right first, and then transfer the interface control right after the network control right is completed. At the same time, when the network control right has been transferred and the interface control right has not been transferred, the first operating system can send the execution result of the server out-of-band management command to the second operating system, and the second operating system sends the execution result to the external device through the network card device. In addition, when the interface control right has been transferred, the first operating system can send the server out-of-band management command that has not been processed to the second operating system for continued processing. In this way, the smooth transition of the network control right and the interface control right can be achieved without interrupting the response to the server out-of-band management command.

[0182] Based on this, the receiving response right includes the network control right and the interface control right of the server out-of-band management command; the receiving response right of receiving the server out-of-band management command transferred by the first operating system may include:

[0183] Step 91: Receive the network control right and interface control right transferred by the first operating system in sequence, receive the execution result of the server out-of-band management command sent by the first operating system when the network control right has been transferred, and send it to the corresponding external device through the network, and receive the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continue to execute it.

[0184] Specifically, step 91 may include:

[0185] Step 1001: receiving the network control right transferred by the first operating system;

[0186] Step 1002: When the network control right is transferred, the execution result sent by the second operating system is received through the inter-core communication channel, and the execution result is sent to the external device through the network.

[0187] In steps 1001 and 1002, the first operating system may transfer the network control right to the second operating system. After the transfer is successful, the first operating system will not be able to control the network card device, that is, the first thread and the fourth thread in the first operating system will not work. To avoid response interruption, the first operating system may regard the second operating system as a network agent, and may send the execution result to the second operating system through the inter-core communication channel, so that the second operating system can send the execution result to the external device through the network.

[0188] Step 1003: receiving the interface control right transferred by the first operating system;

[0189] Step 1004: When the interface control right is transferred, unprocessed server out-of-band management commands sent by the first operating system are received through the inter-core communication channel, and the unprocessed server out-of-band management commands are continued to be executed.

[0190] In steps 1003 and 1004, the first operating system may transfer the interface control right to the second operating system. After the transfer is successful, the first operating system will not be able to continue to execute the server out-of-band management command. To avoid response interruption, the first operating system may regard the second operating system as an interface agent and send the server out-of-band management commands that have not been processed to the second operating system so that the latter can continue to execute these server out-of-band management commands.

[0191] S503: When the receiving response right completes receiving, receiving and responding to the server out-of-band management command.

[0192] In this step, after completing the receiving of the response right, the second operating system can continue to receive and respond to the server out-of-band management command according to the original process.

[0193] Based on the above embodiment, the above command processing method will be described in detail based on specific examples. This embodiment will be based on a specific operating system, and will elaborate on the method for the baseboard management controller to quickly respond to remote IPMI commands based on a real-time operating system from three aspects: system architecture, command processing flow, and receiving response right handover.

[0194] 1. IPMI system architecture:

[0195] Figure 3 The IPMI system architecture provided by the present invention is shown. The baseboard management controller includes a main processor (Processor) and a co-processor (Co-Processor). A complete Linux system (non-real-time operating system) runs on the main processor, and the system includes an IPMI daemon (IPMI Daemon), an IPMI driver, a network protocol stack and a Linux kernel. The Linux operating system can communicate with the BIOS system (Basic Input / Output System) through the KCS channel to process IPMI commands from the local. The Linux operating system can also communicate with the remote client through the NIC (Network Interface Card) to process remote IPMI commands from the network. A lightweight real-time operating system (RTOS) runs on the co-processor, and the system includes a lightweight IPMI Task (thread), TCP / IP and UDP / IP protocol stacks, and an RTOS kernel. The real-time operating system can usually complete startup within 5 seconds, and can also control the NIC and KCS channels. In the scenario where the host is powered on and turned on, it can quickly communicate with the BIOS and quickly respond to the IPMI request of the remote client. The logic MUX (multiplexer) implemented by software enables the control of the NIC and the IPMI command response rights (interface control rights) to be switched between the operating systems running on the main processor and the coprocessor. When Linux is started, the reception and response rights of the IPMI commands will be switched to the Linux system of the main processor, which will provide richer IPMI command processing capabilities. The entire design ensures that the baseboard management controller can respond to IPMI commands quickly after power-on, and continue to provide comprehensive management functions after the Linux system is fully started.

[0196] Both the real-time operating system and Linux should have the ability to receive and process local IPMI commands (KCS channel) and remote IPMI commands (NIC). The method provided by the present invention focuses on the design of the processing flow of remote IPMI commands.

[0197] 2. Real-time operating system IPMI command processing flow design:

[0198] Figure 4The IPMI processing flow on the real-time operating system side provided by the present invention is shown. After the system is powered on, the real-time operating system is first started, and the network initialization and IPMI initialization are immediately performed. These two steps ensure that the real-time operating system can quickly respond to IPMI requests from the remote end. At the same time, the real-time operating system will create an inter-core communication channel with the Linux system to receive its status signal after the Linux system is started. When the Linux system is started, the real-time operating system will begin to gradually hand over the IPMI receiving response right to Linux. First, the real-time operating system can hand over the network control right, and then enter the IPMI proxy stage, and then hand over the IPMI interface control right. The specific handover process will be described in detail in subsequent chapters. After the handover is completed, the real-time operating system will enter the abnormal monitoring state so that the real-time operating system can quickly obtain the control right of the network and IPMI when an abnormality occurs in Linux.

[0199] In the method proposed in the present invention, the real-time operating system will create four Task threads and two message queues for implementing the remote IPMI command response function, as shown in Table 1 and Table 2.

[0200] Table 1 Real-time operating system IPMI processing task thread

[0201]

[0202] Table 2 Real-time operating system IPMI message queue

[0203]

[0204] The above kcsSend is used to send the execution result of the IPMI command to the KCS interface. The specific workflow is not described in detail. In the Task thread running on the real-time operating system, the LANHANDLER and IPMIMSGHANDLER are responsible for the execution of IPMI commands. The interaction process is as follows: Figure 5 In this process, the RMCP+RAP protocol is first processed to create a session, and then the remote IPMI command is received and executed.

[0205] The execution process of remote IPMI commands is as follows: Figure 6As shown, the process is executed by LANHANDLER. First, determine whether gLanHandlerActive (the first thread activation flag) is 1. If so, continue to execute the process; if not, the process ends. Next, listen to the lanRecvMsgQ message queue (the first message queue). When data is received, it will determine whether the command is related to Session creation. If it is one of these commands, the system will directly execute the processing and return the data to lanSendMsgQ (the third message queue); if not, the data will be sent to the ipmiHandlerMsgQ message queue (the second message queue) for further processing by ipmiMsgHandler.

[0206] In the Task running on the real-time operating system, lanRecv is responsible for creating the Socket and receiving network data. The receiving process is as follows: Figure 7 As shown. First, check whether there is an activated IPMI remote command receiving socket. If not, end the process. If yes, use the FD_ISSET method to check whether there is a socket in the accept group (access group) in an acceptable state. When the socket is triggered, the socket will be accepted and added to the recv group (receiving group, also known as the receiving queue). Next, use FD_ISSET to detect whether the socket in the recv group has IPMI command data to receive. If the socket is detected to be triggered, it will try to receive data with the length of the data header from the socket (usually used to determine the size of the entire data packet). Then, determine whether the IPMI data header length is received successfully. If successful, continue to receive IPMI commands and determine whether the entire command has been received. Once the reception is completed, the command will be placed in the processing queue (lanIfCTaskMsgQ) for subsequent processing. If the socket is not triggered or the reception fails in any step, the system will enter the sleep state (sleep(1)) and then restart the detection.

[0207] In the Task running on the real-time operating system, LANSEND is responsible for sending the results of the IPMI command execution to the Socket. The process of sending the IPMI results is as follows: Figure 8 As shown. First, determine whether the global variable gLanSendActive (second thread activation flag) is 1. If it is, continue to execute subsequent operations; if not, destroy the thread. Next, the system will block the lanRecvMsgQ message queue (first message queue) and cancel the block after receiving the data, and send the data to the Socket through the Send interface. Finally, the process is repeated.

[0208] 3. IPMI control handover design:

[0209] In the method for the real-time operating system on the baseboard management controller to quickly respond to the remote IPMI command, the handover process of the IPMI control right from the real-time operating system to Linux is as follows: Fig. 9 As shown. After Linux is started, the system notifies the real-time operating system through inter-core communication. The real-time operating system begins to prepare to hand over IPMI control, suspends IPMI command reception and temporarily stores unfinished IPMI commands. Subsequently, the network control is handed over from the real-time operating system to Linux. Linux can receive new IPMI commands, but because it does not have the execution capability, it temporarily stores the received commands. The real-time operating system continues to complete the execution of IPMI commands and sends the execution results to Linux through inter-core communication, which is then sent to the network socket by Linux's network agent. After that, the real-time operating system hands over IPMI execution control to Linux. At this time, Linux has the authority to receive and execute IPMI commands and starts to execute the temporarily stored IPMI commands. The real-time operating system needs to continue to complete the execution of the remaining IPMI. Since the control has been transferred, the real-time operating system sends the commands to the Linux end through inter-core communication for IPMI proxy, and Linux completes the execution of these commands. When the real-time operating system completes the processing of all remaining IPMI commands, the entire handover process is completed, and Linux is responsible for receiving, executing and sending subsequent IPMI commands.

[0210] During the handover process, the control is gradually handed over, so that the transition of IPMI control from the real-time operating system to Linux can be completed without interrupting existing tasks.

[0211] The command processing device, baseboard management controller, server, computer program product, and computer-readable storage medium provided in the embodiments of the present invention are introduced below. The command processing device, baseboard management controller, server, computer program product, and computer-readable storage medium described below can be referenced to each other with the command processing method described above.

[0212] Please refer to Fig.10 , Fig.10 A structural block diagram of a command processing device provided in an embodiment of the present invention, the device is applied to a first operating system in a baseboard management controller, the baseboard management controller further includes a second operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the device includes:

[0213] Initialization module 1001, used for executing system initialization operation and establishing an inter-core communication channel with the second operating system when the baseboard management controller triggers a startup operation; the startup operation is used for triggering both the first operating system and the second operating system to execute the system initialization operation;

[0214] The command receiving and responding module 1002 is used to receive and respond to the server out-of-band management command when it is determined that the initialization is completed;

[0215] A determination module 1003 is used to determine whether the second operating system has completed initialization by using the inter-core communication channel;

[0216] The handover module 1004 is used to transfer the receiving and responding right of the server out-of-band management command to the second operating system when it is determined that the second operating system has completed initialization, so that the second operating system receives and responds to the server out-of-band management command.

[0217] Optionally, the command receiving and responding module 1002 may be used to:

[0218] A server out-of-band management command sent by an external device is received through a network, the server out-of-band management command is executed to obtain an execution result, and the execution result is sent to the external device through the network.

[0219] Optionally, the real-time operating system includes a first thread, a second thread, a third thread and a fourth thread; the command receiving response module 1002 may include:

[0220] A first thread module, configured to receive a request command by using the first thread through a connection socket interface with the external device, and send the request command to the second thread;

[0221] a second thread module, configured to determine the type of the request command by using the second thread, process the session establishment command to obtain session establishment response information when the request command is determined to be a session establishment command, and send the session establishment response information to the fourth thread, or send the server out-of-band management command to the third thread when the request command is determined to be the server out-of-band management command;

[0222] A third thread module, configured to use the third thread to execute the server out-of-band management command to obtain the execution result, and send the execution result to the fourth thread;

[0223] The fourth thread module is used to use the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface.

[0224] Optionally, the first thread module may also be used to:

[0225] Determining, using the first thread, whether the connection socket interface is triggered;

[0226] If the connection socket interface is triggered, a data header in a network data packet sent by the external device is received through the connection socket interface, and it is determined whether the data header is received successfully;

[0227] If the data header is received successfully, continue to receive the request command in the network data packet through the connection socket interface, and determine whether the request command is received successfully;

[0228] If the request command is received successfully, the request command is sent to the second thread.

[0229] Optionally, the first thread module may also be used to:

[0230] Determining, by using the first thread, whether a listening socket interface for receiving the out-of-band management command of the server is activated;

[0231] If the listening socket interface is activated, determining whether the listening socket interface is triggered by the external device;

[0232] If the listening socket interface is triggered by the external device, the listening socket interface is set to an accepting state, and a connecting socket interface corresponding to the external device is created.

[0233] Optionally, the first thread module may also be used to:

[0234] The request command is sent to the second thread via a message queue using the first thread.

[0235] Optionally, the first thread module may also be used to:

[0236] Determining a value of a first thread activation flag using the first thread;

[0237] If the first thread activation flag is a first value, entering a step of using the first thread to receive a request command through a connection socket interface between the first thread and the external device;

[0238] If the activation flag of the first thread is a second value, destroying the first thread;

[0239] The fourth thread module may also be used for:

[0240] Determine the value of the second thread activation flag using the fourth thread;

[0241] If the second thread activation flag is the first value, entering the step of using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface;

[0242] If the second thread activation flag is a second value, the fourth thread is destroyed.

[0243] Optionally, the receiving response right includes network control right and interface control right of the server out-of-band management command; the handover module 1004 may be used to:

[0244] The network control right and the interface control right are transferred to the second operating system in sequence, and when the network control right is transferred, the execution result is sent to the external device through the second operating system, and when the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system.

[0245] Optionally, the handover module 1004 may include:

[0246] A handover initialization submodule, used to stop receiving the server out-of-band management command, cache the unprocessed server out-of-band management command, and continue to execute the unprocessed server out-of-band management command;

[0247] A first handover submodule, used for handing over the network control right to the second operating system;

[0248] a forwarding submodule, configured to send the execution result to the second operating system through the inter-core communication channel when the network control right is transferred, so that the second operating system sends the execution result to the external device through the network;

[0249] A second handover submodule, used for handing over the interface control right to the second operating system;

[0250] The command handover submodule is used to send the unprocessed server out-of-band management commands to the second operating system through the inter-core communication channel when the interface control right is handed over.

[0251] Optionally, the command receiving and responding module 1002 may be used to:

[0252] A locally input server out-of-band management command is received through a serial communication interface, the server out-of-band management command is executed to obtain an execution result, and the execution result is output through the serial communication interface.

[0253] Optionally, the device may further include:

[0254] an anomaly detection module, used to detect whether the second operating system encounters an anomaly by using the inter-core communication channel;

[0255] The takeover module is used to take over the right to receive and respond to the out-of-band management command of the server when it is determined that the second operating system encounters an exception.

[0256] Please refer to Fig.11 , Fig.11 This is a structural block diagram of another command processing device provided by an embodiment of the present invention, the device is applied to a second operating system in a baseboard management controller, the baseboard management controller further includes a first operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the device includes:

[0257] The initialization module 1101 is used to perform a system initialization operation and establish an inter-core communication channel with the first operating system when the baseboard management controller triggers a startup operation; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation; when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel;

[0258] The handover module 1102 is used to receive the receiving response right of the server out-of-band management command handed over by the first operating system when determining that the initialization is completed;

[0259] The command receiving and responding module 1103 is used to receive and respond to the server out-of-band management command when the receiving response right completes receiving.

[0260] Optionally, the receiving response right includes network control right and interface control right of the server out-of-band management command; the handover module 1102 may be used to:

[0261] Receive the network control right and interface control right transferred by the first operating system in sequence, receive the execution result of the server out-of-band management command sent by the first operating system when the network control right is transferred, and send it to the corresponding external device through the network, and receive the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continue to execute it.

[0262] Optionally, the handover module 1102 may include:

[0263] A first handover submodule, configured to receive the network control right handed over by the first operating system;

[0264] a network proxy submodule, configured to receive the execution result sent by the second operating system through the inter-core communication channel when the network control right is transferred, and send the execution result to the external device through the network;

[0265] A second handover submodule, configured to receive the interface control right handed over by the first operating system;

[0266] The command handover submodule is used to receive the unprocessed server out-of-band management command sent by the first operating system through the inter-core communication channel when the interface control right is completed to be handed over, and continue to execute the unprocessed server out-of-band management command.

[0267] Please refer to Fig.12 , Fig.12 This is a structural block diagram of a baseboard management controller provided in an embodiment of the present invention. The embodiment of the present invention provides a baseboard management controller 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store an operating system program of a first operating system and an operating system program of a second operating system; the processor 11 is used to execute a command processing method applied to the first operating system when loading the operating system program of the first operating system, or to execute a command processing method applied to the second operating system when loading the operating system program of the second operating system.

[0268] For the specific process of the above command processing method, please refer to the corresponding content provided in the above embodiments, which will not be repeated here.

[0269] In addition, the processor 11 may further include a main processor and a coprocessor, wherein the main processor runs the second operating system, and the coprocessor runs the first operating system.

[0270] In addition, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0271] In addition, the baseboard management controller 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide working voltage for each hardware device on the baseboard management controller 10; the communication interface 14 can create a data transmission channel between the baseboard management controller 10 and external devices, and can be a network port, a serial communication interface, etc. The communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0272] An embodiment of the present invention further provides a server, comprising the baseboard management controller as described above.

[0273] Since the embodiments of the server part correspond to the embodiments of the command processing method part, please refer to the above description for the embodiments of the server part and will not be repeated here.

[0274] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the command processing method described in the above embodiment is implemented.

[0275] Since the embodiments of the computer program product part correspond to the embodiments of the command processing method part, please refer to the description of the embodiments of the command processing method part for the embodiments of the computer program product part, and will not be repeated here.

[0276] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the command processing method described in the above embodiment is implemented.

[0277] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the command processing method part, please refer to the description of the embodiments of the command processing method part for the embodiments of the storage medium part, which will not be repeated here.

[0278] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0279] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0280] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0281] The command processing method, device, baseboard management controller, server, computer program product, and computer-readable storage medium provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A command processing method, characterized in that: A first operating system is applied to a baseboard management controller, the baseboard management controller further includes a second operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the method includes: When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the second operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation; When determining that it has completed initialization, it receives and responds to the server out-of-band management command; Determining whether the second operating system has completed initialization by using the inter-core communication channel; When it is determined that the second operating system has completed initialization, the right to receive and respond to the server out-of-band management command is transferred to the second operating system, so that the second operating system receives and responds to the server out-of-band management command.

2. The command processing method according to claim 1, characterized in that: Receive and respond to server out-of-band management commands, including: A server out-of-band management command sent by an external device is received through a network, the server out-of-band management command is executed to obtain an execution result, and the execution result is sent to the external device through the network.

3. The command processing method according to claim 2, characterized in that: The real-time operating system includes a first thread, a second thread, a third thread and a fourth thread; Receiving a server out-of-band management command sent by an external device through a network, executing the server out-of-band management command to obtain an execution result, and sending the execution result to the external device through the network, including: Using the first thread to receive a request command through a connection socket interface between the first thread and the external device, and sending the request command to the second thread; Determine the type of the request command by using the second thread, process the session establishment command to obtain session establishment response information when the request command is determined to be a session establishment command, and send the session establishment response information to the fourth thread, or send the server out-of-band management command to the third thread when the request command is determined to be the server out-of-band management command; Utilizing the third thread to execute the server out-of-band management command to obtain the execution result, and sending the execution result to the fourth thread; The session establishment response information or the execution result is sent to the external device via the connection socket interface using the fourth thread.

4. The command processing method according to claim 3, characterized in that: Utilizing the first thread to receive a request command through a connection socket interface between the first thread and the external device, and sending the request command to the second thread, comprising: Determining, using the first thread, whether the connection socket interface is triggered; If the connection socket interface is triggered, a data header in a network data packet sent by the external device is received through the connection socket interface, and it is determined whether the data header is received successfully; If the data header is received successfully, continue to receive the request command in the network data packet through the connection socket interface, and determine whether the request command is received successfully; If the request command is received successfully, the request command is sent to the second thread.

5. The command processing method according to claim 4, characterized in that: Before using the first thread to determine whether the connection socket interface is triggered, the method further includes: Determining, by using the first thread, whether a listening socket interface for receiving the out-of-band management command of the server is activated; If the listening socket interface is activated, determining whether the listening socket interface is triggered by the external device; If the listening socket interface is triggered by the external device, the listening socket interface is set to an accepting state, and a connecting socket interface corresponding to the external device is created.

6. The command processing method according to claim 3, characterized in that: Sending the request command to the second thread includes: The request command is sent to the second thread via a message queue using the first thread.

7. The command processing method according to claim 3, characterized in that: Before using the first thread to receive a request command through the connection socket interface between the external device, the method further includes: Determining a value of a first thread activation flag using the first thread; If the first thread activation flag is a first value, entering a step of using the first thread to receive a request command through a connection socket interface between the first thread and the external device; If the activation flag of the first thread is a second value, destroying the first thread; Before using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface, the method further includes: Determine the value of the second thread activation flag using the fourth thread; If the second thread activation flag is the first value, entering the step of using the fourth thread to send the session establishment response information or the execution result to the external device through the connection socket interface; If the second thread activation flag is a second value, the fourth thread is destroyed.

8. The command processing method according to any one of claims 2 to 7, characterized in that: The receiving response right includes the network control right and the interface control right of the server out-of-band management command; Transferring the receiving response right of the server out-of-band management command to the second operating system includes: The network control right and the interface control right are transferred to the second operating system in sequence, and when the network control right is transferred, the execution result is sent to the external device through the second operating system, and when the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system.

9. The command processing method according to claim 8, characterized in that: The method comprises: transferring the network control right and the interface control right to the second operating system in sequence; sending the execution result to the external device through the second operating system when the network control right is transferred; and sending the unexecuted server out-of-band management command to the second operating system when the interface control right is transferred, including: Stop receiving the server out-of-band management command, cache the unprocessed server out-of-band management command, and continue to execute the unprocessed server out-of-band management command; transferring the network control right to the second operating system; When the network control right is transferred, the execution result is sent to the second operating system through the inter-core communication channel, so that the second operating system sends the execution result to the external device through the network; Handing over the interface control right to the second operating system; When the interface control right is transferred, the unprocessed server out-of-band management command is sent to the second operating system through the inter-core communication channel.

10. The command processing method according to claim 1, characterized in that: Receive and respond to server out-of-band management commands, including: A locally input server out-of-band management command is received through a serial communication interface, the server out-of-band management command is executed to obtain an execution result, and the execution result is output through the serial communication interface.

11. The command processing method according to claim 1, characterized in that: After transferring the receiving response right of the server out-of-band management command to the second operating system, the method further includes: Detecting whether the second operating system encounters an abnormality by using the inter-core communication channel; When it is determined that the second operating system encounters an exception, taking over the right to receive and respond to the out-of-band management command of the server.

12. A command processing method, characterized in that: A second operating system is applied to a baseboard management controller, the baseboard management controller further includes a first operating system, the response speed of the first operating system is higher than the response speed of the second operating system, the method includes: When the baseboard management controller triggers a startup operation, a system initialization operation is performed, and an inter-core communication channel is established with the first operating system; the startup operation is used to trigger both the first operating system and the second operating system to perform the system initialization operation; when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel; When determining that the initialization is completed, receiving the receiving response right of the server out-of-band management command transferred by the first operating system; When the receiving response right completes receiving, the server out-of-band management command is received and responded to.

13. The command processing method according to claim 12, characterized in that: The receiving response right includes the network control right and the interface control right of the server out-of-band management command; Receiving the receiving response right of the server out-of-band management command transferred by the first operating system includes: Receive the network control right and interface control right transferred by the first operating system in sequence, receive the execution result of the server out-of-band management command sent by the first operating system when the network control right is transferred, and send it to the corresponding external device through the network, and receive the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continue to execute it.

14. The command processing method according to claim 13, characterized in that: The method includes sequentially receiving the network control right and the interface control right transferred by the first operating system, receiving the execution result of the server out-of-band management command sent by the first operating system when the network control right is transferred, and sending the result to the external device through the network, and receiving the unprocessed server out-of-band management command sent by the first operating system at the interface control right and continuing to execute the command, including: receiving the network control right transferred by the first operating system; When the network control right is transferred, receiving the execution result sent by the second operating system through the inter-core communication channel, and sending the execution result to the external device through the network; receiving the interface control right transferred by the first operating system; When the interface control right is transferred, the unprocessed server out-of-band management command sent by the first operating system is received through the inter-core communication channel, and the unprocessed server out-of-band management command continues to be executed.

15. A command processing device, characterized in that: A first operating system applied to a baseboard management controller, the baseboard management controller further comprising a second operating system, the response speed of the first operating system being higher than the response speed of the second operating system, the device comprising: an initialization module, configured to execute a system initialization operation and establish an inter-core communication channel with the second operating system when the baseboard management controller triggers a startup operation; the startup operation is configured to trigger both the first operating system and the second operating system to execute the system initialization operation; A command receiving and responding module is used to receive and respond to the server out-of-band management command when it is determined that the initialization is completed; A determination module, configured to determine whether the second operating system has completed initialization by using the inter-core communication channel; The handover module is used to transfer the receiving and responding right of the server out-of-band management command to the second operating system when it is determined that the second operating system has completed initialization, so that the second operating system receives and responds to the server out-of-band management command.

16. A command processing device, characterized in that: A second operating system applied to a baseboard management controller, the baseboard management controller further comprising a first operating system, the response speed of the first operating system being higher than the response speed of the second operating system, the device comprising: an initialization module, configured to execute a system initialization operation and establish an inter-core communication channel with the first operating system when the baseboard management controller triggers a startup operation; the startup operation is configured to trigger both the first operating system and the second operating system to execute the system initialization operation; when the first operating system determines that it has completed initialization, it receives and responds to the server out-of-band management command, and determines whether the second operating system has completed initialization through the inter-core communication channel; A handover module, configured to receive a receiving response right of the server out-of-band management command handed over by the first operating system when determining that the initialization of the server is completed; The command receiving and responding module is used to receive and respond to the server out-of-band management command when the receiving response right completes receiving.

17. A baseboard management controller, characterized in that: include: A memory for storing an operating system program of the first operating system and an operating system program of the second operating system; A processor, configured to execute the command processing method described in any one of claims 1 to 11 when loading the operating system program of the first operating system, or to execute the command processing method described in any one of claims 12 to 14 when loading the operating system program of the second operating system.

18. The baseboard management controller according to claim 17, characterized in that: The processor includes a main processor and a coprocessor, the main processor runs the second operating system, and the coprocessor runs the first operating system.

19. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the command processing method according to any one of claims 1 to 11 or the command processing method according to any one of claims 12 to 14 is implemented.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the command processing method described in any one of claims 1 to 11 or the command processing method described in any one of claims 12 to 14 is implemented.

Citation Information

Patent Citations

  • Massive and real-time tachograph data collection method and system

    CN106530438A

  • LoRa core network system and realization method

    CN106789259A

  • Design method of network communication framework

    CN108768717A

  • Camera system multi-thread control method and device, server and storage medium

    CN112188090A

  • Operating system detection method and device

    CN112463545A

Cited By

  • Server monitoring system, method, device, equipment, medium and product

    CN119847877A

  • BMC optimization method and system of AI server, electronic equipment and storage medium

    CN121029256A

  • Command processing method and apparatus, baseboard management controller, program product, and medium

    WO2026113204A1

  • Server monitoring system, method and apparatus, and device, medium and product

    WO2026194061A1