WO2022037267A1 - 一种bmc的ipmi命令处理方法、系统、设备以及介质 - Google Patents

一种bmc的ipmi命令处理方法、系统、设备以及介质 Download PDF

Info

Publication number
WO2022037267A1
WO2022037267A1 PCT/CN2021/103285 CN2021103285W WO2022037267A1 WO 2022037267 A1 WO2022037267 A1 WO 2022037267A1 CN 2021103285 W CN2021103285 W CN 2021103285W WO 2022037267 A1 WO2022037267 A1 WO 2022037267A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
command
ipmi
ipmi command
hash table
Prior art date
Application number
PCT/CN2021/103285
Other languages
English (en)
French (fr)
Inventor
梁盛楠
曹风兵
黄帅
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US18/012,926 priority Critical patent/US20230267057A1/en
Publication of WO2022037267A1 publication Critical patent/WO2022037267A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Definitions

  • the present invention relates to the field of BMC, in particular to a method, system, device and storage medium for processing IPMI commands of BMC.
  • IPMI Intelligent Platform Management Interface
  • an embodiment of the present invention proposes a method for processing an IPMI command of a BMC, including the following steps:
  • the IPMI command is processed by using the several processing objects.
  • determining the number of the processing objects pre-registered in the hash table on the first process according to the character strings of the processing objects further comprising:
  • the method further includes:
  • the command processing object and/or the management processing object in the hash table is called according to the character string by using the second functional function on the first process.
  • using the second function on the first process to call the command processing object and/or the management processing object in the hash table according to the character string further comprising:
  • the command processing object calls the corresponding management processing object to perform processing using the processing method preset in the management processing object.
  • determining character strings of several processing objects corresponding to the IPMI command further comprising:
  • the in-band IPMI command is parsed using an in-band processing process to determine a corresponding character string.
  • determining character strings of several processing objects corresponding to the IPMI command further comprising:
  • the out-of-band IPMI command is parsed using an out-of-band processing process to determine a corresponding character string.
  • the ipmid main process is used to call the first function on the first process to register multiple command processing objects created on the ipmid main process on the hash table, and use the The multiple management processes call the first function function on the first process to register multiple management processing objects created on the multiple management processes on the hash table, further comprising:
  • an embodiment of the present invention also provides a BMC IPMI command processing system, including:
  • the first determination module is configured to, in response to receiving the IPMI command, determine the character strings of several processing objects corresponding to the IPMI command;
  • the second determining module is configured to determine, according to the character strings of several processing objects, the several processing objects that are pre-registered in the hash table on the first process;
  • the processing module is configured to process the IPMI command by using the plurality of processing objects.
  • an embodiment of the present invention further provides a computer device, including:
  • a memory where the memory stores a computer program that can be executed on the processor, and is characterized in that, when the processor executes the program, the processor executes the steps of any of the IPMI command processing methods of the BMC as described above.
  • an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor Steps of any of the IPMI command processing methods of the BMC as described above are performed.
  • the present invention has one of the following beneficial technical effects: the solution provided by the present invention creates a "virtual bus" (the first process) in the BMC system, and splits a complete ipmid service into a plurality of different management service functions to "Hook up” into this bus, and the daemon processes of each service share data and communicate with each other through the "virtual bus” (the first process). Significantly improves the robustness of the IPMI function, and is more conducive to bug (vulnerability) location and post-maintenance.
  • FIG. 1 is a schematic flowchart of an IPMI command processing method of a BMC provided by an embodiment of the present invention
  • FIG. 2 is an architectural diagram of an IPMI command processing method provided by an embodiment of the present invention.
  • Figure 3 is a schematic diagram of a virtual base class that defines the ipmid process in vbusd;
  • Fig. 4 is the schematic diagram that defines the virtual base class of the network management module in vbusd
  • FIG. 5 is a schematic diagram of a core class IpmiManager implemented by the ipmid process
  • Fig. 6 is a schematic diagram of an ipmiManagerServer object created by the ipmid process based on the core class IpmiManager;
  • Figure 7 is a schematic diagram of a core class NetworkManger implemented by the network management module process
  • Figure 8 is a schematic diagram of a NetworkMangerServer object created by the network management module process based on the core class NetworkManger;
  • Fig. 9 is the schematic diagram that utilizes the second function function to determine the processing object according to the character string
  • FIG. 10 is a schematic structural diagram of an IPMI command processing system provided by an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a computer device provided by an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a computer-readable storage medium provided by an embodiment of the present invention.
  • an embodiment of the present invention proposes a method for processing an IPMI command of a BMC, as shown in FIG. 1 , which may include the steps:
  • the solution provided by the present invention is to create a "virtual bus" (the first process) in the BMC system, and split a complete ipmid service into a plurality of different management service functions to "hook" into the bus, each service Data sharing and message communication between the daemon processes through the "virtual bus” (the first process).
  • a virtual bus the first process
  • step S1 in response to receiving the IPMI command, determining the character strings of several processing objects corresponding to the IPMI command, further comprising:
  • the in-band IPMI command is parsed using an in-band processing process to determine a corresponding character string.
  • step S1 in response to receiving the IPMI command, determining the character strings of several processing objects corresponding to the IPMI command, further comprising:
  • the out-of-band IPMI command is parsed using an out-of-band processing process to determine a corresponding character string.
  • an out-of-band processing process ipmi-netd
  • an in-band processing process ipmi-kcsd
  • the ipmi-netd daemon is mainly responsible for monitoring and forwarding out-of-band IPMI command requests and commands related to the implementation of SOL (Serial Over LAN).
  • SOL Serial Over LAN
  • ipmi-netd can listen to socket (socket) port 623.
  • ipmi-netd listens to the input of the command, first performs a series of session (session) establishment operations, then parses the command content and sends it to vbusd (the first process) , find the object registered by the corresponding ipmid process and the object registered by the corresponding management process to use the functions in the object for processing, and finally return the command result to the user through ipmi-netd; when the user initiates a sol request, ipmi- netd directly parses the command content, and then sends it to vbusd to find the processing object that has been registered by the sol module (management process) for processing.
  • the ipmi-kcsd daemon is mainly responsible for monitoring and forwarding in-band IPMI command requests (it is assumed here that in-band access is through the KCS (Kernel Cache System) channel and in-band access through other channels, the principle is the same, the implementation details slightly different). For example, when a user initiates an in-band add user request from the CPU side system, the request message data will be sent to the BMC through the kcs channel, and the underlying kcs driver of the BMC will receive the message and throw it to the upper-layer ipmi-kcsd thread.
  • KCS Kernel Cache System
  • ipim-kcsd After ipim-kcsd receives the message, it parses the command content, forwards it to vbusd, finds the object registered by the corresponding ipmid process and uses the functions in the object for processing, and finally returns the command result to the user through ipmi-kcsd.
  • step S2 determining the several processing objects in the hash table pre-registered on the first process according to the character strings of several processing objects, further comprising:
  • the method further includes:
  • S23 Use the second function on the first process to call the command processing object and/or the management processing object in the hash table according to the character string.
  • S23 using the second function function on the first process to call the command processing object and/or the management processing object in the hash table according to the character string, further comprising:
  • the command processing object invokes the corresponding management processing object to perform processing using a processing method preset in the management processing object.
  • step S22 using the ipmid main process to call the first function function on the first process to register multiple command processing objects created on the ipmid main process on the hash table, and respectively using multiple management processes to call the first function function on the first process to register multiple management processing objects created on the multiple management processes on the hash table, further comprising:
  • vbusd daemon the role of the vbusd daemon (the first process) is to establish and maintain a "software bus" in memory, namely vbusd.
  • vbusd is actually a designed data structure similar to a hash table.
  • As a bus some protocol regulations need to be designed to facilitate the interaction between different processes.
  • the main functions are as follows:
  • vbusHashMap As the core data structure of the vbusd process, this structure can be understood as vbusHashMap as the "core bus” of this scheme, and the objects of other processes will be “mounted” into this structure;
  • each functional module When designing their own core classes, each functional module must inherit the corresponding virtual base class in vbusd and implement the virtual functions defined in it.
  • the virtual base class (IpmiBase) of the ipmid process is defined in vbusd, and several virtual functions are defined in the IpmiBase virtual base class. These virtual functions represent the command processing functions of each ipmi instruction.
  • the virtual base class (NetworkManagerBase) of the network management module is defined in vbusd, and several virtual functions are defined in the NetworkManagerBase virtual base class. Virtual functions do not need to have implementation details, the specific implementation of these functions is the core function implementation in the ipmid process.
  • ipmid needs to implement two network configuration functions: ipmiLanSet() and ipmiLanGet(). These two functions will eventually call setLanInfo() and getLanInfo() of the network configuration module through vbusd.
  • the core class implemented by the network configuration module will inherit the NetworkManagerBase virtual base class and implement the function details therein.
  • vbus_register (the first function): responsible for registering the object of the core class implemented in each management service function module into the vbusHashMap structure;
  • vbus_getObject (second function): Responsible for finding the target object from vbusHashMap and doing corresponding processing.
  • the ipmid process implements a core class IpmiManager, which inherits from the base class IpmiBase shown in FIG. 3 and implements all command processing functions defined in the base class. In this way, the ipmid process implements the core class IpmiManager and inherits from IpmiBase.
  • an ipmiManagerServer object is created based on the core class IpmiManager, and the vbus_register() function is called to register to vbusd.
  • the first parameter of the vbus_register() function is a string, which is used as the key (key) value of each element of the vbusHashMap hash table.
  • the subsequent vbus_getObject function uses this key value to find the corresponding object.
  • the command processing object and/or the string of the management processing object corresponding to each IPMI instruction can be preset, so that when the IPMI instruction is received, the corresponding command processing object and/or management processing can be called. object.
  • the command processing function implemented in IpmiManager is mainly responsible for parsing, filtering and other operations on ipmi commands (that is, judging whether the IPMI command meets the preset rules, such as whether the length of the user name meets the requirements, etc.), the real management operation still needs to call The processing method in the object registered in the hash table by the corresponding management service function module.
  • the underlying management service function modules implemented by various ipmi protocols are divided into independent software services, which may include user management, network configuration management, log management, sol, and so on. Similar to the ipmid process, each management service process will create a management class object that conforms to the vbusd rules based on the core class inherited from the virtual base class in vbusd. These objects contain various methods to implement the ipmi function. A functional function registers these objects on vbusd to facilitate the invocation of the command processing function in the command processing object of ipmid.
  • the network management module implements the core class NetworkManger, which inherits from the virtual base class NetworkManagerBase in vbusd, and implements two key methods. Then create the object NetworkMangerServer as shown in Figure 8 and register it with vbusd through vbus_register(). In this way, as shown in FIG. 9 , the command processing function in the command processing object in ipmid will find the management processing object in the corresponding management service function module in vbusHashMap through a string.
  • the solution provided by the present invention is to create a "virtual bus" (the first process) in the BMC system, and split a complete ipmid service into a plurality of different management service functions to "hook" into the bus, each service Data sharing and message communication between the daemon processes through the "virtual bus” (the first process).
  • a virtual bus the first process
  • an embodiment of the present invention further provides a BMC IPMI command processing system 400, as shown in FIG. 10, including:
  • a first determination module 401 the first determination module 401 is configured to, in response to receiving the IPMI command, determine the character strings of several processing objects corresponding to the IPMI command;
  • the second determination module 402 is configured to determine the plurality of processing objects pre-registered in the hash table on the first process according to the character strings of the plurality of processing objects;
  • an embodiment of the present invention further provides a computer device 501, including:
  • the memory 510 stores a computer program 511 that can be executed on the processor.
  • the processor 520 executes the program, the processor 520 executes the steps of any of the above IPMI command processing methods of the BMC.
  • an embodiment of the present invention further provides a computer-readable storage medium 601, where the computer-readable storage medium 601 stores computer program instructions 610, and the computer The program instructions 610, when executed by the processor, perform the steps of any of the above IPMI command processing methods for the BMC.
  • computer-readable storage media e.g. memory
  • volatile memory e.g., memory
  • non-volatile memory e.g., RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种BMC的IPMI命令处理方法,包括以下步骤:响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;利用所述若干个处理对象对所述IPMI命令进行处理。本发明还公开了一种系统、计算机设备以及可读存储介质。本发明提供的方案通过在BMC系统中创建第一进程,各个服务的守护进程之间通过第一进程进行数据共享和消息通信,显著提高了IPMI功能的健壮性,更有利于bug定位、后期维护等。

Description

一种BMC的IPMI命令处理方法、系统、设备以及介质
本申请要求于2020年08月21日提交中国国家知识产权局,申请号为202010852383.0,发明名称为“一种BMC的IPMI命令处理方法、系统、设备以及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及BMC领域,具体涉及一种BMC的IPMI命令处理方法、系统、设备以及存储介质。
背景技术
目前市面上比较成熟的BMC(Baseboard Management Controller,基板管理控制器)系统,其中都已经包含了对IPMI(Intelligent Platform Management Interface,智能平台管理接口)协议的实现方式。最常见的方式就是BMC系统启动后,开启一个ipmid守护进程,实时监控、管理CPU(Central Processing Unit,中央处理器)侧的各个指标;完成一些其他的管理工作,如用户管理、网络配置等;处理不同通道过来的IPMI请求,如CPU端过来的带内请求或者网络端过来的带外请求等。
这种通过一个大而全的守护进程来完成IPMI协议的所有内容,虽然在一定程度上简化了软件结构,但是由于包含的内容众多,一旦任何一个环节出现问题,就有可能导致整个IPMI功能出现异常,必须非常严谨的处理各种异常情况,对于软件的健壮性、可维护性都不够友好。
发明内容
有鉴于此,为了克服上述问题的至少一个方面,本发明实施例提出一种BMC的IPMI命令处理方法,包括以下步骤:
响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;
利用所述若干个处理对象对所述IPMI命令进行处理。
在一些实施例中,根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个所述处理对象,进一步包括:
响应于BMC启动,启动所述第一进程、ipmid主进程以及多个管理进程;
利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上。
在一些实施例中,方法还包括:
利用所述第一进程上的第二功能函数根据所述字符串调用所述哈希表中的命令处理对象和/或管理处理对象。
在一些实施例中,利用所述第一进程上的第二功能函数根据所述字符串调用所述哈希表中的命令处理对象和/或管理处理对象,进一步包括:
利用所述命令处理对象判断所述IPMI命令是否符合预设规则;
响应于符合所述预设规则,所述命令处理对象调用对应的管理处理对 象以利用所述管理处理对象中预设的处理方法进行处理。
在一些实施例中,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
响应于接收到带内IPMI命令,利用带内处理进程对所述带内IPMI命令进行解析以确定对应的字符串。
在一些实施例中,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
响应于接收到带外IPMI命令,利用带外处理进程对所述带外IPMI命令进行解析以确定对应的字符串。
在一些实施例中,利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上,进一步还包括:
在所述第一进程中的哈希表中定义多个虚基类,并利用所述ipmid主进程和所述多个管理进程中的核心类继承对应的虚基类;
利用继承虚基类的核心类创建对应的命令处理对象或管理处理对象。
基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种BMC的IPMI命令处理系统,包括:
第一确定模块,所述第一确定模块配置为响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
第二确定模块,所述第二确定模块配置为根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个所述处理对象;
处理模块,所述处理模块配置为利用所述若干个处理对象对所述IPMI 命令进行处理。
基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种计算机设备,包括:
至少一个处理器;以及
存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如上所述的任一种BMC的IPMI命令处理方法的步骤。
基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时执行如上所述的任一种BMC的IPMI命令处理方法的步骤。
本发明具有以下有益技术效果之一:本发明提供的方案通过在BMC系统中,创建一个“虚拟总线”(第一进程),并将一个完整ipmid服务拆分为多个不同的管理服务功能以“挂接”入这个总线,各个服务的守护进程之间通过“虚拟总线”(第一进程)数据共享和消息通信。显著提高了IPMI功能的健壮性,更有利于bug(漏洞)定位、后期维护等。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为本发明的实施例提供的BMC的IPMI命令处理方法的流程示意图;
图2为本发明的实施例提供的IPMI命令处理方法的架构图;
图3为在vbusd中定义了ipmid进程的虚基类的示意图;
图4为在vbusd中定义了网络管理模块的虚基类的示意图;
图5为ipmid进程实现的一个核心类IpmiManager的示意图;
图6为ipmid进程基于核心类IpmiManager创建的一个ipmiManagerServer对象的示意图;
图7为网络管理模块进程实现的一个核心类NetworkManger的示意图;
图8为网络管理模块进程基于核心类NetworkManger创建的一个NetworkMangerServer对象的示意图;
图9为利用第二功能函数根据字符串确定处理对象的示意图;
图10为本发明的实施例提供的IPMI命令处理系统的结构示意图;
图11为本发明的实施例提供的计算机设备的结构示意图;
图12为本发明的实施例提供的计算机可读存储介质的结构示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
根据本发明的一个方面,本发明的实施例提出一种BMC的IPMI命令处理方法,如图1所示,其可以包括步骤:
S1,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
S2,根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;
S3,利用所述若干个处理对象对所述IPMI命令进行处理。
本发明提供的方案通过在BMC系统中,创建一个“虚拟总线”(第一进程),并将一个完整ipmid服务拆分为多个不同的管理服务功能以“挂接”入这个总线,各个服务的守护进程之间通过“虚拟总线”(第一进程)数据共享和消息通信。显著提高了IPMI功能的健壮性,更有利于bug定位、后期维护等。
在一些实施例中,步骤S1,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
响应于接收到带内IPMI命令,利用带内处理进程对所述带内IPMI命令进行解析以确定对应的字符串。
在一些实施例中,步骤S1,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
响应于接收到带外IPMI命令,利用带外处理进程对所述带外IPMI命令进行解析以确定对应的字符串。
具体的,如图2所示,可以通过带外处理进程(ipmi-netd)和带内处理进程(ipmi-kcsd)监听并转发IPMI命令。其中,ipmi-netd守护进程主要负责监听并转发带外IPMI命令请求和实现SOL(Serial Over LAN,局域网串联)相关的命令。根据IPMI协议,ipmi-netd可以监听socket(套接字)623端口。例如,当用户从带外发起添加用户的命令,ipmi-netd监听到该命令的输入,先进行一系列session(会话)建立的操作,然后解析命令内容, 将其发送至vbusd(第一进程),找到对应的ipmid进程注册过的对象和对应的管理进程注册过的对象以利用对象中的函数进行处理,最终再通过ipmi-netd将命令结果返回给用户;当用户发起sol请求时,ipmi-netd直接解析命令内容,然后发送至vbusd上,寻找sol模块(管理进程)已经注册过的处理对象以进行处理。ipmi-kcsd守护进程主要负责监听并转发带内IPMI命令请求(这里假设带内访问是通过KCS(Kernel Cache System,内核缓存系统)通道,通过其他通道的带内访问,原理是相同的,实现细节略有区别)。例如,当用户从CPU端系统发起带内添加用户的请求,该请求消息数据会通过kcs通道发送给BMC,BMC底层kcs驱动程序接收到消息并抛给上层的ipmi-kcsd线程。ipim-kcsd接收到消息后,解析命令内容,转发至vbusd,找到对应的ipmid进程注册过的对象以利用对象中的函数进行处理,最终再通过ipmi-kcsd将命令结果返回给用户。
在一些实施例中,步骤S2,根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个所述处理对象,进一步包括:
S21,响应于BMC启动,启动所述第一进程、ipmid主进程以及多个管理进程;
S22,利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上。
在一些实施例中,方法还包括:
S23,利用所述第一进程上的第二功能函数根据所述字符串调用所述哈希表中的命令处理对象和/或管理处理对象。
在一些实施例中,S23,利用所述第一进程上的第二功能函数根据所述 字符串调用所述哈希表中的命令处理对象和/或管理处理对象,进一步包括:
利用所述命令处理对象判断所述IPMI命令是否符合预设规则;
响应于符合所述预设规则,所述命令处理对象调用对应的管理处理对象以利用所述管理处理对象中预设的处理方法进行处理。
在一些实施例中,步骤S22,利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上,进一步还包括:
在所述第一进程中的哈希表中定义多个虚基类,并利用所述ipmid主进程和所述多个管理进程中的核心类继承对应的虚基类;
利用继承虚基类的核心类创建对应的命令处理对象或管理处理对象。
具体的,vbusd守护进程(第一进程)的作用就是在内存中建立并维护“软件总线”,即vbusd。vbusd其实就是一种设计好的类似哈希表的数据结构。作为总线,需要设计一些协议规定,以方便不同进程之间的交互。主要功能如下:
(1)在vbusd进程启动后,创建一个空的哈希表vbusHashMap。该结构作为vbusd进程最核心数据结构,可以理解为vbusHashMap就是作为这个方案的“核心总线”,其他各个进程的对象都会“挂载”到这个结构中;
(2)设计并实现一些虚基类,作为通用标准。各个功能模块在设计自己的核心类时,必须要继承vbusd中对应的虚基类,并实现其中定义的虚函数。例如,如图3所示,vbusd中定义了ipmid进程的虚基类(IpmiBase),IpmiBase虚基类里面定义了若干个虚函数,这些虚函数代表了各个ipmi指令的命令处理函数。又例如,如图4所示,vbusd中定义了网络管理模块的 虚基类(NetworkManagerBase),NetworkManagerBase虚基类里面定义了若干个虚函数。虚函数不需要有实现细节,这些函数的具体实现是在ipmid进程中的核心函数实现。例如,由图3和图4可知,ipmid需要实现两个网络配置的函数:ipmiLanSet()和ipmiLanGet()。这两个函数最终会通过vbusd调用到网络配置模块的setLanInfo()和getLanInfo()。网络配置模块实现的核心类会继承NetworkManagerBase虚基类,并实现其中的函数细节。
(3)定义两个vbusd的核心功能函数:
vbus_register(第一功能函数):负责将每个管理服务功能模块中实现的核心类的对象注册到vbusHashMap结构中;
vbus_getObject(第二功能函数):负责从vbusHashMap中找到目标对象,做相应处理。
(4)为了使各个功能模块的进程都能够调用vbusd中定义的虚基类以及这两个核心函数,在vbusd的编译阶段,将这些虚基类和这两个核心函数编译为一个动态链接库vbus_public.so。其他管理服务功能模块在编译时,将vbus_public.so作为编译参数引入,这样这些功能模块在编写代码时就可以通过引入对应的头文件,来调用虚函数以及vbus_register、vbus_getObject。
在一些实施例中,如图5所示,ipmid进程实现一个核心类IpmiManager,该类继承自如图3所示的IpmiBase基类,并实现基类中定义的所有命令处理函数。这样,ipmid进程实现了核心类IpmiManager继承于IpmiBase。然后如图6所示,基于核心类IpmiManager创建一个ipmiManagerServer对象,并调用vbus_register()函数注册到vbusd上。vbus_register()函数第一个参数为一个字符串,作为vbusHashMap哈希表每个元素的key(键)值,后续vbus_getObject函数便是通过这个key值找到对应的对象。
需要说明的是,可以预先设定好每一个IPMI指令对应的命令处理对象 和/或管理处理对象的字符串,这样当接收到IPMI指令后,即可调用相应的命令处理对象和/或管理处理对象。这里IpmiManager里面实现的命令处理函数,主要负责对ipmi指令进行解析、过滤等操作(即判断IPMI命令是否符合预设规则,例如用户名的长度是否符合要求等等),真正的管理操作还需调用对应的管理服务功能模块在哈希表中注册的对象中的处理方法。
在一些实施例中,如图2所示,各种ipmi协议实现的底层管理服务功能模块,拆分为一个个的独立软件服务,可以包括用户管理、网络配置管理、日志管理、sol等等。类似于ipmid进程,每个管理服务进程都会基于继承于vbusd中的虚基类的核心类创建一个符合vbusd规则的管理类对象,这些对象包含各种实现ipmi功能的方法,最终通过调用vbusd的第一功能函数将这些对象注册到vbusd上,方便ipmid的命令处理对象中的命令处理函数调用。
以网络管理模块为例,需要实现的类如图7所示,网络管理模块实现了核心类NetworkManger,继承自vbusd中的虚基类NetworkManagerBase,并实现两个关键方法。然后创建如图8所示的对象NetworkMangerServer,通过vbus_register()注册到vbusd上。这样,如图9所示,ipmid中的命令处理对象中的命令处理函数会通过字符串在vbusHashMap找到对应管理服务功能模块中的管理处理对象。
本发明提供的方案通过在BMC系统中,创建一个“虚拟总线”(第一进程),并将一个完整ipmid服务拆分为多个不同的管理服务功能以“挂接”入这个总线,各个服务的守护进程之间通过“虚拟总线”(第一进程)数据共享和消息通信。显著提高了IPMI功能的健壮性,更有利于bug定位、后期维护等。
基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种BMC的IPMI命令处理系统400,如图10所示,包括:
第一确定模块401,所述第一确定模块401配置为响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
第二确定模块402,所述第二确定模块402配置为根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;
处理模块403,所述处理模块403配置为利用所述若干个处理对象对所述IPMI命令进行处理。
基于同一发明构思,根据本发明的另一个方面,如图11所示,本发明的实施例还提供了一种计算机设备501,包括:
至少一个处理器520;以及
存储器510,存储器510存储有可在处理器上运行的计算机程序511,处理器520执行程序时执行如上的任一种BMC的IPMI命令处理方法的步骤。
基于同一发明构思,根据本发明的另一个方面,如图12所示,本发明的实施例还提供了一种计算机可读存储介质601,计算机可读存储介质601存储有计算机程序指令610,计算机程序指令610被处理器执行时执行如上的任一种BMC的IPMI命令处理方法的步骤。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,BMC的IPMI命令处理方法的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。
此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这 些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。

Claims (10)

  1. 一种BMC的IPMI命令处理方法,其特征在于,包括以下步骤:
    响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
    根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;
    利用所述若干个处理对象对所述IPMI命令进行处理。
  2. 如权利要求1所述的方法,其特征在于,根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象,进一步包括:
    响应于BMC启动,启动所述第一进程、ipmid主进程以及多个管理进程;
    利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上。
  3. 如权利要求2所述的方法,其特征在于,还包括:
    利用所述第一进程上的第二功能函数根据所述字符串调用所述哈希表中的命令处理对象和/或管理处理对象。
  4. 如权利要求3所述的方法,其特征在于,利用所述第一进程上的第二功能函数根据所述字符串调用所述哈希表中的命令处理对象和/或管理处理对象,进一步包括:
    利用所述命令处理对象判断所述IPMI命令是否符合预设规则;
    响应于符合所述预设规则,所述命令处理对象调用对应的管理处理对象 以利用所述管理处理对象中预设的处理方法进行处理。
  5. 如权利要求1所述的方法,其特征在于,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
    响应于接收到带内IPMI命令,利用带内处理进程对所述带内IPMI命令进行解析以确定对应的字符串。
  6. 如权利要求1所述的方法,其特征在于,响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串,进一步包括:
    响应于接收到带外IPMI命令,利用带外处理进程对所述带外IPMI命令进行解析以确定对应的字符串。
  7. 如权利要求2所述的方法,其特征在于,利用所述ipmid主进程调用所述第一进程上的第一功能函数将所述ipmid主进程上创建的多个命令处理对象注册到所述哈希表上,并分别利用多个管理进程调用所述第一进程上的第一功能函数将所述多个管理进程上创建的多个管理处理对象注册到所述哈希表上,进一步还包括:
    在所述第一进程中的哈希表中定义多个虚基类,并利用所述ipmid主进程和所述多个管理进程中的核心类继承对应的虚基类;
    利用继承虚基类的核心类创建对应的命令处理对象或管理处理对象。
  8. 一种BMC的IPMI命令处理系统,其特征在于,包括:
    第一确定模块,所述第一确定模块配置为响应于接收到IPMI命令,确定所述IPMI命令对应的若干个处理对象的字符串;
    第二确定模块,所述第二确定模块配置为根据若干个处理对象的所述字符串确定预先注册到第一进程上的哈希表中的所述若干个处理对象;
    处理模块,所述处理模块配置为利用所述若干个处理对象对所述IPMI命令进行处理。
  9. 一种计算机设备,包括:
    至少一个处理器;以及
    存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如权利要求1-7任意一项所述的方法的步骤。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行如权利要求1-7任意一项所述的方法的步骤。
PCT/CN2021/103285 2020-08-21 2021-06-29 一种bmc的ipmi命令处理方法、系统、设备以及介质 WO2022037267A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/012,926 US20230267057A1 (en) 2020-08-21 2021-06-29 Ipmi command processing method and system for bmc, and device and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010852383.0 2020-08-21
CN202010852383.0A CN111984561B (zh) 2020-08-21 2020-08-21 一种bmc的ipmi命令处理方法、系统、设备以及介质

Publications (1)

Publication Number Publication Date
WO2022037267A1 true WO2022037267A1 (zh) 2022-02-24

Family

ID=73444165

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/103285 WO2022037267A1 (zh) 2020-08-21 2021-06-29 一种bmc的ipmi命令处理方法、系统、设备以及介质

Country Status (3)

Country Link
US (1) US20230267057A1 (zh)
CN (1) CN111984561B (zh)
WO (1) WO2022037267A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756492A (zh) * 2022-03-29 2022-07-15 中国西安卫星测控中心 适用于多种运载器的1553b数据总线处理方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984561B (zh) * 2020-08-21 2022-12-27 苏州浪潮智能科技有限公司 一种bmc的ipmi命令处理方法、系统、设备以及介质
CN112702350B (zh) * 2020-12-25 2022-09-27 北京百度网讯科技有限公司 带外管理方法及装置、电子设备、可读介质
CN114385458A (zh) * 2022-03-23 2022-04-22 苏州浪潮智能科技有限公司 一种基于事件总线模型的传感器监控的方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8898349B1 (en) * 2013-10-10 2014-11-25 American Megatrends, Inc. IPMI over USB data transfer between host computer and baseboard management controller (BMC)
CN105183571A (zh) * 2015-09-22 2015-12-23 小米科技有限责任公司 函数调用方法和装置
CN109960661A (zh) * 2019-04-18 2019-07-02 苏州浪潮智能科技有限公司 一种资产信息管理方法、装置、设备及存储介质
CN110633146A (zh) * 2019-08-30 2019-12-31 苏州浪潮智能科技有限公司 一种多线程操作ipmi命令的方法、设备及可读介质
CN111984561A (zh) * 2020-08-21 2020-11-24 苏州浪潮智能科技有限公司 一种bmc的ipmi命令处理方法、系统、设备以及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8898349B1 (en) * 2013-10-10 2014-11-25 American Megatrends, Inc. IPMI over USB data transfer between host computer and baseboard management controller (BMC)
CN105183571A (zh) * 2015-09-22 2015-12-23 小米科技有限责任公司 函数调用方法和装置
CN109960661A (zh) * 2019-04-18 2019-07-02 苏州浪潮智能科技有限公司 一种资产信息管理方法、装置、设备及存储介质
CN110633146A (zh) * 2019-08-30 2019-12-31 苏州浪潮智能科技有限公司 一种多线程操作ipmi命令的方法、设备及可读介质
CN111984561A (zh) * 2020-08-21 2020-11-24 苏州浪潮智能科技有限公司 一种bmc的ipmi命令处理方法、系统、设备以及介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756492A (zh) * 2022-03-29 2022-07-15 中国西安卫星测控中心 适用于多种运载器的1553b数据总线处理方法
CN114756492B (zh) * 2022-03-29 2023-11-03 中国西安卫星测控中心 适用于多种运载器的1553b数据总线处理方法

Also Published As

Publication number Publication date
CN111984561B (zh) 2022-12-27
CN111984561A (zh) 2020-11-24
US20230267057A1 (en) 2023-08-24

Similar Documents

Publication Publication Date Title
WO2022037267A1 (zh) 一种bmc的ipmi命令处理方法、系统、设备以及介质
WO2019184164A1 (zh) 自动部署Kubernetes从节点的方法、装置、终端设备及可读存储介质
CN111367983A (zh) 数据库访问方法、系统、设备和存储介质
WO2016184175A1 (zh) 数据库处理方法及装置
WO2019153488A1 (zh) 服务配置管理方法、装置、存储介质和服务器
CN111258627B (zh) 一种接口文档生成方法和装置
EP2947582A1 (en) Computing device and method for executing database operation command
CN101442513A (zh) 实现多种业务处理功能的方法和多核处理器设备
WO2019006808A1 (zh) 一种处理长连接建立请求的方法和装置
WO2011076011A1 (zh) 一种m2m平台定义消息的方法、系统和m2m平台
WO2023011274A1 (zh) 一种通讯协议转换方法、设备、系统及网关设备
JP2002182909A (ja) アプリケーション定義を共有する方法
CN111061685A (zh) 日志查询方法、装置、节点设备及存储介质
CN109413001B (zh) 对云计算系统内的交互数据进行安全保护的方法及装置
WO2022156542A1 (zh) 数据访问方法、系统和存储介质
TWI498037B (zh) 服務資訊管理方法及服務資訊管理系統
WO2020024458A1 (zh) 业务接口的管理方法及装置、存储介质、计算机设备
WO2016110070A1 (zh) 数据获取方法及装置、存储介质
WO2009129745A1 (zh) 分布式系统的接口调用方法和装置
CN116881040A (zh) 一种业务操作处理方法、装置、电子装置和存储介质
CN112883088B (zh) 一种数据处理方法、装置、设备及存储介质
WO2023155591A1 (zh) 进度信息管控方法、微服务装置、电子设备及存储介质
US10110670B2 (en) Allocation of service endpoints to servers
WO2021078176A1 (zh) 存储过程的运行方法、装置、数据库系统及存储介质
WO2020220272A1 (zh) 更改资源状态的方法、系统、终端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21857363

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21857363

Country of ref document: EP

Kind code of ref document: A1