In-band communication method, system and related components

文档序号:1889030 发布日期:2021-11-26 浏览:20次 中文

阅读说明:本技术 一种带内通讯方法、系统及相关组件 (In-band communication method, system and related components ) 是由 刘刚 于 2021-07-31 设计创作,主要内容包括:本申请公开了一种带内通讯方法、系统及相关组件,用于实现智能平台管理接口通讯,该方法包括:通过串口设备文件建立CPU与BMC通讯的第一串口;在BMC中建立与IPMI模块进行数据传输的第二串口;对第一串口和第二串口设置相同的通讯参数;在BMC中建立第一串口和第二串口的映射关系;利用建立了映射关系的第一串口和第二串口,进行CPU和IPMI模块的数据通讯。本申请利用通用的串口设备文件建立第一串口,并通过建立第一串口和第二串口的映射关系实现CPU的通讯串口重定向,为CPU和IPMI模块的数据通讯提供了必要的前提条件,不需要考虑IPMI驱动的适配性,各类CPU均可使用本方案,操作成本低,具有较高的通用性。(The application discloses an in-band communication method, a system and related components, which are used for realizing intelligent platform management interface communication, and the method comprises the following steps: establishing a first serial port for communication between the CPU and the BMC through a serial port device file; establishing a second serial port for data transmission with the IPMI module in the BMC; setting the same communication parameters for the first serial port and the second serial port; establishing a mapping relation between a first serial port and a second serial port in the BMC; and carrying out data communication between the CPU and the IPMI module by utilizing the first serial port and the second serial port which establish the mapping relation. The method and the device have the advantages that the first serial port is established by utilizing the universal serial port equipment file, the communication serial port of the CPU is redirected by establishing the mapping relation between the first serial port and the second serial port, necessary precondition is provided for data communication between the CPU and the IPMI module, the suitability of IPMI drive does not need to be considered, various CPUs can use the scheme, the operation cost is low, and the universality is high.)

1. An in-band communication method is used for realizing intelligent platform management interface communication, and is characterized by comprising the following steps:

establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

establishing a second serial port for data transmission with the IPMI module in the BMC;

setting the same communication parameters for the first serial port and the second serial port;

establishing a mapping relation between the first serial port and the second serial port in the BMC;

and performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port which establish the mapping relation.

2. The in-band communication method of claim 1, wherein the first serial port and the second serial port are both UART serial ports.

3. The in-band communication method of claim 2, wherein the first serial port is a UART serial port based on a hardware channel protocol.

4. The in-band communication method of claim 1,

the communication parameters comprise baud rate, and/or data bits, and/or parity bits, and/or stop bits.

5. The in-band communication method of claim 1, wherein the serial device file is specifically a ttyS device file.

6. The in-band communication method according to claim 5, wherein the process of setting the same communication parameter for the first serial port and the second serial port comprises:

and respectively setting the same communication parameters for the first serial port and the second serial port through the ttyS device file.

7. The in-band communication method according to any one of claims 1 to 6, wherein the performing of the data communication between the CPU and the IPMI module by using the first serial port and the second serial port with the mapping relationship established includes:

obtaining IPMI data request instruction information of the CPU and packaging a serial port;

sending the IPMI data request instruction information after serial port encapsulation to the IPMI module through the first serial port and the second serial port which establish the mapping relation, so that the IPMI module executes the following operations:

serial port decapsulation is carried out on the IPMI data request instruction information;

determining IPMI response data corresponding to the IPMI data request instruction information;

and carrying out serial port packaging on the IPMI response data and sending the IPMI response data to the CPU through the first serial port and the second serial port.

8. The utility model provides an in-band communication system for realize intelligent platform management interface communication, its characterized in that includes:

the first module is used for establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

the second module is used for establishing a second serial port for data transmission with the IPMI module in the BMC;

the setting module is used for setting the same communication parameters for the first serial port and the second serial port;

the mapping module is used for establishing the mapping relation between the first serial port and the second serial port in the BMC;

and the communication module is used for performing data communication between the CPU and the IPMI module by utilizing the first serial port and the second serial port which establish the mapping relation.

9. The utility model provides an in-band communication device for realize intelligent platform management interface communication, its characterized in that includes:

a memory for storing a computer program;

a processor for implementing the steps of the in-band communication method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the in-band communication method according to any one of claims 1 to 7.

Technical Field

The invention relates to the field of host interaction, in particular to an in-band communication method, an in-band communication system and related components.

Background

Currently, IPMI (Intelligent Platform Management Interface) has become a new generation of universal Interface standard for intelligentizing hardware Management. The user may utilize the IPMI to monitor the physical characteristics of the server, such as temperature, voltage, fan operating status, power supply, etc. IPMI generally implements functions of monitoring data of each sensor and recording logs of various events by a BMC (Baseboard Management Controller). At present, the IPMI function of the BMC part is generally completed, but to achieve a better platform management effect, an OS (Operation System) is required to obtain IPMI information.

In order to enable the OS to obtain IPMI information, a conventional approach is to download and install an IPMI driver that is open on the internet in the OS, and the OS can exchange information with the BMC with the support of the IPMI driver. However, due to design differences of CPU (Central Processing Unit) chips, not all CPU chips supporting communication with the BMC can run IPMI drivers that are open on the internet.

Therefore, how to provide a solution to the above technical problems is a problem to be solved by those skilled in the art.

Disclosure of Invention

Accordingly, the present invention is directed to a method, system and related components for in-band communication. The specific scheme is as follows:

an in-band communication method is used for realizing intelligent platform management interface communication and comprises the following steps:

establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

establishing a second serial port for data transmission with the IPMI module in the BMC;

setting the same communication parameters for the first serial port and the second serial port;

establishing a mapping relation between the first serial port and the second serial port in the BMC;

and performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port which establish the mapping relation.

Preferably, the first serial port and the second serial port are both UART serial ports.

Preferably, the first serial port is a UART serial port based on a hardware channel protocol.

Preferably, the communication parameters include baud rate, and/or data bits, and/or parity bits, and/or stop bits.

Preferably, the serial device file is specifically a ttyS device file.

Preferably, the process of setting the same communication parameters for the first serial port and the second serial port includes:

and respectively setting the same communication parameters for the first serial port and the second serial port through the ttyS device file.

Preferably, the process of performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port with the mapping relationship established includes:

obtaining IPMI data request instruction information of the CPU and packaging a serial port;

sending the IPMI data request instruction information after serial port encapsulation to the IPMI module through the first serial port and the second serial port which establish the mapping relation, so that the IPMI module executes the following operations:

serial port decapsulation is carried out on the IPMI data request instruction information;

determining IPMI response data corresponding to the IPMI data request instruction information;

and carrying out serial port packaging on the IPMI response data and sending the IPMI response data to the CPU through the first serial port and the second serial port.

Correspondingly, this application still discloses communication system in-band for realize intelligent platform management interface communication, include:

the first module is used for establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

the second module is used for establishing a second serial port for data transmission with the IPMI module in the BMC;

the setting module is used for setting the same communication parameters for the first serial port and the second serial port;

the mapping module is used for establishing the mapping relation between the first serial port and the second serial port in the BMC;

and the communication module is used for performing data communication between the CPU and the IPMI module by utilizing the first serial port and the second serial port which establish the mapping relation.

Correspondingly, this application still discloses in-band communication device for realize intelligent platform management interface communication, include:

a memory for storing a computer program;

a processor for implementing the steps of the in-band communication method as described in any of the above when executing the computer program.

Accordingly, the present application also discloses a readable storage medium having a computer program stored thereon, which, when being executed by a processor, implements the steps of the in-band communication method according to any of the above.

The application discloses an in-band communication method for realizing intelligent platform management interface communication, which comprises the following steps: establishing a first serial port for communication between the CPU and the BMC through a serial port device file; establishing a second serial port for data transmission with the IPMI module in the BMC; setting the same communication parameters for the first serial port and the second serial port; establishing a mapping relation between the first serial port and the second serial port in the BMC; and performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port which establish the mapping relation. The method and the device have the advantages that the first serial port is established by utilizing the universal serial port equipment file, the communication serial port of the CPU is redirected by establishing the mapping relation between the first serial port and the second serial port, necessary precondition is provided for data communication between the CPU and the IPMI module, the suitability of IPMI drive does not need to be considered, various CPUs can use the scheme, the operation cost is low, and the universality is high.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

FIG. 1 is a flow chart illustrating steps of a method for in-band communication according to an embodiment of the present invention;

FIG. 2 is a flow chart illustrating sub-steps of an in-band communication method according to an embodiment of the present invention;

fig. 3 is a structural distribution diagram of an in-band communication system according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In order to enable the OS to obtain IPMI information, a conventional approach is to download and install an IPMI driver that is open on the internet in the OS, and the OS can exchange information with the BMC with the support of the IPMI driver. However, due to design differences of CPU chips, not all CPU chips supporting communication with BMC can run IPMI driver that is open source on the web.

The method and the device have the advantages that the first serial port is established by utilizing the universal serial port equipment file, the communication serial port of the CPU is redirected by establishing the mapping relation between the first serial port and the second serial port, necessary precondition is provided for data communication between the CPU and the IPMI module, the suitability of IPMI drive does not need to be considered, various CPUs can use the scheme, the operation cost is low, and the universality is high.

The embodiment of the invention discloses an in-band communication method, which is used for realizing intelligent platform management interface communication and comprises the following steps:

s1: establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

specifically, the first serial port is a UART serial port, and is a UART serial port based on a hardware channel protocol, where the hardware channel protocol includes, but is not limited to, LPC (Low Pin Count, Advanced High-performance Bus), AHB (Advanced High-performance Bus), and a serial device file, that is, a ttyS device file, and the device file is specifically located in a system application layer, and can perform corresponding read-write operations to achieve corresponding effects.

S2: establishing a second serial port for data transmission with the IPMI module in the BMC;

similarly, the second serial port is also a UART serial port, and is established through a ttyS device file in the BMC.

In addition, in this embodiment, the first serial port and the second serial port may also be implemented by using a virtual serial port virtual UART.

S3: setting the same communication parameters for the first serial port and the second serial port;

specifically, the communication parameters include baud rate, and/or data bits, and/or parity bits, and/or stop bits, and may also include other communication parameters, which are not limited herein.

Specifically, the means for setting the communication parameters is also to write the communication parameters into the device file corresponding to each serial port, that is, to set the same communication parameters for the first serial port and the second serial port respectively through the device file.

S4: establishing a mapping relation between a first serial port and a second serial port in the BMC;

it can be understood that, the mapping relationship is established here, which actually realizes the redirection of the CPU to the communication serial port in the BMC, and the mapping relationship is stored in the relevant register inside the BMC, and establishes the channel connection between the first serial port and the second serial port.

It can be understood that, because the establishing action bodies of the first serial port and the second serial port are different, the steps S1 and S2 are not required to have a definite action sequence, and the setting of step S3 may be to set the communication parameters of the next serial port to be the same as those of the previous serial port after any serial port is established. The step S4 is executed only after two serial ports are established, and the specific sequence of the serial ports and the sequence of the serial ports S3 is not mandatory. That is, in the method, the communication channel can be established only after steps S1-S4 are completed before S5 starts to work normally.

S5: and carrying out data communication between the CPU and the IPMI module by utilizing the first serial port and the second serial port which establish the mapping relation.

Further, referring to fig. 2, in step S5, the process of performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port with the mapping relationship established includes:

s51: obtaining IPMI data request instruction information of a CPU and packaging a serial port;

specifically, the IPMI data request instruction information is generated based on the IPMI protocol, and is usually generated by calling a function, which can be written by an open source ipmitool program.

S52: and sending the IPMI data request instruction information after the serial port encapsulation to the IPMI module through the first serial port and the second serial port which are established with the mapping relation, so that the IPMI module executes the steps S53-S55.

S53: carrying out serial port decapsulation on the IPMI data request instruction information;

s54: determining IPMI response data corresponding to the IPMI data request instruction information;

s55: and carrying out serial port packaging on the IPMI response data and sending the IPMI response data to the CPU through the first serial port and the second serial port.

It can be understood that, in this embodiment, serial port encapsulation of IPMI data request instruction information and IPMI response data can be implemented by calling a serial port data frame encapsulation function, actually, a frame header character and a frame tail character are added to the head and the tail of a data object, and when encapsulated information is received, it is necessary to perform decapsulation to obtain an information main body inside the data object. Furthermore, the IPMI data request instruction information and the IPMI response data are both based on an IPMI protocol, when the CPU receives the IPMI response data, serial port decapsulation is firstly carried out, then the IPMI response data are analyzed based on the IPMI protocol, and finally, visual and available data are obtained for subsequent processing of a client.

It can be understood that, in this embodiment, based on the LPC channel between the CPU and the BMC, most common server systems access the serial port function through LPC, and developers also often develop and use the serial port, so that the software development process related to the serial port is relatively simple, only the operations such as reading and writing related device files are required, and finally, an agent software or application software is obtained to implement the method, which is simple in software development and short in time consumption.

It can be understood that, in this embodiment, not only the IPMI driver is bypassed, but also the external serial port is not added, but also the common LPC channel used by the original BMC and the CPU is used, and on the basis of not increasing the hardware cost, a communication method for IPMI that is generally used for various CPUs is implemented.

The application discloses an in-band communication method for realizing intelligent platform management interface communication, which comprises the following steps: establishing a first serial port for communication between the CPU and the BMC through a serial port device file; establishing a second serial port for data transmission with the IPMI module in the BMC; setting the same communication parameters for the first serial port and the second serial port; establishing a mapping relation between the first serial port and the second serial port in the BMC; and performing data communication between the CPU and the IPMI module by using the first serial port and the second serial port which establish the mapping relation. The method and the device have the advantages that the first serial port is established by utilizing the universal serial port equipment file, the communication serial port of the CPU is redirected by establishing the mapping relation between the first serial port and the second serial port, necessary precondition is provided for data communication between the CPU and the IPMI module, the suitability of IPMI drive does not need to be considered, various CPUs can use the scheme, the operation cost is low, and the universality is high.

Correspondingly, the present application further discloses an in-band communication system, which is used for implementing the intelligent platform management interface communication, and as shown in fig. 3, the in-band communication system includes:

the first module 1 is used for establishing a first serial port for communication between the CPU and the BMC through a serial port device file;

the second module 2 is used for establishing a second serial port for data transmission with the IPMI module in the BMC;

the setting module 3 is used for setting the same communication parameters for the first serial port and the second serial port;

the mapping module 4 is used for establishing a mapping relation between the first serial port and the second serial port in the BMC;

and the communication module 5 is configured to perform data communication between the CPU and the IPMI module by using the first serial port and the second serial port in which the mapping relationship is established.

In the embodiment, the first serial port is established by using a universal serial port device file, the communication serial port of the CPU is redirected by establishing the mapping relation between the first serial port and the second serial port, necessary precondition is provided for the data communication between the CPU and the IPMI module, the suitability of IPMI drive is not required to be considered, various CPUs can use the scheme, the operation cost is low, and the universality is high.

In some specific embodiments, the first serial port and the second serial port are both UART serial ports.

In some specific embodiments, the first serial port is a UART serial port based on a hardware channel protocol.

In some embodiments, the communication parameters include baud rate, and/or data bits, and/or parity bits, and/or stop bits.

In some specific embodiments, the serial device file is specifically a ttyS device file. In some specific embodiments, the setting module 3 is specifically configured to:

and respectively setting the same communication parameters for the first serial port and the second serial port through the equipment file.

In some specific embodiments, the communication module 5 is specifically configured to:

obtaining IPMI data request instruction information of the CPU and packaging a serial port;

sending the IPMI data request instruction information after serial port encapsulation to the IPMI module through the first serial port and the second serial port which establish the mapping relation, so that the IPMI module executes the following operations:

serial port decapsulation is carried out on the IPMI data request instruction information;

determining IPMI response data corresponding to the IPMI data request instruction information;

and carrying out serial port packaging on the IPMI response data and sending the IPMI response data to the CPU through the first serial port and the second serial port.

Correspondingly, this application still discloses in-band communication device for realize intelligent platform management interface communication, include:

a memory for storing a computer program;

a processor for implementing the steps of the in-band communication method as described in any of the above when executing the computer program.

Accordingly, the present application also discloses a readable storage medium having a computer program stored thereon, which, when being executed by a processor, implements the steps of the in-band communication method according to any of the above.

In this embodiment, specific contents of the in-band communication method may refer to the related description in the above embodiments, and are not described herein again.

The technical effects of the in-band communication device and the readable storage medium in this embodiment are the same as those of the in-band communication method in the above embodiments, and are not described herein again.

Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The in-band communication method, system and related components provided by the present invention are described in detail above, and the principle and the implementation manner of the present invention are explained in this document by applying specific examples, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用户态下DMA数据缓存一致性方法、装置及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!