Real-time data transmission method between CPU and BMC

Real-time data transfer between the CPU and BMC is realized through serial port equipment, solving the problem that the existing technology cannot obtain real-time data, real-time information transfer and user convenient acquisition, and reducing hardware costs.

CN119088592APending Publication Date: 2024-12-06SHANGHAI FAITH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411133230.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The prior art cannot realize real-time data transfer between the CPU and the BMC, and cannot obtain dynamic data such as version, process information, CPU occupancy rate and memory usage of the operating system, because the BIOS cannot transmit these data after startup.

Method used

Real-time data transfer between the CPU and BMC is realized through serial port device (ttyS2), and uses write, select, read and other functions to transmit and receive data, and ensures the consistency of data transmission through the tty_data structure, increasing the server and client to process serial port data .

Benefits of technology

Real-time data transfer to BMC by the CPU operating system is realized, reducing hardware costs and facilitating users to obtain real-time dynamic information, such as operating system version, process information, CPU occupancy rate and memory usage rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088592A_ABST
    Figure CN119088592A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time data transmission method between a CPU (Central Processing Unit) and a BMC (Baseboard Management Controller), which is characterized in that communication can be carried out by utilizing serial port equipment arranged on hardware between the BMC and the CPU in an existing hardware architecture, real-time data of an operating system of the CPU can be transmitted to the BMC only by adding a server side in the BMC and adding a client side in the operating system of the CPU, the hardware does not need to be redesigned, and the real-time data transmission efficiency is improved. Therefore, hardware cost is effectively reduced, real-time data transmission between the BMC and the CPU is achieved, and a user can conveniently obtain real-time dynamic information such as the version of an operating system, process information of the operating system, the real-time occupancy rate of the CPU, the real-time utilization rate of a memory and the real-time network speed of the operating system CPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transceiver, and in particular to a real-time data transmission method between a CPU and a BMC. Background Art

[0002] The server's BMC generally has a web page function, and customers can access the server's hardware information through the BMC's built-in web. In addition to accessing the server's hardware information, customers may need to access the real-time information of the CPU operating system in the BMC's web.

[0003] At present, BMC in the server can only obtain CPU information, memory information and hard disk information from SMBIOS through BIOS, that is, when BIOS is started. However, customers require real-time dynamic information, such as the operating system version, operating system process information, CPU real-time occupancy rate, memory real-time usage rate, operating system CPU real-time network speed, etc. Because after the BIOS is started, the operating system takes over the CPU, and the BIOS cannot transmit this data to the BMC. In view of this, the existing technology needs to be improved, and we propose a real-time data transmission method between the CPU and the BMC. Summary of the invention

[0004] In order to overcome the defects of the prior art, the present invention provides a real-time data transmission method between a CPU and a BMC, which effectively reduces hardware costs and facilitates users to obtain real-time information.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A real-time data transmission method between a CPU and a BMC, wherein the BMC and the CPU send and receive data in real time through a serial port device, specifically:

[0007] The BMC includes the following steps when sending and receiving data:

[0008] Step A1: Initialize the serial port device;

[0009] Step A2: Set the timeout time of the serial port device;

[0010] Step A3: Use the write function to send a command to obtain operating system data to the CPU through the serial port device;

[0011] Step A4: Use the select function to observe whether the serial port file descriptor changes in a non-blocking manner;

[0012] Step A5: When the operating system data is observed without timeout, the read function is used to receive the data;

[0013] Step A6: Verify the integrity of the received operating system data;

[0014] Step A7: If the data passes verification, it is filled into the corresponding array according to the format of the tty_data structure;

[0015] The CPU includes the following steps when sending and receiving data:

[0016] Step B1: Initialize the serial port device;

[0017] Step B2: Use the fcntl function to set the blocking mode to wait for the command sent by the BMC;

[0018] Step B3: Use the select function to observe whether the serial port file description has changed;

[0019] Step B4: Use the read function to read data from the serial port device;

[0020] Step B5: After receiving the command from the BMC, the CPU collects the data required by the BMC and arranges the data in the order of the tty_data array;

[0021] Step B6: Calculate the checksum value of all data;

[0022] Step B7: Write all the data to the serial port device in the order of the tty_data structure array, and then wait for the next command from the BMC to collect the operating system.

[0023] Furthermore, in step A1 and step B1, initializing the serial port device includes but is not limited to setting the baud rate, data bit, stop bit and check bit of the serial port device.

[0024] Furthermore, in step B5, when the CPU collects the data required by the BMC, it collects the data in the order of the tty_data array.

[0025] Furthermore, in step B5, bytes that are not sufficient for the length are padded with 0x4.

[0026] Furthermore, the serial port device is a ttyS2 serial port.

[0027] Due to the use of the above technical solution, the present invention has the beneficial effect that: the real-time data transmission method between the CPU and the BMC can communicate with the serial port device (ttyS2) provided on the hardware between the BMC and the CPU in the existing hardware architecture, and only needs to add a server end to the BMC and a client end to the CPU operating system to realize the real-time data transmission of the CPU operating system to the BMC, without the need to redesign the hardware, thereby effectively reducing the hardware cost, realizing the real-time data transmission between the BMC and the CPU, and facilitating users to obtain real-time dynamic information, such as the version of the operating system, the process information of the operating system, the real-time occupancy rate of the CPU, the real-time usage rate of the memory, the real-time network speed of the operating system CPU, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is the overall structural hardware framework diagram of the present invention;

[0029] Figure 2 It is a software flow diagram of BMC receiving and sending data in the present invention;

[0030] Figure 3 The software flow diagram of the CPU receiving and sending data in the present invention is shown in FIG. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] like Figure 1 As shown, there is a serial port device (ttyS2) between the BMC and the CPU in hardware for communication. The present invention proposes a technical solution, in which a thread is added to the BMC main process function (ipmimain) for processing serial port data. At the same time, a service program is also added to the CPU operating system to process the data of the serial port device. The BMC and the CPU use the same data structure (such as the following tty_data structure) in communication to ensure the consistency and convenience of data transmission, so that users can obtain real-time CPU dynamic information.

[0033] The data structure used by BMC and CPU is tty_data:

[0034] struct tty_data

[0035] {

[0036] service_pack_info

[24] , / *Software service pack version* /

[0037] os_version

[24] , / *Operating system version* /

[0038] ps_info

[32]

[64] , / *32 main process information, each with a maximum length of no more than 64 bytes* /

[0039] cpu_rate[8], / *CPU occupancy rate* /

[0040] dimm_rate[8], / *memory occupancy* /

[0041] net_rate[8], / *Current network speed* /

[0042] }

[0043] Furthermore, this embodiment provides a real-time data transmission method between a CPU and a BMC, wherein the BMC and the CPU send and receive data in real time through a serial port device, specifically:

[0044] like Figure 2 As shown, the BMC includes the following steps when sending and receiving data:

[0045] Step A1: Initialize the serial port device;

[0046] Step A2: Set the timeout time of the serial port device;

[0047] Step A3: Use the write function to send a command to obtain operating system data to the CPU through the serial port device;

[0048] Step A4: Use the select function to observe whether the serial port file descriptor changes in a non-blocking manner;

[0049] Step A5: When the operating system data is observed without timeout, the read function is used to receive the data;

[0050] Step A6: Verify the integrity of the received operating system data;

[0051] Step A7: If the data passes verification, it is filled into the corresponding array according to the format of the tty_data structure;

[0052] like Figure 3 As shown, the CPU includes the following steps when sending and receiving data:

[0053] Step B1: Initialize the serial port device;

[0054] Step B2: Use the fcntl function to set the blocking mode to wait for the command sent by the BMC;

[0055] Step B3: Use the select function to observe whether the serial port file description has changed;

[0056] Step B4: Use the read function to read data from the serial port device;

[0057] Step B5: After receiving the command from the BMC, the CPU collects the data required by the BMC and arranges the data in the order of the tty_data array;

[0058] Step B6: Calculate the checksum value of all data;

[0059] Step B7: Write all the data to the serial port device in the order of the tty_data structure array, and then wait for the next command from the BMC to collect the operating system.

[0060] In step A1 and step B1, initializing the serial port device includes but is not limited to setting the baud rate, data bit, stop bit and check bit of the serial port device.

[0061] In step B5, when the CPU collects the data required by the BMC, it collects the data in the order of the tty_data array.

[0062] In step B5, bytes that are not sufficient for the length are padded with 0x4.

[0063] It is not difficult to see from the above content that, using the existing hardware architecture, the serial port device (ttyS2) provided on the hardware between BMC and CPU can communicate. It only needs to add a server to BMC and a client to the CPU operating system to realize the real-time data transmission of CPU operating system to BMC. There is no need to redesign the hardware, thereby effectively reducing the hardware cost, realizing the real-time data transmission between BMC and CPU, and facilitating users to obtain real-time dynamic information, such as the version of the operating system, the process information of the operating system, the real-time CPU occupancy rate, the real-time memory usage rate, the real-time network speed of the operating system CPU, etc.

[0064] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A real-time data transmission method between CPU and BMC, characterized in that: The BMC and CPU send and receive data in real time through the serial port device. Specifically: The BMC includes the following steps when sending and receiving data: Step A1: Initialize the serial port device; Step A2: Set the timeout time of the serial port device; Step A3: Use the write function to send a command to obtain operating system data to the CPU through the serial port device; Step A4: Use the select function to observe whether the serial port file descriptor changes in a non-blocking manner; Step A5: When the operating system data is observed without timeout, the read function is used to receive the data; Step A6: Verify the integrity of the received operating system data; Step A7: If the data passes verification, it is filled into the corresponding array according to the format of the tty_data structure; The CPU includes the following steps when sending and receiving data: Step B1: Initialize the serial port device; Step B2: Use the fcntl function to set the blocking mode to wait for the command sent by the BMC; Step B3: Use the select function to observe whether the serial port file description has changed; Step B4: Use the read function to read data from the serial port device; Step B5: After receiving the command from the BMC, the CPU collects the data required by the BMC and arranges the data in the order of the tty_data array; Step B6: Calculate the checksum value of all data; Step B7: Write all the data to the serial port device in the order of the tty_data structure array, and then wait for the next command from the BMC to collect the operating system.

2. The real-time data transmission method between the CPU and the BMC according to claim 1, characterized in that: In step A1 and step B1, initializing the serial port device includes but is not limited to setting the baud rate, data bit, stop bit and check bit of the serial port device.

3. The real-time data transmission method between the CPU and the BMC according to claim 1, characterized in that: In step B5, when the CPU collects the data required by the BMC, it collects the data in the order of the tty_data array.

4. The real-time data transmission method between the CPU and the BMC according to claim 1, characterized in that: In step B5, bytes that are not sufficient for the length are padded with 0x4.

5. The real-time data transmission method between a CPU and a BMC according to any one of claims 1 to 4, characterized in that: The serial port device is the ttyS2 serial port.