Command transmission method and device, equipment and storage medium

By receiving and processing the management interface command under UEFI Shell, converting and sending to the substrate management controller, the problem of managing BMC in the absence of the existing technology without the IPmitool tool under the system without the system or without the system. Below the management function of BMC.

CN119336665APending Publication Date: 2025-01-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411381533.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, sending out-of-band IPMI commands requires dependent on IPMITOOL under the system, resulting in the inability to obtain BMC management information or send BMC management commands without the system or without IPMITOOL tools under the system.

Method used

Provide a command transmission method. By receiving the management interface command entered by the user under UEFI Shell, matching the processing function, converting the command into a preset format, analyzing and sending it to the substrate management controller, and receiving the returned results parameters.

Benefits of technology

The IPMI command is sent under UEFI Shell, obtaining BMC management information or sending BMC management commands, reducing the dependence on the system environment, and supporting management without the system or without the IPmitool tool under the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336665A_ABST
    Figure CN119336665A_ABST
Patent Text Reader

Abstract

The invention provides a command transmission method and device, equipment and a storage medium, and the method comprises the steps: receiving a management interface command inputted by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; converting the management interface command into a management interface command in a preset format through the processing function; analyzing the management interface command in the preset format through the processing function; sending the analyzed management interface command to a substrate management controller through a transmission interface; and receiving a result parameter returned by the baseboard management controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a command transmission method, device, equipment and storage medium. Background Art

[0002] BMC (Baseboard Management Controller) and IPMI (Intelligent Platform Management Interface) commands are mainly used to achieve remote management and monitoring of servers or computer systems. We generally use IPMITOOL to achieve out-of-band management. IPMITOOL is a command-line IPMI platform management tool that can be used in Linux systems. It is independent of the CPU (Central Processing Unit), BIOS (Basic Input / Output System) and operating system. Users can monitor the server as long as the power is turned on, whether the server is turned on or off.

[0003] In the prior art, sending IPMI commands out of band needs to rely on IPMITOOL under the system. For an environment without a system, it is impossible to obtain required information through IPMI instructions.

[0004] Therefore, in view of the shortcomings of the prior art solutions, the present invention provides a command transmission method. Summary of the invention

[0005] Based on this, it is necessary to provide a command transmission method, device, equipment and storage medium to address the above technical problems.

[0006] On the one hand, a command transmission method is provided, the method comprising: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; converting the management interface command into a management interface command in a preset format through the processing function; parsing the management interface command in the preset format through the processing function; sending the parsed management interface command to a baseboard management controller through a transmission interface; and receiving result parameters returned by the baseboard management controller.

[0007] Optionally, before receiving the management interface command input by the user in the command line environment based on the unified extensible firmware interface specification, the method also includes: creating a human-machine interface infrastructure handle; creating a command name and a processing function for the management interface command in the command line environment based on the unified extensible firmware interface specification, wherein the command name is associated with the human-machine interface infrastructure handle.

[0008] Optionally, the receiving of a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command, include: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and determining a human-machine interface infrastructure handle corresponding to the management interface command; and matching the processing function corresponding to the management interface command according to the human-machine interface infrastructure handle.

[0009] Optionally, after matching the processing function corresponding to the management interface command, the method further includes: detecting whether the function library in the processing function is initialized; if the function library is not initialized, filling the pointer corresponding to the management interface command into the function library; if the function library has been initialized, releasing the historical pointer in the function library, and filling the pointer corresponding to the management interface command into the function library.

[0010] Optionally, after converting the management interface command into a management interface command in a preset format, the method includes: detecting, through the processing function, whether the management interface command in the preset format meets the preset standard; when the management interface command in the preset format meets the preset standard, locating the transmission interface.

[0011] Optionally, sending the parsed management interface command to the baseboard management controller through the transmission interface includes: obtaining the parsed management interface command in a preset format to obtain a network function code and a management interface command word; detecting whether there is data in the parsed management interface command in the preset format, and if not, obtaining a first sending command template; filling the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command; sending the first sending command to the baseboard management controller through the transmission interface; if the data exists in the parsed management interface command in the preset format, calculating the length of the data; obtaining a second sending command template, filling the network function code, the management interface command word, the data and the length of the data into corresponding positions in the second sending command template to obtain a second sending command; sending the second sending command to the baseboard management controller through the transmission interface.

[0012] Optionally, the receiving result parameters returned by the baseboard management controller includes: receiving the result parameters returned by the baseboard management controller, parsing the result parameters, wherein the result parameters include response data and a completion code; detecting whether the completion code is a first preset value; when the completion code is the first preset value, printing the response data; when the completion code is not the first preset value, printing the completion code; and confirming the cause of the transmission failure based on the completion code.

[0013] On the other hand, a command transmission device is provided, which includes: a receiving module, used to receive a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and match the processing function corresponding to the management interface command; a conversion module, used to convert the management interface command into a management interface command in a preset format through the processing function; a parsing module, used to parse the management interface command in the preset format through the processing function; a sending module, used to send the parsed management interface command to a baseboard management controller through a transmission interface; and a result module, used to receive result parameters returned by the baseboard management controller.

[0014] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; converting the management interface command into a management interface command in a preset format through the processing function; parsing the management interface command in the preset format through the processing function; sending the parsed management interface command to a baseboard management controller through a transmission interface; and receiving result parameters returned by the baseboard management controller.

[0015] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; converting the management interface command into a management interface command in a preset format through the processing function; parsing the management interface command in the preset format through the processing function; sending the parsed management interface command to a baseboard management controller through a transmission interface; and receiving result parameters returned by the baseboard management controller.

[0016] The command transmission method, device, equipment and storage medium, the method includes: receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, matching a processing function corresponding to the management interface command; converting the management interface command into a management interface command in a preset format through the processing function; parsing the management interface command in the preset format through the processing function; sending the parsed management interface command to the baseboard management controller through the transmission interface; receiving the result parameter returned by the baseboard management controller; in this way, it is possible to send IPMI commands under UEFI SHELL, and in the case where there is no system or the IPMITOOL tool under the system, obtain BMC management information or send BMC management commands through the IPMI commands under UEFI SHELL; and in the process of BIOS debugging, it is possible to simulate the function of IPMITOOL through the IPMI commands under UEFI SHELL without being limited by the system or out-of-band IPMI, thereby reducing dependence on the system environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of a command transmission method in an embodiment;

[0018] Figure 2 A schematic diagram of a processing program installation flow of a command transmission method in one embodiment;

[0019] Figure 3 A schematic diagram of a flow chart of a command transmission method in an embodiment;

[0020] Figure 4 is a structural block diagram of a command transmission device in one embodiment;

[0021] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0023] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.

[0024] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0025] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0026] In one embodiment, Figure 1 As shown, a command transmission method is provided, comprising the following steps:

[0027] S101: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command.

[0028] Here, the command line environment based on the unified extensible firmware interface specification is UEFI SHELL (Unified Extensible Firmware Interface Shell), which provides a command line interface similar to an operating system, allowing users to enter commands to perform various operations; the management interface command can be an IPMI command, which allows system administrators to remotely monitor, manage and restore the server's hardware.

[0029] Among them, the processing function is used to process the management interface command in the UEFI SHELL environment. The processing function may include multiple sub-functions, such as a conversion function, a detection function, an initialization function, a parsing function, etc., which are used to execute different steps of processing the management interface command.

[0030] Specifically, the user inputs an IPMI command in the UEFI SHELL, the system receives the IPMI command, and matches the processing function corresponding to the IPMI command.

[0031] S102: Converting the management interface command into a management interface command in a preset format through the processing function.

[0032] Here, the preset format is a format that can be recognized and processed by the system, and the preset format can be hexadecimal or other formats. The management interface command input by the user can be unicode or other.

[0033] Here, the management interface commands in different formats and languages ​​input by the user are converted into management interface commands in a unified preset format through a processing function.

[0034] Among them, an initialization function may be preset first to identify whether the sub-function for converting the format in the processing function is valid. Exemplarily, the sub-function for converting the format in the processing function may be a global protocol pointer function, such as the gEfiUnicodeCollation2ProtocolGuid protocol.

[0035] Specifically, you can use the development sample CommandInit function to confirm whether the global protocol pointer function is valid. If the global protocol pointer function is valid, open

[0036] The gEfiUnicodeCollation2ProtocolGuid protocol finds the best matching language that supports the Unicode Collation2 protocol. For example, if the IPMI command entered by the user is in Unicode format, the gEfiUnicodeCollation2ProtocolGuid protocol includes a corresponding table for converting Unicode language into hexadecimal format. The gEfiUnicodeCollation2ProtocolGuid protocol converts all input IPMI commands into unified hexadecimal IPMI commands.

[0037] In one embodiment, the management interface command converted into a preset format may also be printed. For example, a function ShellCommandLineParse may be developed to print the input command line.

[0038] S103: parsing the management interface command in the preset format through the processing function.

[0039] Here, the management interface command in the unified format is parsed through the sub-function in the processing function to obtain the parameters in the management interface command.

[0040] S104: Sending the parsed management interface command to the baseboard management controller through the transmission interface.

[0041] Here, multiple functions are mounted on the transmission interface, each management interface command matches the corresponding function on the transmission interface, and the management interface command is sent according to the corresponding function.

[0042] The management interface command is sent to the BMC through a KCS (Keyboard Controller Style) channel.

[0043] S105: Receive result parameters returned by the baseboard management controller.

[0044] Specifically, the result parameters returned by the BMC are received and the result parameters are printed.

[0045] In one embodiment, the method further comprises: releasing the running memory and initializing the function list, specifically, restoring the processing function to an initial state for next use.

[0046] It should be noted that the present application can implement sending IPMI commands under UEFI SHELL, which is used to obtain BMC management information or send BMC management commands through IPMI commands under UEFI SHELL when there is no system or no IPMITOOL tool under the system; and, during BIOS debugging, it is possible to simulate the function of IPMITOOL through IPMI commands under UEFI SHELL without being restricted by the system or out-of-band IPMI, thereby reducing dependence on the system environment.

[0047] In some specific implementations, before receiving a management interface command input by a user in a command line environment based on the UEFI specification, the method further includes:

[0048] Create a HMI infrastructure handle;

[0049] A command name and a processing function of the management interface command in the command line environment based on the unified extensible firmware interface specification are created, wherein the command name is associated with the human-machine interface infrastructure handle.

[0050] Here, a handle is an identifier used to identify an object or an item, and a human interface infrastructure handle (HIIhandle, Human Interface Infrastructure) is used to identify a management interface command.

[0051] Furthermore, the processing function also includes a management interface command to initialize memory space. Exemplarily, when a processing function of a management interface command is matched, a cache space for operation is also reserved for the processing function.

[0052] Specifically, a new HII handle of ipmitool is created through the HiiAddPackages edkII library, ShellCommandRegisterCommandName is called to register a command name of ipmitool and associate it with the HII handle, and a handler after executing ipmitool is registered.

[0053] For example, Figure 2 This is a schematic diagram of the processing program installation process in the embodiment of the present application, such as Figure 2 As shown, the processing program installation process includes: S201: registering the HII handle through the gShellIpmitoolHiiHandle function; S202: installing the processing program of the level 1 UEFI Shell2.0 command ipmitool through the ShellCommandRunIpmitool function.

[0054] In this way, in the UEFI SHELL environment, the IPMI command name and the corresponding processing function are configured so that the IPMI command can be processed in the UEFI SHELL environment.

[0055] In some specific implementations, the receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command, includes:

[0056] Receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and determining a human-machine interface infrastructure handle corresponding to the management interface command;

[0057] According to the human-machine interface infrastructure handle, a processing function corresponding to the management interface command is matched.

[0058] Here, the IPMI command is identified through the HII Handle and the processing function corresponding to the IPMI command is matched.

[0059] In some specific implementations, after matching the processing function corresponding to the management interface command, the method further includes:

[0060] Detecting whether the function library in the processing function is initialized;

[0061] If the function library is not initialized, fill the pointer corresponding to the management interface command into the function library;

[0062] If the function library has been initialized, the history pointer in the function library is released, and the pointer corresponding to the management interface command is filled into the function library.

[0063] Here, the function library may include library functions such as reading files, writing files, closing files, and refreshing files. The library functions are general functions that may be used by management interface commands, and the function library may be a lib library.

[0064] Among them, the function library has been initialized, which means that the operation has been performed before, and the history pointer is the pointer left by the last management interface command.

[0065] In one embodiment, before detecting whether the function library in the processing function is initialized, an initialization function may be used to detect whether the function library exists.

[0066] Specifically, it is detected whether the function library is initialized. If not, the pointer corresponding to the IPMI command is filled into the position corresponding to the function in the function library; if it is initialized, the historical pointer in the function library is cleared, and the pointer corresponding to the IPMI command is filled into the position corresponding to the function in the function library. For example, the shell lib library can be initialized by the sample function ShellInitialize. If the shell library has been initialized, it will deinitialize all current protocol pointers and refill them again.

[0067] In this way, the common functions that may be used by the IPMI commands can be preconfigured to increase the rate of processing the IPMI commands.

[0068] In some specific implementations, after converting the management interface command into a management interface command in a preset format, the following steps are included:

[0069] By means of the processing function, detecting whether the management interface command in the preset format meets the preset standard;

[0070] When the management interface command in the preset format meets the preset standard, the transmission interface is located.

[0071] Here, the preset standard may be whether the management interface command in the preset format meets the format requirement. For example, the IPMI command supported for processing is the original command, wherein the format of the IPMI RAW command is as follows:

[0072] ipmitool <netfn> <cmd> ( <data>...)

[0073] The format requirements that the IPMI command in the preset format must meet include, but are not limited to, the command name being ipmitool and the parameters being hexadecimal data.

[0074] Furthermore, if the IPMI command is valid, you can locate

[0075] The gEfiDxeIpmiTransportProtocolGuid interface (ie, the transmission interface) can then be called to complete the communication with the BMC by calling the functions installed on the gEfiDxeIpmiTransportProtocolGuid interface.

[0076] In one embodiment, after locating the input interface, the function on the transmission interface is configured for subsequent calling.

[0077] In this way, invalid IPMI commands can be screened out and the efficiency of transmitting IPMI commands can be improved.

[0078] In some specific implementations, sending the parsed management interface command to the baseboard management controller through the transmission interface includes:

[0079] Obtain the parsed management interface command in a preset format, and obtain the network function code and the management interface command word;

[0080] Detecting whether there is data in the parsed management interface command in the preset format, and if not, obtaining a first sending command template;

[0081] Fill the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command;

[0082] Sending the first sending command to the baseboard management controller through the transmission interface;

[0083] If the parsed management interface command in the preset format contains the data, calculating the length of the data;

[0084] Obtain a second sending command template, and fill the network function code, the management interface command word, the data, and the length of the data into corresponding positions in the second sending command template to obtain a second sending command;

[0085] The second sending command is sent to the baseboard management controller through the transmission interface.

[0086] Here, the network function code is netfn, the management interface command word is cmd, and the data is data. The IPMI command is located through netfn, cmd, and data.

[0087] Exemplarily, when the parameter of the IPMI command does not contain data, the first sending command template is as follows:

[0088] Status=IpmiTransport->SendIpmiCommand(

[0089] IpmiTransport,

[0090] IpmiNetFn,

[0091] 0,

[0092] IpmiCmd,

[0093] NULL,

[0094] 0,

[0095] (UINT8*)ResponseData,

[0096] &ResponseDataSize )

[0098] Wherein, IpmiNetFn (i.e., netfn) and IpmiCmd (i.e., cmd) are positions in the first sending command template corresponding to different parameter contents according to different IPMI commands;

[0099] When the IPMI command parameter contains data, send the following command:

[0100] Status=IpmiTransport->SendIpmiCommand(

[0101] IpmiTransport,

[0102] IpmiNetFn,

[0103] 0,

[0104] IpmiCmd,

[0105] (UINT8*)RequestData,

[0106] RequestDataSize,

[0107] (UINT8*)ResponseData,

[0108] &ResponseDataSize )

[0110] Among them, IpmiNetFn (ie, netfn), IpmiCmd (ie, cmd), RequestData (ie, data), and RequestDataSize are positions corresponding to different parameter contents according to different IPMI commands in the sending command template.

[0111] In some specific implementations, the receiving the result parameter returned by the baseboard management controller includes:

[0112] Receiving a result parameter returned by the baseboard management controller, parsing the result parameter, wherein the result parameter includes response data and a completion code;

[0113] Detecting whether the completion code is a first preset value;

[0114] When the completion code is a first preset value, printing the response data;

[0115] When the completion code is not the first preset value, printing the completion code; and confirming the reason for the transmission failure according to the completion code.

[0116] Here, the first preset value may be 0x00, or other values ​​other than the first preset value, that is, other values ​​except 0x00, such as 0xc0, 0xc1, 0xc2, etc.

[0117] The correspondence between each completion code and the transmission result is preset. For example, if the completion code is 0x00, the corresponding transmission result is that the command is completed normally, and if the completion code is 0xc1, the corresponding failure reason is that the command is an invalid command. Exemplarily, the correspondence between the completion code and the specific result can be as follows:

[0118] {0x00,L"Command completed normally"},

[0119] {0xc0,L"Node busy"},

[0120] {0xc1,L"Invalid command"},

[0121] {0xc2,L"Invalid command on LUN"},

[0122] {0xc3,L"Timeout"},

[0123] {0xc4,L"Out of space"},

[0124] {0xc5,L"Reservation canceled or invalid"},

[0125] {0xc6,L"Request data truncated"},

[0126] {0xc7,L"Request data length invalid"},

[0127] {0xc8,L"Request data field length limit exceeded"},

[0128] {0xc9,L"Parameter out ofrange"},

[0129] {0xca,L"Cannot return number ofrequested data bytes"},

[0130] {0xcb,L"Requested sensor,data,or record not found"},

[0131] {0xcc,L"Invalid data field in request"},

[0132] {0xcd,L"Command illegal for specified sensor or rec ortype"},

[0133] {0xce,L"Command response could not be provided"},

[0134] {0xcf,L"Cannot execute duplicated request"},

[0135] {0xd0,L"SDR Repository in update mode"},

[0136] {0xd1,L"Device firmware in update mode"},

[0137] {0xd2,L"BMC initialization in progress"},

[0138] {0xd3,L"Destination unavailable"},

[0139] {0xd4,L"Insufficient privilege level"},

[0140] {0xd5,L"Command not supported in present state"},

[0141] {0xd6,L"Cannot execute command,command disabled"},

[0142] {0xff,L"Unspecified error"},

[0143] {0x00,NULL}.

[0144] Specifically, if the returned completion code is 0, the command is sent successfully and the returned response data is printed; if the command executed by the above named execution returns non-0, the completion code is printed, and the reason for the transmission failure is obtained according to the completion code corresponding table.

[0145] In this way, the reason for the transmission failure can be obtained through the returned result parameter for improvement.

[0146] In some specific implementations, after sending the parsed management interface command to the baseboard management controller, the method includes:

[0147] Recording the number of times the management interface command is sent;

[0148] Receive the number of times the management interface command is received returned by the baseboard management controller;

[0149] Comparing whether the number of times the management interface command is sent and the number of times it is received are consistent;

[0150] If they are inconsistent, an alarm will be generated.

[0151] Specifically, after sending an IPMI command, the system records the number of sends plus 1 to obtain a new number of sends. After the corresponding BMC receives the IPMI command, it records the number of receives plus 1 to obtain a new number of receives, and returns a new number of receives. The system receives the returned number of receives, compares the new number of sends with the new number of receives, and determines whether there is an IPMI command that has not been transmitted to the BMC.

[0152] In this way, by comparing the number of times the IPMI command is sent and the number of times it is received, communication problems or data loss during the transmission of the IPMI command can be avoided.

[0153] In one embodiment, Figure 3 It is a schematic diagram of the process in the embodiment of this application, such as Figure 3 As shown, the process includes: S301: Initialize Shell Lib library through ShellInitialize function; S302: Initialize command through CommandInit function; S303: Print input command line through ShellCommandLineParse function; S304: Check whether the input command line is valid, if not, end the process, if valid, execute S305: locate the interface through locategEfiDxeIpmiTransportProtocolGid function; S306: Identify the command, filter out netfn, cmd, data and calculate the length of data; S307: Send standard IPMI command through in-band kCS; S308: Print completioncode and ResponseData; S309: Release memory and process the function list of shellcommand; end the process.

[0154] In one embodiment, the execution process of the processing function corresponding to the IPMI command may be as follows:

[0155] a) Develop a sample function ShellInitialize, which initializes the shell lib library. If the shell library is already initialized, it will uninitialize all current protocol Poitners and repopulate them again.

[0156] b) Develop the sample CommandInit function to initialize the command and ensure that the global protocol pointer function is valid. Open the gEfiUnicodeCollation2ProtocolGuid protocol and find the best matching language that supports the Unicode Collation2 protocol.

[0157] c) Develop a sample function ShellCommandLineParse to print the input command line.

[0158] d) Define a detection function to detect whether the command input is valid.

[0159] e) If the command input in step d is valid, locate the gEfiDxeIpmiTransportProtocolGuid interface. After this step is executed, the function installed on the gEfiDxeIpmiTransportProtocolGuid interface can be called to complete the communication with the bmc.

[0160] f) Identify the input command and filter out netfn, cmd, and data. If there is data, calculate the length of the data.

[0161] g) If the length of data is greater than zero, send the corresponding standard library command. This command sends the command to BMC through the KCS channel and is not limited to the change of variable name definition.

[0162] h) If the data length is equal to 0, it means that the ipmi commands only have netfn and cmd, and the corresponding standard library commands are sent. This command sends commands to bmc through the kcs channel and is not limited to changes in variable name definitions.

[0163] i) If the completion code returned by the command executed in the above two steps is 0, the command is sent successfully and the returned ResponseData is printed; if the command executed by the above named execution returns non-0, the completion code is printed.

[0164] j) List of functions that release memory and process shellcommands.

[0165] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0166] In one embodiment, Figure 4 As shown, a command transmission device is provided, and the device includes: a receiving module 401, which is used to receive a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and match a processing function corresponding to the management interface command; a conversion module 402, which is used to convert the management interface command into a management interface command in a preset format through the processing function; a parsing module 403, which is used to parse the management interface command in the preset format through the processing function; a sending module 404, which is used to send the parsed management interface command to a baseboard management controller through a transmission interface; and a result module 405, which is used to receive a result parameter returned by the baseboard management controller.

[0167] As a preferred implementation manner, in an embodiment of the present application, the device also includes: a creation module, which is specifically used to: create a human-machine interface infrastructure handle; create a command name and a processing function for the management interface command in the command line environment based on the unified extensible firmware interface specification, wherein the command name is associated with the human-machine interface infrastructure handle.

[0168] As a preferred implementation mode, in an embodiment of the present application, the receiving module 401 is specifically used to: receive a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and determine a human-machine interface infrastructure handle corresponding to the management interface command; and match a processing function corresponding to the management interface command according to the human-machine interface infrastructure handle.

[0169] As a preferred implementation manner, in the embodiment of the present application, the device also includes: an initialization module, which is specifically used to: detect whether the function library in the processing function is initialized; if the function library is not initialized, fill the pointer corresponding to the management interface command into the function library; if the function library has been initialized, release the historical pointer in the function library, and fill the pointer corresponding to the management interface command into the function library.

[0170] As a preferred implementation, in an embodiment of the present application, the device also includes: a detection module, which is specifically used to: detect whether the management interface command in the preset format meets the preset standard through the processing function; when the management interface command in the preset format meets the preset standard, locate the transmission interface.

[0171] As a preferred implementation manner, in an embodiment of the present application, the sending module 404 is specifically used to: obtain the management interface command in a preset format after parsing, and obtain a network function code and a management interface command word; detect whether there is data in the management interface command in the preset format after parsing, and if not, obtain a first sending command template; fill the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command; send the first sending command to the baseboard management controller through the transmission interface; if the data exists in the management interface command in the preset format after parsing, calculate the length of the data; obtain a second sending command template, fill the network function code, the management interface command word, the data and the length of the data into corresponding positions in the second sending command template to obtain a second sending command; send the second sending command to the baseboard management controller through the transmission interface.

[0172] As a preferred implementation manner, in the embodiment of the present application, the result module 405 is specifically used to: receive the result parameters returned by the baseboard management controller, parse the result parameters, wherein the result parameters include response data and a completion code; detect whether the completion code is a first preset value; when the completion code is the first preset value, print the response data; when the completion code is not the first preset value, print the completion code; and confirm the cause of the transmission failure based on the completion code.

[0173] For the specific definition of the command transmission device, please refer to the definition of the command transmission method above, which will not be repeated here. Each module in the above-mentioned command transmission device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0174] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a command transmission method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0175] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0176] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: S1: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; S2: converting the management interface command into a management interface command in a preset format through the processing function; S3: parsing the management interface command in the preset format through the processing function; S4: sending the parsed management interface command to a baseboard management controller through a transmission interface; S5: receiving result parameters returned by the baseboard management controller.

[0177] In one embodiment, when the processor executes the computer program, the following steps are also implemented: creating a human-machine interface infrastructure handle; creating a command name and a processing function for the management interface command in the command line environment based on the Unified Extensible Firmware Interface specification, wherein the command name is associated with the human-machine interface infrastructure handle.

[0178] In one embodiment, when the processor executes the computer program, the following steps are also implemented: receiving a management interface command input by a user in a command line environment based on the Unified Extensible Firmware Interface specification, and determining a human-machine interface infrastructure handle corresponding to the management interface command; and matching a processing function corresponding to the management interface command according to the human-machine interface infrastructure handle.

[0179] In one embodiment, when the processor executes the computer program, the following steps are also implemented: detecting whether the function library in the processing function is initialized; if the function library is not initialized, filling the pointer corresponding to the management interface command into the function library; if the function library is initialized, releasing the historical pointer in the function library, and filling the pointer corresponding to the management interface command into the function library.

[0180] In one embodiment, when the processor executes the computer program, the following steps are also implemented: through the processing function, detecting whether the management interface command in the preset format meets the preset standard; when the management interface command in the preset format meets the preset standard, locating the transmission interface.

[0181] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a management interface command in a preset format after parsing to obtain a network function code and a management interface command word; detecting whether there is data in the management interface command in the preset format after parsing, and if not, obtaining a first sending command template; filling the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command; sending the first sending command to the baseboard management controller through the transmission interface; if the data exists in the management interface command in the preset format after parsing, calculating the length of the data; obtaining a second sending command template, filling the network function code, the management interface command word, the data and the length of the data into corresponding positions in the second sending command template to obtain a second sending command; sending the second sending command to the baseboard management controller through the transmission interface.

[0182] In one embodiment, when the processor executes the computer program, the following steps are also implemented: receiving result parameters returned by the baseboard management controller, parsing the result parameters, wherein the result parameters include response data and a completion code; detecting whether the completion code is a first preset value; when the completion code is the first preset value, printing the response data; when the completion code is not the first preset value, printing the completion code; and confirming the cause of the transmission failure based on the completion code.

[0183] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: S1: receiving a management interface command input by a user in a command line environment based on a unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; S2: converting the management interface command into a management interface command in a preset format through the processing function; S3: parsing the management interface command in the preset format through the processing function; S4: sending the parsed management interface command to a baseboard management controller through a transmission interface; S5: receiving result parameters returned by the baseboard management controller.

[0184] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: creating a human-machine interface infrastructure handle; creating a command name and a processing function for the management interface command in the command line environment based on the Unified Extensible Firmware Interface specification, wherein the command name is associated with the human-machine interface infrastructure handle.

[0185] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving a management interface command input by a user in a command line environment based on the Unified Extensible Firmware Interface specification, and determining a human-machine interface infrastructure handle corresponding to the management interface command; and matching a processing function corresponding to the management interface command based on the human-machine interface infrastructure handle.

[0186] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: detecting whether the function library in the processing function is initialized; if the function library is not initialized, filling the pointer corresponding to the management interface command into the function library; if the function library is initialized, releasing the historical pointer in the function library, and filling the pointer corresponding to the management interface command into the function library.

[0187] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: through the processing function, detecting whether the management interface command in the preset format meets the preset standard; when the management interface command in the preset format meets the preset standard, locating the transmission interface.

[0188] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a management interface command in a preset format after parsing to obtain a network function code and a management interface command word; detecting whether there is data in the management interface command in the preset format after parsing, and if not, obtaining a first sending command template; filling the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command; sending the first sending command to the baseboard management controller through the transmission interface; if the data exists in the management interface command in the preset format after parsing, calculating the length of the data; obtaining a second sending command template, filling the network function code, the management interface command word, the data and the length of the data into corresponding positions in the second sending command template to obtain a second sending command; sending the second sending command to the baseboard management controller through the transmission interface.

[0189] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving result parameters returned by the baseboard management controller, parsing the result parameters, wherein the result parameters include response data and a completion code; detecting whether the completion code is a first preset value; when the completion code is the first preset value, printing the response data; when the completion code is not the first preset value, printing the completion code; and confirming the cause of the transmission failure based on the completion code.

[0190] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0191] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0192] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.< / data> < / cmd> < / netfn>

Claims

1. A command transmission method, characterized in that: The method comprises: Receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command; By means of the processing function, the management interface command is converted into a management interface command of a preset format; Parsing the management interface command in the preset format through the processing function; Sending the parsed management interface command to the baseboard management controller via the transmission interface; Receive the result parameter returned by the baseboard management controller.

2. The command transmission method according to claim 1, characterized in that: Before receiving the management interface command input by the user in the command line environment based on the unified extensible firmware interface specification, the method further includes: Create a HMI infrastructure handle; A command name and a processing function of the management interface command in the command line environment based on the unified extensible firmware interface specification are created, wherein the command name is associated with the human-machine interface infrastructure handle.

3. The command transmission method according to claim 2, characterized in that: The receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and matching a processing function corresponding to the management interface command, comprises: Receiving a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and determining a human-machine interface infrastructure handle corresponding to the management interface command; According to the human-machine interface infrastructure handle, a processing function corresponding to the management interface command is matched.

4. The command transmission method according to claim 1, characterized in that: After matching the processing function corresponding to the management interface command, the method further includes: Detecting whether the function library in the processing function is initialized; If the function library is not initialized, fill the pointer corresponding to the management interface command into the function library; If the function library has been initialized, the history pointer in the function library is released, and the pointer corresponding to the management interface command is filled into the function library.

5. The command transmission method according to claim 1, characterized in that: After converting the management interface command into a management interface command in a preset format, the method includes: By means of the processing function, detecting whether the management interface command in the preset format meets the preset standard; When the management interface command in the preset format meets the preset standard, the transmission interface is located.

6. The command transmission method according to claim 1, characterized in that: The method of sending the parsed management interface command to the baseboard management controller through the transmission interface includes: Obtain the parsed management interface command in a preset format, and obtain the network function code and the management interface command word; Detecting whether there is data in the parsed management interface command in the preset format, and if not, obtaining a first sending command template; Fill the network function code and the management interface command word into corresponding positions in the first sending command template to obtain a first sending command; Sending the first sending command to the baseboard management controller through the transmission interface; If the parsed management interface command in the preset format contains the data, calculating the length of the data; Obtain a second sending command template, and fill the network function code, the management interface command word, the data, and the length of the data into corresponding positions in the second sending command template to obtain a second sending command; The second sending command is sent to the baseboard management controller through the transmission interface.

7. The command transmission method according to claim 1, characterized in that: The receiving the result parameter returned by the baseboard management controller includes: Receiving a result parameter returned by the baseboard management controller, parsing the result parameter, wherein the result parameter includes response data and a completion code; Detecting whether the completion code is a first preset value; When the completion code is a first preset value, printing the response data; When the completion code is not the first preset value, printing the completion code; and confirming the reason for the transmission failure according to the completion code.

8. A command transmission device, characterized in that: The device comprises: A receiving module, used to receive a management interface command input by a user in a command line environment based on the unified extensible firmware interface specification, and match a processing function corresponding to the management interface command; A conversion module, used for converting the management interface command into a management interface command of a preset format through the processing function; A parsing module, used for parsing the management interface command in the preset format through the processing function; A sending module, used for sending the parsed management interface command to the baseboard management controller through the transmission interface; The result module is used to receive the result parameter returned by the baseboard management controller.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.