Movatterモバイル変換


[0]ホーム

URL:


CN112130900A - User information management method, system, equipment and medium for BMC - Google Patents

User information management method, system, equipment and medium for BMC
Download PDF

Info

Publication number
CN112130900A
CN112130900ACN202010846567.6ACN202010846567ACN112130900ACN 112130900 ACN112130900 ACN 112130900ACN 202010846567 ACN202010846567 ACN 202010846567ACN 112130900 ACN112130900 ACN 112130900A
Authority
CN
China
Prior art keywords
user information
processing function
interface
dbus
operation processing
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010846567.6A
Other languages
Chinese (zh)
Other versions
CN112130900B (en
Inventor
梁盛楠
朱英澍
王文志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co LtdfiledCriticalSuzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010846567.6ApriorityCriticalpatent/CN112130900B/en
Publication of CN112130900ApublicationCriticalpatent/CN112130900A/en
Application grantedgrantedCritical
Publication of CN112130900BpublicationCriticalpatent/CN112130900B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种BMC的用户信息管理方法,包括以下步骤:响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。本发明还公开了一种系统、计算机设备以及可读存储介质。本发明提供的方案以dbus接口为介质,不仅实现了对用户信息的有效存储和管理,并且还不依赖于数据库,减少了对BMC存储空间的占用。

Figure 202010846567

The invention discloses a user information management method of BMC, comprising the following steps: in response to receiving an IPMI instruction for managing user information, using a first process to call a command processing function corresponding to the IPMI instruction; using the command processing function Judging whether the user information corresponding to the IPMI instruction conforms to the preset rule; in response to conforming to the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface; using the operation processing function to transfer the user The information is registered to the dbus interface or the corresponding user information on the dbus interface is modified according to the user information. The invention also discloses a system, a computer device and a readable storage medium. The solution provided by the invention uses the dbus interface as the medium, which not only realizes the effective storage and management of user information, but also does not depend on the database, and reduces the occupation of the BMC storage space.

Figure 202010846567

Description

Translated fromChinese
一种BMC的用户信息管理方法、系统、设备以及介质A kind of user information management method, system, device and medium of BMC

技术领域technical field

本发明涉及BMC领域,具体涉及一种BMC的用户信息管理方法、系统、设备以及存储介质。The present invention relates to the field of BMC, in particular to a user information management method, system, device and storage medium of BMC.

背景技术Background technique

目前市面上比较成熟的BMC系统,其中都已经包含了对IPMI协议的实现方式。但是其中的用户管理模块,一般都是用数据库来保存用户信息,各个ipmi用户命令是对数据库中的用户信息进行操作。At present, the relatively mature BMC systems on the market already include the implementation of the IPMI protocol. However, in the user management module, the database is generally used to store user information, and each ipmi user command operates on the user information in the database.

而对于BMC这样的小型嵌入式系统,存储空间都极为有限,flash容量一般为32M或者64M,需要严格控制系统的大小,在这种情况下使用数据库软件无疑也会占用大量的存储空间。且BMC系统本身需要持久化的数据并不多,为了用户管理而增加一个数据库软件,性价比较低。For a small embedded system such as BMC, the storage space is extremely limited. The flash capacity is generally 32M or 64M, and the size of the system needs to be strictly controlled. In this case, the use of database software will undoubtedly take up a lot of storage space. In addition, the BMC system itself does not need much persistent data. Adding a database software for user management is cost-effective.

发明内容SUMMARY OF THE INVENTION

有鉴于此,为了克服上述问题的至少一个方面,本发明实施例提出一种BMC的用户信息管理方法,包括以下步骤:In view of this, in order to overcome at least one aspect of the above problem, an embodiment of the present invention proposes a user information management method for BMC, including the following steps:

响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;In response to receiving the IPMI instruction for managing user information, use the first process to call the command processing function corresponding to the IPMI instruction;

利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;Utilize the command processing function to determine whether the user information corresponding to the IPMI instruction conforms to the preset rule;

响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;In response to conforming to the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface;

利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。The user information is registered to the dbus interface by using the operation processing function or the corresponding user information on the dbus interface is modified according to the user information.

在一些实施例中,还包括:In some embodiments, it also includes:

利用所述第二进程将所述用户信息同步到预设路径下的json文件。Use the second process to synchronize the user information to a json file in a preset path.

在一些实施例中,还包括:In some embodiments, it also includes:

响应于所述第二进程重新启动,所述第二进程读取所述json文件中的用户信息,并利用所述操作处理函数将所述json文件中的用户信息注册到所述dbus接口。In response to the restart of the second process, the second process reads the user information in the json file, and uses the operation processing function to register the user information in the json file with the dbus interface.

在一些实施例中,响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数,进一步包括:In some embodiments, in response to receiving an IPMI instruction for managing user information, using the first process to call a command processing function corresponding to the IPMI instruction, further comprising:

将多个命令处理函数封装到所述第一进程的全局数据结构变量中,且所述第一进程向系统bus接口挂接包括第一对象的第一dbus接口;encapsulating a plurality of command processing functions into the global data structure variable of the first process, and the first process attaches the first dbus interface including the first object to the system bus interface;

响应于接收到所述IPMI指令,所述第一dbus接口的第一对象根据所述IPMI指令对应的指令码在所述全局数据结构变量中获取与所述IPMI指令对应的命令处理函数。In response to receiving the IPMI instruction, the first object of the first dbus interface obtains a command processing function corresponding to the IPMI instruction in the global data structure variable according to the instruction code corresponding to the IPMI instruction.

在一些实施例中,响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数,进一步包括:In some embodiments, in response to conforming to the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface, further comprising:

所述第二进程向系统bus接口挂接包括第二对象的第二dbus接口;The second process attaches to the system bus interface the second dbus interface including the second object;

将所述多个操作处理函数封装到所述第二对象上以使所述命令处理函数通过所述第一dbus接口和所述第二dbus接口调用相应的操作处理函数。The plurality of operation processing functions are encapsulated on the second object, so that the command processing functions call corresponding operation processing functions through the first dbus interface and the second dbus interface.

在一些实施例中,利用所述操作处理函数将所述用户信息注册到dbus接口,进一步包括:In some embodiments, using the operation processing function to register the user information to the dbus interface, further comprising:

利用所述第二对象上的操作处理函数在所述第二dbus接口上创建对应的用户对象并将所述用户信息注册到所述用户对象下的接口中。A corresponding user object is created on the second dbus interface by using the operation processing function on the second object, and the user information is registered in the interface under the user object.

在一些实施例中,利用所述操作处理函数对所述dbus接口上对应的用户信息进行修改,进一步包括:In some embodiments, using the operation processing function to modify the corresponding user information on the dbus interface, further comprising:

利用所述第二对象上的操作处理函数根据所述用户信息修改对应的用户对象下的接口中的用户信息。The user information in the interface under the corresponding user object is modified according to the user information by using the operation processing function on the second object.

基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种BMC的用户信息管理系统,包括:Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention also provides a BMC user information management system, including:

第一进程模块,所述第一进程模块配置为响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;a first process module, the first process module is configured to use the first process to call a command processing function corresponding to the IPMI instruction in response to receiving the IPMI instruction for managing user information;

判断模块,所述判断模块配置为利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;a judgment module, the judgment module is configured to use the command processing function to judge whether the user information corresponding to the IPMI instruction conforms to a preset rule;

第二进程模块,所述第二进程模块配置为响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;a second process module, the second process module is configured to, in response to conforming to a preset rule, the command processing function calls the operation processing function in the second process through the dbus interface;

注册修改模块,所述注册修改模块配置为利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。A registration modification module, which is configured to use the operation processing function to register the user information to the dbus interface or to modify the corresponding user information on the dbus interface according to the user information.

基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种计算机设备,包括:Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including:

至少一个处理器;以及at least one processor; and

存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如上所述的任一种BMC的用户信息管理方法的步骤。A memory, wherein 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 user information management methods of the BMC as described above.

基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时执行如上所述的任一种BMC的用户信息管理方法的步骤。Based on the same inventive concept, according to another aspect of the present invention, 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 Perform the steps of any of the user information management methods of the BMC as described above.

本发明具有以下有益技术效果之一:本发明提供的方案以dbus接口为介质,不仅实现了对用户信息的有效存储和管理,并且还不依赖于数据库,减少了对BMC存储空间的占用。The invention has one of the following beneficial technical effects: the solution provided by the invention uses the dbus interface as the medium, which not only realizes the effective storage and management of user information, but also does not depend on the database, and reduces the occupation of the BMC storage space.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can also be obtained according to these drawings without creative efforts.

图1为本发明的实施例提供的BMC的用户信息管理方法的流程示意图;1 is a schematic flowchart of a user information management method of a BMC provided by an embodiment of the present invention;

图2为本发明的实施例提供的用户信息管理方法的架构图;FIG. 2 is an architectural diagram of a user information management method provided by an embodiment of the present invention;

图3为本发明的实施例提供的BMC的用户信息管理系统的结构示意图;3 is a schematic structural diagram of a user information management system of a BMC provided by an embodiment of the present invention;

图4为本发明的实施例提供的计算机设备的结构示意图;4 is a schematic structural diagram of a computer device provided by an embodiment of the present invention;

图5为本发明的实施例提供的计算机可读存储介质的结构示意图。FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention will be further described in detail below with reference to the specific embodiments and the accompanying drawings.

需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities with the same name but not the same or non-identical parameters. It can be seen that "first" and "second" It is only for the convenience of expression and should not be construed as a limitation to the embodiments of the present invention, and subsequent embodiments will not describe them one by one.

需要说明的是,Linux系统中有一个系统bus(system bus),其是最上层。各个程序自己定义的dbus接口,都要挂接到这个系统bus上。It should be noted that there is a system bus (system bus) in the Linux system, which is the top layer. The dbus interface defined by each program must be connected to the system bus.

dbus是linux系统中一种高级、高效的进程间通信方式,注册后的进程可通过dbus接收或传递消息,进程也可注册后等待内核事件响应。dbus is an advanced and efficient inter-process communication method in linux system. The registered process can receive or transmit messages through dbus, and the process can also wait for the kernel event response after registration.

每个dbus接口由以下几部分组成:Each dbus interface consists of the following parts:

(1)服务(service):如Com.Inspur_Switch.Ipmi.Server。向系统bus上注册新的接口时,需要提供这个名称,也叫作Bus Name;(1) Service (service): such as Com.Inspur_Switch.Ipmi.Server. When registering a new interface with the system bus, you need to provide this name, also known as Bus Name;

(2)对象(object):如/com/inspur_switch/ipmi。进程向dbus上注册新的服务后,每个服务会包含一个或多个对象,每个对象中会包含一些Interface以及属性和方法,以便完成不同的功能;(2) Object (object): such as /com/inspur_switch/ipmi. After the process registers a new service with dbus, each service will contain one or more objects, and each object will contain some interfaces, properties and methods to complete different functions;

(3)接口(Interface):如com.inspur_switch.ipmi.handler。每个对象可能包含一个或多个Interface,一个Interface就是一组功能的结合,每个Interface可以完成不同的功能;(3) Interface (Interface): such as com.inspur_switch.ipmi.handler. Each object may contain one or more Interfaces, an Interface is a combination of a set of functions, and each Interface can complete different functions;

(4)属性和方法:每个Interface下又包含了若干属性和方法,可以供不同程序之间调用,从而完成进程间的数据共享。(4) Attributes and methods: Each interface contains several attributes and methods, which can be called between different programs to complete data sharing between processes.

用户只需定义好对应的bus name、object名称、Interface名称,并编写好方法函数,最后调用linux系统封装好的接口,即可向system bus上注册自定义的dbus接口。The user only needs to define the corresponding bus name, object name, and Interface name, write the method function, and finally call the interface encapsulated by the Linux system to register the custom dbus interface on the system bus.

根据本发明的一个方面,本发明的实施例提出一种BMC的用户信息管理方法,如图1所示,其可以包括步骤:According to an aspect of the present invention, an embodiment of the present invention proposes a user information management method for BMC, as shown in FIG. 1 , which may include the steps:

S1,响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;S1, in response to receiving the IPMI instruction for managing user information, utilize the first process to call the command processing function corresponding to the IPMI instruction;

S2,利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;S2, utilize the command processing function to judge whether the user information corresponding to the IPMI instruction conforms to a preset rule;

S3,响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;S3, in response to meeting the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface;

S4,利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。S4, using the operation processing function to register the user information in the dbus interface or modify the corresponding user information on the dbus interface according to the user information.

本发明提供的方案以dbus接口为介质,不仅实现了对用户信息的有效存储和管理,并且还不依赖于数据库,减少了对BMC存储空间的占用。The solution provided by the invention uses the dbus interface as the medium, which not only realizes the effective storage and management of user information, but also does not depend on the database, and reduces the occupation of the BMC storage space.

在一些实施例中,步骤S1,响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数,进一步包括:In some embodiments, step S1, in response to receiving an IPMI instruction for managing user information, using a first process to call a command processing function corresponding to the IPMI instruction, further comprising:

S11,将多个命令处理函数封装到所述第一进程的全局数据结构变量中,且所述第一进程向系统bus接口挂接包括第一对象的第一dbus接口;S11, encapsulating a plurality of command processing functions into a global data structure variable of the first process, and the first process attaches a first dbus interface including a first object to the system bus interface;

S12,响应于接收到所述IPMI指令,所述第一dbus接口的第一对象根据所述IPMI指令对应的指令码在所述全局数据结构变量中获取与所述IPMI指令对应的命令处理函数。S12, in response to receiving the IPMI instruction, the first object of the first dbus interface obtains a command processing function corresponding to the IPMI instruction from the global data structure variable according to the instruction code corresponding to the IPMI instruction.

具体的,如图2所示,第一进程可以是ipmid进程,ipmid进程是ipmi指令实现的守护进程。当BMC系统开机后,便会自动启动ipmid守护进程,主要负责接收并利用命令处理函数处理ipmi用户相关的指令。命令处理函数可以包括:ipmiSetUserName()、ipmiGetUserName()、ipmiSetUserPassword()、ipmiGetUserAccess()、ipmiSetUserAccess()等,主要负责接收对应的ipmi指令并对命令进行判断、过滤和解析,以判断ipmi指令是否符合预设规则(例如,用户名的长度是否符合要求等等),如果不符合预设规则返回相应的提示信息,符合规则继续进行后续步骤。Specifically, as shown in FIG. 2 , the first process may be an ipmid process, and the ipmid process is a daemon process implemented by an ipmi instruction. When the BMC system is powered on, it will automatically start the ipmid daemon, which is mainly responsible for receiving and using command processing functions to process ipmi user-related instructions. Command processing functions can include: ipmiSetUserName(), ipmiGetUserName(), ipmiSetUserPassword(), ipmiGetUserAccess(), ipmiSetUserAccess(), etc., and are mainly responsible for receiving the corresponding ipmi command and judging, filtering and parsing the command to determine whether the ipmi command conforms to the The preset rules (for example, whether the length of the user name meets the requirements, etc.), if the preset rules are not met, a corresponding prompt message is returned, and the next steps are continued if the rules are met.

在一些实施例中,上述多个命令处理函数可以存入ipmid进程的一个全局cmdMap数据结构变量中。In some embodiments, the above-mentioned multiple command processing functions may be stored in a global cmdMap data structure variable of the ipmid process.

在一些实施例中,ipmid进程启动后,可以向system bus接口上注册一个服务(service)为Com.Inspur_Switch.Ipmi.Server的第一dbus接口,该第一dbus接口可以包含一个名为/com/inspur_switch/ipmi的第一对象,该第一对象可以实现“execute”方法。该方法的功能就是根据ipmi指令码,在cmdMap结构中查找对应的命令处理函数并调用执行。这样,当有用户操作的ipmi指令到来时,负责监听指令的进程就会调用Com.Inspur_Switch.Ipmi.Server接口上的execute方法,在cmdMap中寻找对应的命令处理函数并调用执行。In some embodiments, after the ipmid process is started, a service (service) may be registered with the system bus interface as the first dbus interface of Com.Inspur_Switch.Ipmi.Server, and the first dbus interface may include a file named /com/ The first object of inspur_switch/ipmi, which can implement the "execute" method. The function of this method is to find the corresponding command processing function in the cmdMap structure according to the ipmi instruction code and call and execute it. In this way, when a user-operated ipmi command arrives, the process responsible for monitoring the command will call the execute method on the Com.Inspur_Switch.Ipmi.Server interface, find the corresponding command processing function in cmdMap and call the execution.

在一些实施例中,步骤S3,响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数,进一步包括:In some embodiments, step S3, in response to conforming to the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface, further comprising:

S31,所述第二进程向系统bus接口挂接包括第二对象的第二dbus接口;S31, the second process attaches a second dbus interface including a second object to the system bus interface;

S32,将所述多个操作处理函数封装到所述第二对象上以使所述命令处理函数通过所述第一dbus接口和所述第二dbus接口调用相应的操作处理函数。S32: Encapsulate the plurality of operation processing functions on the second object, so that the command processing functions call corresponding operation processing functions through the first dbus interface and the second dbus interface.

具体的,如图2所示,第二进程可以是user-managerd进程,user-managerd进程是用于用户管理的具体实现。ipmid进程中实现了用户相关的多个命令处理函数。在user-managerd中,同样实现了多个分别与命令处理函数对应的操作处理函数,这些作为底层的处理方法直接对用户信息进行操作,会被上层ipmid中的处理函数调用。当user-managerd启动后,会向system bus上注册一个服务(service)为Com.Inspur_Switch.User.Manager的第二dbus接口,该dbus接口可以包括第二对象(/com/inspur_switch/user/manager),上述多个操作处理函数可以被注册到该对象上,以被ipmid进程中的命令处理函数调用。user-managerd进程上的函数之所以能够被不同的进程(例如ipmid进程)调用,利用了dbus这一进程间通讯的特殊机制,通过bus name、对象名称等,在利用linux系统封装好的接口,就可以调用已经注册到system bus上的dbus接口。Specifically, as shown in FIG. 2 , the second process may be a user-managerd process, and the user-managerd process is a specific implementation for user management. Multiple user-related command processing functions are implemented in the ipmid process. In user-managerd, a number of operation processing functions corresponding to command processing functions are also implemented. These are the underlying processing methods to directly operate user information and will be called by the processing functions in the upper layer ipmid. When user-managerd is started, it will register a second dbus interface with a service (service) as Com.Inspur_Switch.User.Manager on the system bus, which can include a second object (/com/inspur_switch/user/manager) , the above-mentioned multiple operation processing functions can be registered on the object to be called by the command processing functions in the ipmid process. The reason why the functions on the user-managerd process can be called by different processes (such as the ipmid process) is that dbus is a special mechanism for inter-process communication. Through the bus name, object name, etc., the interface encapsulated by the linux system is used. You can call the dbus interface that has been registered on the system bus.

在一些实施例中,操作处理函数可以包括:CreateUser():负责创建新用户;RenameUser():负责编辑修改已有用户;setPassword():负责设置用户密码;testPassword():负责验证密码;getUserAccess():负责获取用户权限信息;setUserAccess():负责设置用户权限信息。In some embodiments, the operation processing functions may include: CreateUser(): responsible for creating new users; RenameUser(): responsible for editing and modifying existing users; setPassword(): responsible for setting user passwords; testPassword(): responsible for verifying passwords; getUserAccess (): responsible for obtaining user permission information; setUserAccess(): responsible for setting user permission information.

在一些实施例中,步骤S5,利用所述操作处理函数将所述用户信息注册到dbus接口,进一步包括:In some embodiments, step S5, using the operation processing function to register the user information to the dbus interface, further comprising:

利用所述第二对象上的操作处理函数在所述第二dbus接口上创建对应的用户对象并将所述用户信息注册到所述用户对象下的接口中。A corresponding user object is created on the second dbus interface by using the operation processing function on the second object, and the user information is registered in the interface under the user object.

在一些实施例中,步骤S5,利用所述操作处理函数对所述dbus接口上对应的用户信息进行修改,进一步包括:In some embodiments, step S5, using the operation processing function to modify the corresponding user information on the dbus interface, further comprising:

利用所述第二对象上的操作处理函数根据所述用户信息修改对应的用户对象下的接口中的用户信息。The user information in the interface under the corresponding user object is modified according to the user information by using the operation processing function on the second object.

具体的,第二dbus接口上还包括用户对象(/com/inspur_switch/user/list/<user_name>),该对象是用户管理的核心对象。当通过ipmi指令创建用户时,就会在第二dbus接口创建一个用户对象,对象名称结尾以用户名结束。每个用户的对象会包含一个com.inspur_switch.userInfo的Interface,包含以下属性:UserID,用户ID序号;UserEnabled,用户是否激活;UserGroups,所在的用户组;UserPrivilege,用户权限;UserLocked,是否被锁定。例如,以用户名test为例,当用户执行ipmi指令添加一个名为test的新用户,则通过调用createUser()函数,在第二dbus接口上注册一个新对象:/org/inspur/user/manager/test,该对象下会包含用户的各种非敏感信息,包括用户名、角色、权限、锁定状态等。Specifically, the second dbus interface further includes a user object (/com/inspur_switch/user/list/<user_name>), which is the core object of user management. When a user is created through the ipmi command, a user object is created on the second dbus interface, and the object name ends with the user name. The object of each user will contain an Interface of com.inspur_switch.userInfo, including the following attributes: UserID, the user ID serial number; UserEnabled, whether the user is activated; UserGroups, the user group it belongs to; UserPrivilege, user permissions; UserLocked, whether it is locked. For example, taking the username test as an example, when the user executes the ipmi command to add a new user named test, a new object is registered on the second dbus interface by calling the createUser() function: /org/inspur/user/manager /test, this object will contain various non-sensitive information of the user, including user name, role, permission, lock status, etc.

在一些实施例中,还包括:In some embodiments, it also includes:

利用所述第二进程将所述用户信息同步到预设路径下的json文件。Use the second process to synchronize the user information to a json file in a preset path.

在一些实施例中,还包括:In some embodiments, it also includes:

响应于所述第二进程重新启动,所述第二进程读取所述json文件中的用户信息,并利用所述操作处理函数将所述json文件中的用户信息注册到所述dbus接口。In response to the restart of the second process, the second process reads the user information in the json file, and uses the operation processing function to register the user information in the json file with the dbus interface.

具体的,由于dbus接口接口是在内存中管理的,当BMC关机后或者重启后,数据会消失。所以在向dbus接口上添加或者修改用户信息时,还需同步一份用户数据信息保留在/etc/user-manager/userInfo.json文件中。这样,当BMC开机后,第二进程重新启动后会首先读取该文件,解析数据,以在第二dbus接口上生成用户对象。Specifically, since the dbus interface is managed in the memory, when the BMC is shut down or restarted, the data will disappear. Therefore, when adding or modifying user information on the dbus interface, a copy of user data information needs to be synchronized and kept in the /etc/user-manager/userInfo.json file. In this way, when the BMC is powered on, the second process will first read the file and parse the data after restarting, so as to generate a user object on the second dbus interface.

本发明提供的方案通过ipmid与user-managerd两个守护进程相配合,以dbus接口为介质,便形成了一个不依赖于数据库的用户管理方法。也即放弃了数据存储,设计了一种以dbus为介质的系统,不仅实现了用户的有效存储和处理,还实现了模块解耦,大大提升软件的健壮性、可维护性、无论是后期新需求开发、还是bug定位,都能显著提升效率。The scheme provided by the present invention forms a user management method that does not depend on a database by cooperating with two daemon processes, ipmid and user-managerd, and using the dbus interface as a medium. That is to say, data storage is abandoned, and a system with dbus as the medium is designed, which not only realizes the effective storage and processing of users, but also realizes the decoupling of modules, which greatly improves the robustness and maintainability of the software. Requirements development, or bug location, can significantly improve efficiency.

基于同一发明构思,根据本发明的另一个方面,本发明的实施例还提供了一种BMC的用户信息管理系统400,如图3所示,包括:Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a BMC userinformation management system 400, as shown in FIG. 3, including:

第一进程模块401,所述第一进程模块401配置为响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;Afirst process module 401, thefirst process module 401 is configured to use the first process to call a command processing function corresponding to the IPMI instruction in response to receiving the IPMI instruction for managing user information;

判断模块402,所述判断模块402配置为利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;Judgingmodule 402, the judgingmodule 402 is configured to use the command processing function to judge whether the user information corresponding to the IPMI instruction conforms to a preset rule;

第二进程模块403,所述第二进程模块403配置为响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;Thesecond process module 403, thesecond process module 403 is configured to call the operation processing function in the second process by the command processing function through the dbus interface in response to conforming to the preset rule;

注册修改模块404,所述注册修改模块404配置为利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。Aregistration modification module 404, theregistration modification module 404 is configured to use the operation processing function to register the user information to the dbus interface or to modify the corresponding user information on the dbus interface according to the user information.

基于同一发明构思,根据本发明的另一个方面,如图4所示,本发明的实施例还提供了一种计算机设备501,包括:Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 4 , an embodiment of the present invention further provides acomputer device 501, including:

至少一个处理器520;以及at least oneprocessor 520; and

存储器510,存储器510存储有可在处理器上运行的计算机程序511,处理器520执行程序时执行如上的任一种BMC的用户信息管理方法的步骤。Thememory 510 stores acomputer program 511 that can be executed on the processor. When theprocessor 520 executes the program, theprocessor 520 executes the steps of any of the above user information management methods of the BMC.

基于同一发明构思,根据本发明的另一个方面,如图5所示,本发明的实施例还提供了一种计算机可读存储介质601,计算机可读存储介质601存储有计算机程序指令610,计算机程序指令610被处理器执行时执行如上的任一种BMC的用户信息管理方法的步骤。Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 5 , an embodiment of the present invention further provides a computer-readable storage medium 601, where the computer-readable storage medium 601 storescomputer program instructions 610, and the computer When theprogram instructions 610 are executed by the processor, the steps of any of the above user information management methods of the BMC are performed.

最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the process in the method of the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, When the program is executed, it may include the flow of the embodiments of the above-mentioned methods.

此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。In addition, it should be understood that computer-readable storage media (eg, memory) herein can be volatile memory or non-volatile memory, or can include both volatile and non-volatile memory.

本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those skilled in the art will also appreciate that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends on the specific application and design constraints imposed on the overall system. Those skilled in the art may implement the functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.

以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments of the present disclosure, but it should be noted that various changes and modifications may be made without departing from the scope of the disclosure of the embodiments of the present invention as defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements disclosed in the embodiments of the present invention may be described or claimed in the singular, unless explicitly limited to the singular, the plural may also be construed.

应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that, as used herein, the singular form "a" is intended to include the plural form as well, unless the context clearly supports an exception. It will also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned embodiments of the present invention disclose the serial numbers of the embodiments only for description, and do not represent the advantages and disadvantages of the embodiments.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium can be read-only memory, magnetic disk or optical disk, etc.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope (including the claims) disclosed by the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention should be included within the protection scope of the embodiments of the present invention.

Claims (10)

Translated fromChinese
1.一种BMC的用户信息管理方法,其特征在于,包括以下步骤:1. a user information management method of BMC, is characterized in that, comprises the following steps:响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;In response to receiving the IPMI instruction for managing user information, use the first process to call the command processing function corresponding to the IPMI instruction;利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;Utilize the command processing function to determine whether the user information corresponding to the IPMI instruction conforms to the preset rule;响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;In response to conforming to the preset rule, the command processing function calls the operation processing function in the second process through the dbus interface;利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。The user information is registered to the dbus interface by using the operation processing function or the corresponding user information on the dbus interface is modified according to the user information.2.如权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising:利用所述第二进程将所述用户信息同步到预设路径下的json文件。Use the second process to synchronize the user information to a json file in a preset path.3.如权利要求2所述的方法,其特征在于,还包括:3. The method of claim 2, further comprising:响应于所述第二进程重新启动,所述第二进程读取所述json文件中的用户信息,并利用所述操作处理函数将所述json文件中的用户信息注册到所述dbus接口。In response to the restart of the second process, the second process reads the user information in the json file, and uses the operation processing function to register the user information in the json file with the dbus interface.4.如权利要求1所述的方法,其特征在于,响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数,进一步包括:4. The method of claim 1, wherein, in response to receiving the IPMI instruction for managing user information, utilizing the first process to call a command processing function corresponding to the IPMI instruction, further comprising:将多个命令处理函数封装到所述第一进程的全局数据结构变量中,且所述第一进程向系统bus接口挂接包括第一对象的第一dbus接口;encapsulating a plurality of command processing functions into the global data structure variable of the first process, and the first process attaches the first dbus interface including the first object to the system bus interface;响应于接收到所述IPMI指令,所述第一dbus接口的第一对象根据所述IPMI指令对应的指令码在所述全局数据结构变量中获取与所述IPMI指令对应的命令处理函数。In response to receiving the IPMI instruction, the first object of the first dbus interface obtains a command processing function corresponding to the IPMI instruction in the global data structure variable according to the instruction code corresponding to the IPMI instruction.5.如权利要求4所述的方法,其特征在于,响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数,进一步包括:5. The method of claim 4, wherein, in response to conforming to a preset rule, the command processing function calls an operation processing function in the second process through a dbus interface, further comprising:所述第二进程向系统bus接口挂接包括第二对象的第二dbus接口;The second process attaches to the system bus interface the second dbus interface including the second object;将所述多个操作处理函数封装到所述第二对象上以使所述命令处理函数通过所述第一dbus接口和所述第二dbus接口调用相应的操作处理函数。The plurality of operation processing functions are encapsulated on the second object, so that the command processing functions call corresponding operation processing functions through the first dbus interface and the second dbus interface.6.如权利要求5所述的方法,其特征在于,利用所述操作处理函数将所述用户信息注册到dbus接口,进一步包括:6. The method of claim 5, wherein the user information is registered to the dbus interface using the operation processing function, further comprising:利用所述第二对象上的操作处理函数在所述第二dbus接口上创建对应的用户对象并将所述用户信息注册到所述用户对象下的接口中。A corresponding user object is created on the second dbus interface by using the operation processing function on the second object, and the user information is registered in the interface under the user object.7.如权利要求6所述的方法,其特征在于,利用所述操作处理函数对所述dbus接口上对应的用户信息进行修改,进一步包括:7. The method of claim 6, wherein the operation processing function is used to modify the corresponding user information on the dbus interface, further comprising:利用所述第二对象上的操作处理函数根据所述用户信息修改对应的用户对象下的接口中的用户信息。The user information in the interface under the corresponding user object is modified according to the user information by using the operation processing function on the second object.8.一种BMC的用户信息管理系统,其特征在于,包括:8. a user information management system of BMC, is characterized in that, comprises:第一进程模块,所述第一进程模块配置为响应于接收到管理用户信息的IPMI指令,利用第一进程调用与所述IPMI指令对应的命令处理函数;a first process module, the first process module is configured to use the first process to call a command processing function corresponding to the IPMI instruction in response to receiving the IPMI instruction for managing user information;判断模块,所述判断模块配置为利用所述命令处理函数判断所述IPMI指令对应的用户信息是否符合预设规则;a judgment module, the judgment module is configured to use the command processing function to judge whether the user information corresponding to the IPMI instruction conforms to a preset rule;第二进程模块,所述第二进程模块配置为响应于符合预设规则,所述命令处理函数通过dbus接口调用第二进程中的操作处理函数;a second process module, the second process module is configured to, in response to conforming to a preset rule, the command processing function calls the operation processing function in the second process through the dbus interface;注册修改模块,所述注册修改模块配置为利用所述操作处理函数将所述用户信息注册到dbus接口或根据所述用户信息对所述dbus接口上对应的用户信息进行修改。A registration modification module, which is configured to use the operation processing function to register the user information to the dbus interface or to modify the corresponding user information on the dbus interface according to the user information.9.一种计算机设备,包括:9. A computer device comprising:至少一个处理器;以及at least one processor; and存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如权利要求1-7任意一项所述的方法的步骤。A memory, wherein the memory stores a computer program that can be executed on the processor, wherein the processor executes the steps of the method according to any one of claims 1-7 when the processor executes the program.10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行如权利要求1-7任意一项所述的方法的步骤。10. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method of any one of claims 1-7 is executed. step.
CN202010846567.6A2020-08-212020-08-21 A BMC user information management method, system, device and mediumActiveCN112130900B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010846567.6ACN112130900B (en)2020-08-212020-08-21 A BMC user information management method, system, device and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010846567.6ACN112130900B (en)2020-08-212020-08-21 A BMC user information management method, system, device and medium

Publications (2)

Publication NumberPublication Date
CN112130900Atrue CN112130900A (en)2020-12-25
CN112130900B CN112130900B (en)2023-01-06

Family

ID=73850453

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010846567.6AActiveCN112130900B (en)2020-08-212020-08-21 A BMC user information management method, system, device and medium

Country Status (1)

CountryLink
CN (1)CN112130900B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113127823A (en)*2021-03-262021-07-16山东英信计算机技术有限公司Method, system and medium for managing local serial port login and authority
CN115988050A (en)*2022-11-082023-04-18山东云海国创云计算装备产业创新中心有限公司Session-based IPMI communication method, system, storage medium and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170039151A1 (en)*2015-08-052017-02-09American Megatrends, Inc.Universal intelligent platform management interface (ipmi) host to baseboard management controller (bmc) communication for non-x86 and legacy free systems
US10289785B1 (en)*2016-09-152019-05-14Xilinx, Inc.Platform architecture creation for a system-on-chip
CN110413270A (en)*2019-07-122019-11-05苏州浪潮智能科技有限公司 A general method and device for creating dbus objects

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170039151A1 (en)*2015-08-052017-02-09American Megatrends, Inc.Universal intelligent platform management interface (ipmi) host to baseboard management controller (bmc) communication for non-x86 and legacy free systems
US10289785B1 (en)*2016-09-152019-05-14Xilinx, Inc.Platform architecture creation for a system-on-chip
CN110413270A (en)*2019-07-122019-11-05苏州浪潮智能科技有限公司 A general method and device for creating dbus objects

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
裴骁衢等: "智能管理平台接口研究及实现", 《计算机技术与发展》*

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113127823A (en)*2021-03-262021-07-16山东英信计算机技术有限公司Method, system and medium for managing local serial port login and authority
CN113127823B (en)*2021-03-262022-06-07山东英信计算机技术有限公司 A management method, system and medium for local serial port login and authority
CN115988050A (en)*2022-11-082023-04-18山东云海国创云计算装备产业创新中心有限公司Session-based IPMI communication method, system, storage medium and equipment

Also Published As

Publication numberPublication date
CN112130900B (en)2023-01-06

Similar Documents

PublicationPublication DateTitle
WO2019179453A1 (en)Virtual machine creation method and apparatus
CN104160378B (en) Method and system for enabling fault tolerance in a distributed computing system
CN115292026A (en) Container cluster management method, apparatus, device, and computer-readable storage medium
CN112714018B (en)Gateway-based ElasticSearch search service method, system, medium and terminal
WO2014190486A1 (en)Method and system for supporting resource isolation under multi-core architecture
CN111143023B (en)Resource changing method and device, equipment and storage medium
US20200045139A1 (en)Remote procedure call using quorum state store
CN117076096B (en)Task flow execution method and device, computer readable medium and electronic equipment
WO2021051881A1 (en)Vpp cluster management method and device, computer device and storage medium
CN115357198B (en) Storage volume mounting method and device, storage medium and electronic equipment
CN112130900B (en) A BMC user information management method, system, device and medium
CN111984561A (en) A kind of IPMI command processing method, system, device and medium of BMC
CN117827365A (en) Port allocation method, device, equipment, medium and product for application container
CN115981826B (en) Task scheduling processing method, device, computer equipment and readable storage medium
CN117909027A (en) Hierarchical container orchestration system and container orchestration method
CN111857984B (en) Job call processing method, device and computer equipment in banking system
CN117909028A (en) Hierarchical container orchestration system and container orchestration method
WO2018018459A1 (en)Policy processing method and device
CN103051623B (en)The method of calling of restriction open platform
CN114461410B (en)Method and device for realizing distributed lock, electronic equipment and storage medium
CN114691304A (en) Method and apparatus, device and medium for realizing high availability of cluster virtual machine
CN114443295A (en) A kind of heterogeneous cloud resource management scheduling method, device and system
WO2020000727A1 (en)Server, method for checking service data, and storage medium
CN110058866B (en) Cluster component installation method and equipment
CN112035295A (en)Virtual machine crash event processing method, system, terminal and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP03Change of name, title or address

Address after:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after:Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after:China

Address before:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before:SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before:China


[8]ページ先頭

©2009-2025 Movatter.jp