A channel control method, controller, computer device and storage medium
By determining and closing the preset KCS channel in the substrate management controller, the problem of closing the preset KCS channel in the prior art affecting the use of other channels is solved, and the preset KCS channel is kept in the off state when the host system is restarted or restored to the factory. , enhances network security.
Patent Information
- Application Number
- CN202411182291.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-27
AI Technical Summary
When closing the preset KCS channel, it is necessary to close the OS access all channels used by the BMC, which affects the use of other KCS channels except the preset KCS channel, and it is not possible to ensure that the preset is done when the host system is restarted or restored to the factory. The KCS channel is closed, which poses a safety hazard.
By receiving the instruction to close the preset KCS channel in the substrate management controller, obtaining the attribute value of the host system and the channel closing information in the memory, determining the preset KCS channel, and closing the preset KCS channel through the channel closing information and the control process. Avoid affecting the use of other KCS channels and keep the preset KCS channels off when restarting or factory reset.
It realizes that the use of other KCS channels does not affect the use of other KCS channels when closing the preset KCS channel, ensures that the host system can transmit information normally during the power-on self-test, avoids the problem of shutting down all channels caused by the inability to determine the preset KCS channel, and in Keeping the preset KCS channel off when restarting or resuming the factory enhances network security.
Smart Images

Figure CN118708506B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a channel control method, a controller, a computer device and a storage medium. Background Art
[0002] The Keyboard Controller Style (KCS) interface is a protocol for communicating with a keyboard controller. This interface is usually used for communication between the system management controller and the keyboard controller for low-level keyboard control and status query. However, in modern server environments, the KCS interface can also be reused as a low-speed, simple, bidirectional serial interface for Intelligent Platform Management Interface (IPMI) data exchange between the Baseboard Management Controller (BMC) and the Operating System (OS). It is a mechanism for OpenBMC to implement IPMI communication.
[0003] OS uses multiple KCS channels to access BMC, and each KCS channel has different functions. Among the multiple KCS channels, there is a KCS channel used for communication between the in-band OS and BMC, which is also called the preset KCS channel. To ensure data security, you can close the preset KCS channel, and then close the communication channel between the in-band OS and BMC, to prevent network attacks from obtaining or setting BMC information through the preset KCS channel, affecting the out-of-band management system, and causing security risks.
[0004] In the related art, the preset KCS channel can be closed through the ipmi command. However, this method requires closing all channels used by the OS to access the BMC, which will affect the use of other KCS channels except the preset KCS channel. Summary of the invention
[0005] In view of this, the present invention provides a channel control method to solve the problem that all channels used by the OS to access the BMC are closed in order to close the preset KCS channel, which affects the use of other KCS channels except the preset KCS channel.
[0006] In a first aspect, the present invention provides a channel control method, which is applied to a baseboard management controller, wherein there are multiple KCS channels between a host system and the baseboard management controller, and the method comprises: when receiving an instruction to close a preset KCS channel and a control process is started, obtaining an attribute value of the host system at the current moment, and obtaining channel closing information stored in a memory of the baseboard management controller, wherein the attribute value is used to indicate whether the host system has completed a power-on self-test process; if the attribute value is a first attribute value, determining a preset KCS channel from multiple KCS channels, and the first attribute value indicates that the host system has completed a power-on self-test process; and closing the preset KCS channel through the channel closing information and the control process.
[0007] Based on the method provided in the first aspect above, when an instruction to close a preset KCS channel is received and the control process is started, the attribute value of the host system at the current moment can be obtained, and the channel closing information stored in the memory of the baseboard management controller can be obtained; if the attribute value is the first attribute value, the preset KCS channel is determined from multiple KCS channels, and the preset KCS channel is closed through the channel closing information and the control process.
[0008] Among them, when the instruction to close the preset KCS channel is received and the control process is started, the attribute value of the host system at the current moment is the first attribute value, which indicates that the host system has completed the power-on self-test process at the current moment. Because the host system needs to transmit information through the preset KCS channel during the power-on self-test process, after the host system has completed the power-on self-test process, the preset KCS channel is closed through channel closing information and the control process. This can avoid the problem that the host system cannot transmit information to the baseboard management controller through the preset KCS channel during the power-on self-test process, making the host system unable to power on. In addition, since the preset KCS channel can be determined, it is possible to avoid closing all channels used by the OS to access the BMC in order to close the preset KCS channel, which affects the use of other KCS channels except the preset KCS channel.
[0009] In an optional embodiment, if the attribute value is a second attribute value, the attribute value of the host system is monitored within a preset time, and the second attribute value is used to indicate that the host system has not completed the power-on self-test process; if the attribute value changes from the second attribute value to the first attribute value within the preset time, a preset KCS channel is determined from multiple KCS channels, and the preset KCS channel is closed through channel closing information and control process; if the attribute value is the second attribute value within the preset time, the control process is closed.
[0010] Based on the above method, when the host system has not completed the power-on self-test process, the property value of the host system can be monitored within a preset time. After the host system completes the power-on self-test process, the preset KCS channel can be closed through channel closing information and control process, thereby avoiding the problem that the host system cannot transmit information to the baseboard management controller through the preset KCS channel during the power-on self-test process of the host system, causing the host system to be unable to power on.
[0011] In an optional implementation, a preset KCS channel corresponds to a preset channel identifier; if the attribute value is a first attribute value, determining the preset KCS channel from multiple KCS channels, including: if the attribute value is the first attribute value, receiving channel parameters of each KCS channel in the multiple KCS channels, the channel parameters including the channel identifier of each KCS channel; based on the channel parameters, from multiple KCS channels, screening a KCS channel whose channel identifier is the preset channel identifier to determine it as the preset KCS channel.
[0012] Based on the above method, the preset KCS channel can be determined from multiple KCS channels to avoid the situation where all KCS channels are closed due to failure to determine the preset KCS channel.
[0013] In an optional embodiment, the preset KCS channel is closed through channel closing information and the control process, including: when the control process determines that the storage information of the memory is channel closing information, executing the closing method of the service manager to close the preset channel process to close the preset KCS channel, the preset channel process is the process corresponding to the preset KCS channel.
[0014] Based on the above method, when the storage information of the memory is channel closing information, the preset channel process can be closed through the method of the service manager, thereby closing the preset KCS channel.
[0015] In an optional embodiment, the type of the control process is a non-daemon type. Before the control process is started, the method also includes: receiving an instruction to close a preset KCS channel, and storing the channel closing information carried by the instruction to close the preset KCS channel in a memory; restarting the baseboard management controller to obtain the storage information in the memory; if the storage information is channel closing information, starting the control process.
[0016] Based on the above method, when the type of the control process is a non-daemon type, the command to close the preset KCS channel requires the baseboard management controller to be restarted to take effect.
[0017] In an optional embodiment, the type of the control process is a non-daemon process type, and the method also includes: when receiving an instruction to open a preset KCS channel, obtaining channel opening information stored in a memory; restarting the baseboard management controller to determine the preset KCS channel from multiple KCS channels; based on the channel opening information, executing the opening method of the service manager to open the preset channel process to open the preset KCS channel.
[0018] Based on the above method, when the control process type is a non-daemon process type, the command to open the preset KCS channel requires the baseboard management controller to be restarted before it can take effect. In addition, since the preset KCS channel can be determined, it is possible to avoid opening all channels used by the OS to access the BMC in order to open the preset KCS channel, which affects the use of other KCS channels except the preset KCS channel.
[0019] In an optional embodiment, the type of the control process is a daemon process type, and the method also includes: when receiving an instruction to open a preset KCS channel, obtaining channel opening information stored in a memory; determining a preset KCS channel from multiple KCS channels; based on the channel opening information, executing an opening method of the service manager to open the preset channel process to open the preset KCS channel.
[0020] Based on the above method, when the type of the control process is a daemon process type, the command to open the preset KCS channel can take effect immediately.
[0021] In an optional embodiment, the method also includes: if the attribute value is the first attribute value, determining other KCS channels other than the preset KCS channel from multiple KCS channels; executing the opening method of the service manager to open each channel process in the other channel processes to open other KCS channels, and the other channel processes are channel processes corresponding to other KCS channels.
[0022] Based on the above method, other KCS channels other than the preset KCS channel can be determined from multiple KCS channels. Since other KCS channels are enabled by default, the enabling method of the service manager can be executed to enable each channel process in other channel processes to enable other KCS channels.
[0023] In an optional embodiment, after closing the preset KCS channel through channel closing information and control process, the method also includes: restarting the baseboard management controller to obtain storage information in the memory; if the storage information is channel closing information, keeping the preset KCS channel in a closed state.
[0024] Based on the above method, since the channel closing information is stored in the memory, after closing the preset KCS channel, when the baseboard management controller is restarted or the baseboard management controller is restored to factory, the information stored in the memory can be obtained as the channel closing information, that is, the preset channel process is not allowed to start, and then during the entire process of restarting or restoring the baseboard management controller to factory, the preset KCS channel is kept in a closed state, ensuring that the baseboard management controller will not be attacked by hackers or viruses through the preset KCS channel during the restart process.
[0025] In an optional embodiment, when the host system restarts, status information of a preset KCS channel is obtained, and the status information is used to indicate whether the preset KCS channel is in a closed state; if the preset KCS channel is not in a closed state, the preset KCS channel is kept in an open state; if the KCS channel is in a closed state, an opening method of the service manager is executed to open the preset channel process to open the preset KCS channel; the attribute value of the host system is monitored; when the attribute value is a first attribute value, a closing method of the service manager is executed to close the preset channel process to close the preset KCS channel.
[0026] Based on the above method, since the host system needs to perform a power-on self-test when it is restarted, and during the power-on self-test process, it is necessary to transmit management information to the baseboard management controller through the preset KCS channel to complete the boot, therefore, when restarting the host system, it is possible to first determine whether the preset KCS channel is in a closed state. If the preset KCS channel is in an open state, keep the preset KCS channel in an open state; if the preset KCS channel is in a closed state, turn on the preset KCS channel. In order to avoid network security risks and attack the baseboard management controller through the preset KCS channel, it is necessary to continuously monitor the attribute value of the host system and close the preset KCS channel when the attribute value is the first attribute value, that is, after the host system completes the power-on self-test process.
[0027] In an optional implementation, the method further includes: when the host system is in a shutdown state and the preset KCS channel is not in a closed state, keeping the preset KCS channel in an open state.
[0028] Based on the above method, when the host system is in the shutdown state, even if the preset KCS channel is in the open state, there is no network security risk, and the virus cannot attack the baseboard management controller through the preset KCS channel from the host system. Therefore, the KCS channel can be kept in the open state.
[0029] In a second aspect, the present invention provides a baseboard management controller, wherein there are multiple KCS channels between a host system and the baseboard management controller, and the baseboard management controller comprises: an acquisition module, for acquiring an attribute value of the host system at the current moment when an instruction to close a preset KCS channel is received and a control process is started, and acquiring channel closing information stored in a memory of the baseboard management controller, wherein the attribute value is used to indicate whether the host system has completed a power-on self-test process; a processing module, for determining a preset KCS channel from multiple KCS channels if the attribute value is a first attribute value, wherein the first attribute value indicates that the host system has completed the power-on self-test process; the processing module is also used to close the preset KCS channel through the channel closing information and the control process.
[0030] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the channel control method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the channel control method of the first aspect or any corresponding embodiment thereof.
[0032] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the channel control method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 is a flow chart of a method for controlling a channel according to an embodiment of the present invention;
[0035] Figure 2 is a flow chart of another channel control method according to an embodiment of the present invention;
[0036] Figure 3 is a structural block diagram of a baseboard management controller according to an embodiment of the present invention;
[0037] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0039] As described in the background technology, the preset KCS channel is closed through the ipmi command. The preset KCS channel is the in-band OS access to the BMC path. However, this method requires closing all channels used by the OS to access the BMC, which will affect the use of other KCS channels except the preset KCS channel. And during the process of restarting the BMC or restoring the BMC to factory settings, this method cannot ensure that the preset KCS channel is closed during this process. It needs to be closed after the BMC is started, which will cause security risks in this process.
[0040] In addition, closing and opening the preset KCS channel through the ipmi command takes effect immediately, regardless of whether the host system has completed the power-on self-test process (i.e., whether the BIOS has completed the POST process). The preset KCS channel is required during the BIOS POST process for interaction between the OS and the BMC. If the preset KCS channel is closed before the BIOS completes the POST process, some information will not be passed to the BMC by the BIOS. This method requires a dead loop to continuously monitor whether there is a flag file that closes the preset KCS channel in a certain directory to open / close the in-band OS access to the BMC path. This continuous monitoring method will waste the performance of the BMC.
[0041] In order to solve the above technical problems, an embodiment of the present invention provides a channel control method, which can solve the problem that in order to close the preset KCS channel, all channels used by the OS to access the BMC are closed, which affects the use of other KCS channels except the preset KCS channel.
[0042] In the embodiment of the present invention, the channel control method may be executed by a baseboard management controller.
[0043] According to an embodiment of the present invention, a channel control method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] In this embodiment, a channel control method is provided, which can be used for a baseboard management controller. There are multiple KCS channels between the host system and the baseboard management controller. Figure 1 is a flow chart of a method for controlling a channel according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0045] S101: When receiving an instruction to close a preset KCS channel and the control process is started, obtaining the property value of the host system at the current moment, and obtaining the channel closing information stored in the memory of the baseboard management controller.
[0046] The command for closing the preset KCS channel is an ipmi command set by the user through the ipmitool tool.
[0047] In an embodiment of the present invention, the control process is also referred to as a kcs-control process. The control process is used to control the opening and closing of a preset KCS channel. Among them, the types of control processes are divided into non-daemon types and daemon types. For a non-daemon type control process, the command to close the preset KCS channel can take effect only after the BMC is restarted. For a daemon type control process, the command to close the preset KCS channel can take effect immediately.
[0048] In the embodiment of the present invention, the preset KCS channel may be a KCS3 channel. It can be understood that the KCS3 channel is the only path for the in-band OS to access the BMC.
[0049] In the embodiment of the present invention, the attribute value is also referred to as the OsState attribute. The attribute value is used to indicate whether the host system has completed the power-on self-test process. Among them, whether the host system has completed the power-on self-test process can also be referred to as whether the BIOS has completed the POST process.
[0050] The attribute value may be a first attribute value or a second attribute value. The first attribute value is Standby. The first attribute value indicates that the host system has completed the power-on self-test process. The second attribute value is Inactive. The second attribute value indicates that the host system has not completed the power-on self-test process.
[0051] In the embodiment of the present invention, the memory of the baseboard management controller may be an electrically erasable programmable read only memory (EEPROM).
[0052] In the embodiment of the present invention, the channel closing information is a value for setting the channel closing.
[0053] Exemplarily, when the BMC receives an instruction to close a preset KCS channel and the control process starts, the OsState attribute of the host system is monitored through the C++ match method to obtain the attribute value of the host system at the current moment, and obtain the stored value of setting the channel to be closed from the BMC's EEPROM.
[0054] In some optional embodiments, if the type of the control process is a non-daemon type, the BMC receives an instruction to close the preset KCS channel before starting the control process, and stores the channel closing information carried by the instruction to close the preset KCS channel in the memory; restarts the baseboard management controller to obtain the storage information in the memory; if the storage information is channel closing information, starts the control process.
[0055] In one example, the service file (kcsControl.service) corresponding to the kcs-control process is used to start or shut down the process.
[0056] Among them, an ExecCondition (prerequisite) can be added to the service file (kcsControl.service). ExecCondition can only return 0 and non-zero numbers. The value of ExecCondition is assigned to kcsControlCanStart. When kcsControlCanStart is 0, the action of starting the kcs-control process is executed. When kcsControlCanStart is non-0, the action of starting the kcs-control process is not executed.
[0057] It can be understood that if the type of the control process is a daemon process type, the control process can be started directly.
[0058] S102: If the attribute value is the first attribute value, determining a preset KCS channel from a plurality of KCS channels.
[0059] In the embodiment of the present invention, the preset KCS channel corresponds to the preset channel identifier. The preset KCS channel corresponds to the preset channel process.
[0060] It can be understood that in OpenBMC, each KCS channel will generate a corresponding KCS message receiving and processing process (referred to as channel process). Disabling the corresponding process will also close the corresponding KCS channel. Therefore, closing the in-band OS access to the BMC path is to disable the process corresponding to the KCS3 channel, and vice versa.
[0061] In some optional implementations, if the attribute value is the first attribute value, the BMC receives channel parameters of each KCS channel in multiple KCS channels; based on the channel parameters, from the multiple KCS channels, a KCS channel whose channel identifier is a preset channel identifier is screened and determined as the preset KCS channel.
[0062] The channel parameters include the channel identifier of each KCS channel.
[0063] It is understandable that the BMC may also determine other KCS channels except the preset KCS channel from the multiple KCS channels.
[0064] In one example, if the attribute value is the first attribute value, the BMC determines other KCS channels except the preset KCS channel from multiple KCS channels; executes the opening method of the service manager to open each channel process in the other channel processes to open other KCS channels, and the other channel processes are channel processes corresponding to other KCS channels.
[0065] S103: Close the preset KCS channel through channel closing information and control process.
[0066] In some optional implementations, when the control process determines that the storage information of the memory is channel closing information, the BMC executes the closing method of the service manager to close the preset channel process, so as to close the preset KCS channel.
[0067] Exemplarily, when the control process determines that the storage information of the memory is channel closing information, the BMC executes the shutdown StopUnit method of the service manager systemd to close the KCS3 process to close the KCS3 channel.
[0068] Optionally, if the attribute value is the first attribute value, the BMC determines other KCS channels except the preset KCS channel from multiple KCS channels; executes the opening method of the service manager to open each channel process in the other channel processes to open other KCS channels.
[0069] Among them, other channel processes are channel processes corresponding to other KCS channels.
[0070] In one example, each channel process has a corresponding service file, and the process is started or closed through the service file, thereby controlling whether the KCS channel is open.
[0071] Among them, an ExecCondition (prerequisite) can be added to the service file (kcsBridge.service). ExecCondition can only return 0 and non-zero numbers. The value of ExecCondition is kcsBridgeCanStart. When kcsBridgeCanStart is 0, the action of starting the KCS channel process is executed. When kcsBridgeCanStart is non-0, the action of starting the KCS channel process is not executed.
[0072] Exemplarily, if the attribute value is the first attribute value, the BMC determines other KCS channels except the preset KCS channel from multiple KCS channels; obtains the service file corresponding to the channel process corresponding to each channel in the other KCS channels, and if the kcsBridgeCanStart in the service file is 0, executes the StartUnit method of systemd to start each channel process in the other channel processes to start other KCS channels.
[0073] Optionally, if the attribute value is the second attribute value, the BMC monitors the attribute value of the host system within a preset time; if the attribute value changes from the second attribute value to the first attribute value within the preset time, a preset KCS channel is determined from multiple KCS channels, and the preset KCS channel is closed through channel closing information and control process; if the attribute value is the second attribute value within the preset time, the control process is closed.
[0074] The preset time period can be set according to actual needs without restriction.
[0075] In some optional embodiments, if the type of the control process is a daemon process type, when the BMC receives an instruction to open a preset KCS channel, it obtains the channel opening information stored in the memory; restarts the baseboard management controller, and determines the preset KCS channel from multiple KCS channels; based on the channel opening information, executes the opening method of the service manager to open the preset channel process to open the preset KCS channel.
[0076] The channel opening information is the value for setting the channel opening.
[0077] In some optional implementations, if the type of the control process is a daemon type, when the BMC receives an instruction to open a preset KCS channel, it obtains the channel opening information stored in the memory; determines the preset KCS channel from multiple KCS channels; and based on the channel opening information, executes the opening method of the service manager to open the preset channel process to open the preset KCS channel.
[0078] Based on the above methods S101 to S103, when the BMC receives an instruction to close a preset KCS channel and the control process is started, it can obtain the attribute value of the host system at the current moment and the channel closing information stored in the memory of the baseboard management controller; if the attribute value is the first attribute value, the preset KCS channel is determined from multiple KCS channels, and the preset KCS channel is closed through the channel closing information and the control process.
[0079] Among them, when the instruction to close the preset KCS channel is received and the control process is started, the attribute value of the host system at the current moment is the first attribute value, which indicates that the host system has completed the power-on self-test process at the current moment. Because the host system needs to transmit information through the preset KCS channel during the power-on self-test process, after the host system has completed the power-on self-test process, the preset KCS channel is closed through channel closing information and the control process. This can avoid the problem that the host system cannot transmit information to the baseboard management controller through the preset KCS channel during the power-on self-test process, making the host system unable to power on. In addition, since the preset KCS channel can be determined, it is possible to avoid closing all channels used by the OS to access the BMC in order to close the preset KCS channel, which affects the use of other KCS channels except the preset KCS channel.
[0080] Furthermore, after the BMC closes the preset KCS channel through the channel closing information and the control process, the BMC may also restart the baseboard management controller to obtain the storage information in the memory; if the storage information is the channel closing information, the control process is restarted.
[0081] It can be understood that since the channel closing information is stored in the memory, after closing the preset KCS channel, the channel closing information in the memory can be obtained when the baseboard management controller is restarted or the BMC is restored to factory, thereby keeping the preset KCS channel in a closed state, ensuring that the baseboard management controller will not be attacked by hackers or viruses through the preset KCS channel during the restart process.
[0082] In some optional embodiments, when the host system is restarted, the status information of the preset KCS channel is obtained; if the preset KCS channel is not in a closed state, the preset KCS channel is kept in an open state; if the KCS channel is in a closed state, the service manager's opening method is executed to open the preset channel process to open the preset KCS channel; the attribute value of the host system is monitored; when the attribute value is a first attribute value, the service manager's closing method is executed to close the preset channel process to close the preset KCS channel.
[0083] The status information is used to indicate whether the preset KCS channel is in a closed state.
[0084] In some optional implementations, when the host system is in a shutdown state and the preset KCS channel is not in a closed state, the BMC keeps the preset KCS channel in an open state.
[0085] If the type of the control process is a non-daemon type, a channel control method is provided in this embodiment, which can be used for the above-mentioned BMC. Figure 2 is a flow chart of another channel control method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0086] S201: receiving a command for closing a preset KCS channel, and storing channel closing information carried by the command for closing the preset KCS channel in a memory;
[0087] S202: Restart the baseboard management controller to obtain storage information in the memory;
[0088] S203: Determine whether the stored information is channel closing information;
[0089] S204: If the stored information is channel opening information, the control process is closed and the control channel is terminated.
[0090] S205: If the stored information is channel closing information, start the control process.
[0091] S206: in the startup control process, obtaining the attribute value of the host system at the current moment;
[0092] S207: Determine whether the attribute value is the first attribute value;
[0093] S208: If the attribute value is the first attribute value, close the preset KCS channel.
[0094] S209: If the attribute value is not the second attribute value, monitoring the attribute value of the host system;
[0095] S210: When it is detected that the attribute value changes from the second attribute value to the first attribute value, execute S208.
[0096] In this embodiment, a baseboard management controller is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0097] This embodiment provides a baseboard management controller, such as Figure 3 As shown, including:
[0098] The acquisition module 301 is used to obtain the attribute value of the host system at the current moment and the channel closing information stored in the memory of the baseboard management controller when receiving the instruction to close the preset KCS channel and the control process is started. The attribute value is used to indicate whether the host system has completed the power-on self-test process.
[0099] The processing module 302 is configured to determine a preset KCS channel from a plurality of KCS channels if the attribute value is a first attribute value, and the first attribute value indicates that the host system completes a power-on self-test process.
[0100] The processing module 302 is further used to close the preset KCS channel through channel closing information and control process.
[0101] In some optional embodiments, the processing module 302 is also used to monitor the attribute value of the host system within a preset time if the attribute value is a second attribute value, and the second attribute value is used to indicate that the host system has not completed the power-on self-test process; the processing module 302 is also used to determine a preset KCS channel from multiple KCS channels if the attribute value changes from the second attribute value to the first attribute value within the preset time, and close the preset KCS channel through channel closing information and control process; the processing module 302 is also used to close the control process if the attribute value is the second attribute value within the preset time.
[0102] In some optional embodiments, the preset KCS channel corresponds to a preset channel identifier; the processing module 302 is specifically used to receive channel parameters of each KCS channel in multiple KCS channels if the attribute value is a first attribute value, and the channel parameters include the channel identifier of each KCS channel; the processing module 302 is also specifically used to filter, from multiple KCS channels, a KCS channel with a channel identifier as a preset channel identifier based on the channel parameters and determine it as the preset KCS channel.
[0103] In some optional embodiments, the processing module 302 is also specifically used to execute the closing method of the service manager to close the preset channel process when the control process determines that the storage information of the memory is channel closing information, so as to close the preset KCS channel. The preset channel process is the process corresponding to the preset KCS channel.
[0104] In some optional embodiments, the type of the control process is a non-daemon process type. Before the control process is started, the processing module 302 is also used to receive an instruction to close a preset KCS channel, and store the channel closing information carried by the instruction to close the preset KCS channel in a memory; the processing module 302 is also used to restart the baseboard management controller to obtain the storage information in the memory; the processing module 302 is also used to start the control process if the storage information is channel closing information.
[0105] In some optional embodiments, the type of the control process is a non-daemon process type, and the acquisition module 301 is also used to obtain the channel opening information stored in the memory when receiving an instruction to open the preset KCS channel; the processing module 302 is also used to restart the baseboard management controller and determine the preset KCS channel from multiple KCS channels; the processing module 302 is also used to execute the opening method of the service manager to open the preset channel process based on the channel opening information to open the preset KCS channel.
[0106] In some optional embodiments, the type of the control process is a daemon process type, and the acquisition module 301 is also used to obtain the channel opening information stored in the memory when receiving an instruction to open the preset KCS channel; the processing module 302 is also used to determine the preset KCS channel from multiple KCS channels; the processing module 302 is also used to execute the opening method of the service manager to open the preset channel process based on the channel opening information, so as to open the preset KCS channel.
[0107] In some optional embodiments, the processing module 302 is also used to determine other KCS channels other than the preset KCS channel from multiple KCS channels if the attribute value is the first attribute value; the processing module 302 is also used to execute the opening method of the service manager to open each channel process in the other channel processes to open other KCS channels, and the other channel processes are channel processes corresponding to other KCS channels.
[0108] In some optional implementations, the acquisition module 301 is further used to restart the baseboard management controller to obtain the storage information in the memory; the processing module 302 is further used to restart the control process if the storage information is channel closing information.
[0109] In some optional embodiments, the acquisition module 301 is also used to obtain status information of a preset KCS channel when the host system is restarted, and the status information is used to indicate whether the preset KCS channel is in a closed state; the processing module 302 is also used to keep the preset KCS channel in an open state if the preset KCS channel is not in a closed state; the processing module 302 is also used to execute an opening method of the service manager to open the preset channel process if the KCS channel is in a closed state, so as to open the preset KCS channel; the processing module 302 is also used to monitor the attribute value of the host system; the processing module 302 is also used to execute a closing method of the service manager to close the preset channel process when the attribute value is a first attribute value, so as to close the preset KCS channel.
[0110] In some optional implementations, the processing module 302 is further configured to keep the preset KCS channel in an open state when the host system is in a shutdown state and the preset KCS channel is not in a closed state.
[0111] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0112] The baseboard management controller in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0113] The embodiment of the present invention also provides a computer device having the above Figure 3 The baseboard management controller is shown.
[0114] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0115] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0116] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0117] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0118] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0119] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0120] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0121] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0122] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0123] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A channel control method, characterized in that: Applied to a baseboard management controller, there are multiple keyboard controller style KCS channels between a host system and the baseboard management controller, the method includes: When receiving a command to close a preset KCS channel and the control process is started, obtaining a property value of the host system at the current moment, and obtaining channel closing information stored in the memory of the baseboard management controller, wherein the property value is used to indicate whether the host system has completed the power-on self-test process; If the attribute value is a first attribute value, determining the preset KCS channel from the multiple KCS channels, the first attribute value indicating that the host system completes a power-on self-test process; The preset KCS channel is closed through the channel closing information and the control process.
2. The method according to claim 1, characterized in that The method further comprises: If the attribute value is a second attribute value, monitoring the attribute value of the host system within a preset time, the second attribute value is used to indicate that the host system has not completed the power-on self-test process; If the attribute value changes from the second attribute value to the first attribute value within the preset time, determining the preset KCS channel from the multiple KCS channels, and closing the preset KCS channel through the channel closing information and the control process; If the attribute value is the second attribute value within the preset time, the control process is closed.
3. The method according to claim 2, characterized in that The preset KCS channel corresponds to a preset channel identifier; If the attribute value is the first attribute value, determining the preset KCS channel from the multiple KCS channels includes: If the attribute value is the first attribute value, receiving a channel parameter of each KCS channel in the multiple KCS channels, the channel parameter including a channel identifier of each KCS channel; Based on the channel parameters, a KCS channel whose channel identifier is the preset channel identifier is screened from the multiple KCS channels and is determined as the preset KCS channel.
4. The method according to claim 3, characterized in that Closing the preset KCS channel through the channel closing information and the control process includes: When the control process determines that the storage information of the memory is the channel closing information, the closing method of the service manager is executed to close the preset channel process to close the preset KCS channel. The preset channel process is the process corresponding to the preset KCS channel.
5. The method according to claim 4, characterized in that The type of the control process is a non-daemon process type. Before the control process is started, the method further includes: receiving the instruction to close the preset KCS channel, and storing the channel closing information carried by the instruction to close the preset KCS channel in the memory; Restarting the baseboard management controller to obtain storage information in the memory; If the stored information is the channel closing information, the control process is started.
6. The method according to claim 5, characterized in that The type of the control process is the non-daemon process type, and the method further includes: When receiving an instruction to open a preset KCS channel, obtaining the channel opening information stored in the memory; Restarting the baseboard management controller, and determining the preset KCS channel from the multiple KCS channels; Based on the channel opening information, the opening method of the service manager is executed to open the preset channel process to open the preset KCS channel.
7. The method according to claim 5, characterized in that The type of the control process is a daemon process type, and the method further includes: When receiving an instruction to open a preset KCS channel, obtaining the channel opening information stored in the memory; Determining the preset KCS channel from the multiple KCS channels; Based on the channel opening information, the opening method of the service manager is executed to open the preset channel process to open the preset KCS channel.
8. The method according to claim 6, characterized in that The method further comprises: If the attribute value is the first attribute value, determining other KCS channels except the preset KCS channel from the multiple KCS channels; The service manager's opening method is executed to open each channel process in other channel processes to open the other KCS channels, and the other channel processes are channel processes corresponding to the other KCS channels.
9. The method according to claim 6, characterized in that After closing the preset KCS channel through the channel closing information and the control process, the method further includes: Restarting the baseboard management controller to obtain storage information in the memory; If the stored information is the channel closing information, restart the control process.
10. The method according to claim 8, characterized in that The method further comprises: When the host system is restarted, obtaining status information of the preset KCS channel, where the status information is used to indicate whether the preset KCS channel is in a closed state; If the preset KCS channel is not in a closed state, keep the preset KCS channel in an open state; If the KCS channel is in a closed state, executing the opening method of the service manager to open the preset channel process to open the preset KCS channel; monitoring the attribute value of the host system; When the attribute value is the first attribute value, the closing method of the service manager is executed to close the preset channel process to close the preset KCS channel.
11. The method according to claim 10, characterized in that The method further comprises: When the host system is in a shutdown state and the preset KCS channel is not in a closed state, the preset KCS channel is kept in the open state.
12. A baseboard management controller, characterized in that: There are multiple keyboard controller style KCS channels between the host system and the baseboard management controller, and the baseboard management controller includes: An acquisition module, used for acquiring a property value of the host system at the current moment and acquiring channel closing information stored in the memory of the baseboard management controller when receiving a command to close a preset KCS channel and the control process is started, wherein the property value is used to indicate whether the host system has completed the power-on self-test process; a processing module, configured to determine the preset KCS channel from the multiple KCS channels if the attribute value is a first attribute value, the first attribute value indicating that the host system completes a power-on self-test process; The processing module is further used to close the preset KCS channel through the channel closing information and the control process.
13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the channel control method according to any one of claims 1 to 11 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the channel control method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The invention comprises computer instructions, wherein the computer instructions are used to make a computer execute the channel control method according to any one of claims 1 to 11.
