Equipment monitoring method and device, server and storage medium
By integrating MCTP and SMBus services in the server's BMC, monitoring state change events and encapsulating data, the problem of limited application scope of device monitoring methods in the prior art is solved, and widespread applicable monitoring of devices supporting MCTP protocol is achieved.
Patent Information
- Application Number
- CN202411919245.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The application scope of equipment monitoring methods in the prior art is limited, and it is impossible to effectively monitor equipment produced by different manufacturers that support different protocol analysis methods.
Monitoring of devices that support the MCTP protocol by integrating the Management Controller Transmission Protocol (MCTP) service and the System Management Bus (SMBus) service in the server's substrate management controller (BMC) can monitor state change events and encapsulate and send data according to the event type.
It realizes widespread applicable monitoring of server devices that support MCTP protocol, overcomes the problem that traditional methods are only applicable to specific manufacturers' equipment, and improves the flexibility and scope of equipment monitoring.
Smart Images

Figure CN119739592A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server equipment monitoring, and in particular to an equipment monitoring method, device, server and storage medium. Background Art
[0002] In server management, devices connected to or communicating with the server (referred to as server devices or server components, hereinafter referred to as devices) can be monitored in real time to achieve efficient management of the devices, which is the key to ensuring stable operation and rapid response of the system. However, as server functions are improved and the number of devices that need to be monitored and managed continues to increase, some traditional monitoring methods may not be able to meet the increasingly complex needs.
[0003] In the prior art, the device is usually monitored and managed based on the System Management Bus (SMBus). Usually, for a specific device produced by a manufacturer that supports a specific protocol parsing method, a device monitoring method is designed based on SMBus. However, for another device produced by another manufacturer that supports another protocol parsing method, a new device monitoring method needs to be developed.
[0004] Therefore, the scope of application of the equipment monitoring method in the related art is limited. Summary of the invention
[0005] An exemplary embodiment of the present application provides a device monitoring method, apparatus, server and storage medium. The method is not limited to application in monitoring specific equipment produced by a certain manufacturer and has a wide range of applications.
[0006] In a first aspect, an embodiment of the present application provides a device monitoring method, which is applied to a baseboard management controller BMC of a server, where the BMC provides a management controller transmission protocol MCTP service and a system management bus SMBus service, and the method includes:
[0007] Monitor the state change event through the MCTP service; wherein the triggering device of the state change event is any one of the N devices connected to the server through the SMBus bus; the N devices are all devices that support the MCTP protocol;
[0008] If the operation indicated by the state change event at the SMBus protocol layer is a read operation, encapsulating the data in the MCTP format in the first data corresponding to the read operation through the SMBus service, and sending the encapsulated data to the application service associated with the first data;
[0009] If the operation indicated by the state change event at the SMBus protocol layer is a write operation, the second data corresponding to the write operation is encapsulated into an SMBus-based MCTP format through the SMBus service and then written into the trigger device.
[0010] In an embodiment of the present application, a server connects N devices through at least one SMBus bus, and these N devices are all devices that support the MCTP protocol. For the monitoring process of these N devices, considering that the MCTP service has a wide range of applicability in different hardware platforms and communication environments, therefore, on the basis of the underlying SMBus service, the upper-layer MCTP service is integrated, so that the state change event can be monitored through the MCTP service, and the device that triggers the state change event can be called a trigger device, and the operation indicated by the state change event at the MCTP protocol layer at the SMBus protocol layer can be a read operation or a write operation. Therefore, when the operation indicated by the state change event at the SMBus protocol layer is a read operation, the data in the MCTP format in the first data corresponding to the read operation can be encapsulated through the SMBus service, and the encapsulated data can be sent to the application service associated with the first data; when the operation indicated by the state change event at the SMBus protocol layer is a write operation, the second data corresponding to the write operation is encapsulated into the MCTP format based on SMBus through the SMBus service and written to the trigger device. In this way, by applying the method in the embodiment of the present application, it is possible to monitor server devices that support the MCTP protocol, thereby overcoming the situation in the related art where a monitoring method is only applicable to devices produced by one manufacturer that support a set protocol or a private protocol, and has a wide range of applications.
[0011] In an optional embodiment, the method further includes:
[0012] The BMC detects the physical addresses of M devices; wherein the M devices are part of the N devices; the M devices are all connected to a first SMBus bus; the first SMBus bus is any one of a plurality of SMBus buses; M is less than or equal to N;
[0013] If it is determined that the physical addresses of the first device and the second device are the same, the BMC reallocates a physical address for the first device or the second device; wherein the first device and the second device are devices among the M devices.
[0014] In the above embodiment, when the physical addresses of devices connected to the same SMBus are the same, the physical addresses can be reallocated to ensure that the physical addresses of devices connected to the same SMBus are different, thereby overcoming the problem in the related art that monitoring cannot be performed when the physical addresses of the devices conflict.
[0015] In an optional implementation manner, the BMC reallocates a physical address for the first device or the second device, including:
[0016] The BMC selects an unused physical address from a first address conflict protocol ARP address pool and assigns it to a first device or a second device; wherein the first address conflict protocol ARP address pool is an ARP address pool associated with a first SMBus bus among multiple ARP address pools; the SMBus bus corresponds to the ARP address pool one by one; and the first address conflict protocol ARP address pool includes at least one available physical address.
[0017] In the above embodiment, the physical address conflict problem of the device is solved through ARP, which can meet the monitoring and management of the device when multiple devices are connected to the same SMBus.
[0018] In an optional embodiment, the method further includes:
[0019] BMC builds a dynamic routing chain table; the dynamic routing chain table includes the link information of each of the N devices; the link information of each device includes the node identification, link address, device type and part or all of the matching read and write methods of the device at the MCTP protocol layer;
[0020] BMC manages N devices based on a dynamic routing list.
[0021] The above embodiment realizes dynamic addition, deletion, modification and query of devices by designing a dynamic routing chain table. For devices that need to be monitored or managed, they are added to the dynamic routing chain table; for devices that do not need to be monitored or managed, they are deleted from the dynamic routing chain table. When a new device is added, there is no need to design a new monitoring method, which improves the efficiency of device monitoring.
[0022] In an optional embodiment, the method further includes:
[0023] BMC parses data packets in state change events according to the MCTP format;
[0024] The BMC searches the dynamic routing list based on the header information in the parsing result and determines the triggering device among the N devices.
[0025] In the above embodiment, since the link information of each of N devices is stored in the dynamic routing linked table, when there is a state change event, the data packet in the state change event can be directly parsed, and which device among the N devices is the triggering device can be determined based on the parsing result, thereby realizing the monitoring of the triggering device.
[0026] In an optional embodiment, the method further includes:
[0027] If a new device is detected to be connected to the server via the SMBus bus, or if any one of the N devices is detected to be disconnected from the SMBus bus, the BMC updates the dynamic routing list.
[0028] The above-mentioned embodiment designs an automatic update mechanism to realize automatic detection of hot plugging of devices and update of dynamic routing linked lists, thereby improving the adaptive capability of the monitoring method and more efficiently monitoring and managing the devices.
[0029] In an optional implementation, before the BMC monitors the state change event through the MCTP service, the method further includes:
[0030] The BMC starts the MCTP service and establishes an association between the MCTP service and the SMBus service.
[0031] The BMC starts the SMBus service and obtains bus link information and dynamic device information; the bus link information includes the number of SMBus buses and the number of devices connected to each SMBus bus; the dynamic device information includes the device type and function of each of the N devices connected through the SMBus bus.
[0032] In the above embodiment, the MCTP service and the SMBus service are started in advance, and the BMC can obtain the bus link information and the dynamic device information, so that the MCTP service and the SMBus service can directly apply the bus link information and the dynamic device information when monitoring the device, thereby improving the efficiency of device monitoring.
[0033] In a second aspect, an embodiment of the present application provides a device monitoring apparatus, which is applied to a server, and the apparatus includes:
[0034] A first service unit is configured to monitor a state change event through the MCTP service; wherein the triggering device of the state change event is any one of N devices connected to the server through the SMBus bus; and the N devices are all devices supporting the MCTP protocol;
[0035] A second service unit is configured to encapsulate the data in the MCTP format in the first data corresponding to the read operation through the SMBus service when the operation indicated by the state change event at the SMBus protocol layer is a read operation, and send the encapsulated data to the application service associated with the first data;
[0036] The second service unit is also used to encapsulate the second data corresponding to the write operation into an SMBus-based MCTP format through the SMBus service and then write it into the trigger device when the operation indicated by the state change event at the SMBus protocol layer is a write operation.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which implement the steps of any of the above methods when executed by a processor.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 The following is a schematic diagram showing the structure of a device monitoring system provided by an embodiment of the present application;
[0042] Figure 2 A flow chart of a device monitoring method provided by an embodiment of the present application is exemplarily shown;
[0043] Figure 3 A flowchart of a complete device monitoring method provided by an embodiment of the present application is exemplarily shown;
[0044] Figure 4 The following is a schematic diagram showing the structure of a device monitoring apparatus provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present application is exemplified. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0047] For ease of understanding, the terms involved in the embodiments of the present application are explained below:
[0048] (1) Baseboard Management Controller (BMC) is the basic core functional subsystem of the server, responsible for the server's hardware status management, operating system management, health status management, power consumption management and other core functions.
[0049] (2) System Management Bus (SMBus), a two-wire serial communication protocol for system management, is mainly used for communication between low-speed devices in embedded systems. It can be applied to low-speed communication in mobile computers and desktop computer systems. The SMBus is used to control devices on the motherboard and collect corresponding information. Usually, the SMBus is two lines set on the motherboard, connected to the device, and provides SMBus services based on the SMBus protocol.
[0050] (3) Management Component Transport Protocol (MCTP) is a standardized protocol for communication between different management controllers in a computer system. It has strong flexibility and scalability and can be used for communication between different management controllers and devices. Because the MCTP protocol can run on a variety of underlying transmission media, such as I 2 C. System Management Bus (SMBus), I 3 C, high-speed serial computer expansion bus standards (Peripheral Component Interconnect Express, PCIE), Universal Serial Bus (USB) and Ethernet, etc., so MCTP has wide applicability in different hardware platforms and communication environments.
[0051] (4) Address Resolution Protocol (ARP), also known as the address conflict protocol, is a network transmission protocol that finds the data link layer address by resolving the network layer address. Usually, when the device leaves the factory, its physical address may be the same. In the embodiment of the present application, in the processing process based on the SMBus bus, when the physical address conflicts, it can be resolved by dynamically allocating a new physical address so that each device has a unique physical address. The physical address here refers to the bus address. The device in the embodiment of the present application refers to a server device, that is, a device that communicates with the server, such as a network card or a graphics card.
[0052] (5) Unique Device Identifier (UDID): A unique identifier used to identify a specific device.
[0053] In the prior art, the device is usually monitored and managed based on the System Management Bus (SMBus). Usually, for a device produced by a manufacturer that supports a specific protocol parsing method, a device monitoring method is designed based on SMBus. However, for another device produced by another manufacturer that supports another protocol parsing method, the device monitoring method needs to be redesigned. This method of monitoring or managing devices has limitations, poor adaptability, and poor flexibility.
[0054] Specifically, the device detection method in the above prior art can be that the BMC performs simple data transmission and status monitoring through the SMBus, the device packages the status information into a data packet in a fixed format, and the device sends it to the BMC through the SMBus. The BMC parses the data packet and displays the corresponding device status. This method is simple to implement, but has poor versatility.
[0055] To this end, the embodiment of the present application provides a device monitoring method, which utilizes the characteristics of the MCTP service having wide applicability in different hardware platforms and communication environments, and the fact that there are many devices supporting the MCTP service. Therefore, on the basis of the underlying SMBus service, the upper-layer MCTP service is integrated to realize the monitoring and management of the device. In this way, it is possible to monitor the server device supporting the MCTP protocol, overcoming the situation in the related art that a monitoring method is only applicable to devices produced by one manufacturer that support a set protocol or a private protocol, and has a wide range of applications.
[0056] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0057] refer to Figure 1 , which is a schematic diagram of the structure of a device management system provided in an embodiment of the present application, the system includes a server and a device. The server includes a BMC, and the BMC provides MCTP service and SMBus service. The MCTP service runs on the underlying transmission medium SMBus based on the MCTP protocol. Among them, the SMBus bus is connected between the server motherboard and the device in the form of a physical bus.
[0058] Of course, the method provided in the embodiment of the present application is not limited to Figure 1The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.
[0059] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided in the embodiment of the present application.
[0060] Combine the following Figure 1 As shown, reference Figure 2 A flow chart of a device monitoring method is shown, the method is applied to a server, and the devices in the embodiments of the present application are all devices that support the MCTP protocol. The technical solution provided in the embodiments of the present application is described.
[0061] S201: The BMC monitors state change events through the MCTP service.
[0062] S202: If the operation indicated by the state change event at the SMBus protocol layer is a read operation, the BMC encapsulates the data in the MCTP format in the first data corresponding to the read operation through the SMBus service, and sends the encapsulated data to the application service associated with the first data.
[0063] S203: If the operation indicated by the state change event at the SMBus protocol layer is a write operation, the BMC encapsulates the second data corresponding to the write operation into an SMBus-based MCTP format through the SMBus service and writes the second data into the trigger device.
[0064] In an embodiment of the present application, a server connects N devices through at least one SMBus bus, and these N devices are all devices that support the MCTP protocol. For the monitoring process of these N devices, considering that the MCTP service has a wide range of applicability in different hardware platforms and communication environments, therefore, on the basis of the underlying SMBus service, the upper-layer MCTP service is integrated, so that the state change event can be monitored through the MCTP service, and the device that triggers the state change event can be called a trigger device, and the operation indicated by the state change event at the MCTP protocol layer at the SMBus protocol layer can be a read operation or a write operation. Therefore, when the operation indicated by the state change event at the SMBus protocol layer is a read operation, the data in the MCTP format in the first data corresponding to the read operation can be encapsulated through the SMBus service, and the encapsulated data can be sent to the application service associated with the first data; when the operation indicated by the state change event at the SMBus protocol layer is a write operation, the second data corresponding to the write operation is encapsulated into the MCTP format based on SMBus through the SMBus service and written to the trigger device. In this way, by applying the method in the embodiment of the present application, it is possible to monitor server devices that support the MCTP protocol, thereby overcoming the situation in the related art where a monitoring method is only applicable to devices produced by one manufacturer that support a set protocol or a private protocol, and has a wide range of applications.
[0065] Before executing the management of the device, a series of service startup and initialization operations can be performed so that the corresponding services can be used to manage the device later. Optionally, it can be achieved through steps A1-A2:
[0066] A1: BMC starts the MCTP service and establishes an association between the MCTP service and the SMBus service.
[0067] Among them, the SMBus bus is a low-level transmission medium, and the MCTP protocol can run on a variety of low-level transmission media, such as I 2 C, SMBus, I 3 C, PCIE, USB and Ethernet, etc. In the embodiment of the present application, the MCTP protocol runs on the SMBus. Therefore, after the BMC starts the MCTP service, an association relationship between the MCTP service and the SMBus service is established. In this way, the BMC can determine that the management process of the device is based on the SMBus protocol, not other protocols. This process is the initialization process of the MCTP protocol stack service. After the initialization is completed, a configuration file is generated, and the configuration file stores the association relationship between the MCTP service and the SMBus service.
[0068] A2: BMC starts the SMBus service and obtains bus link information and dynamic device information.
[0069] The bus link information includes the number of SMBus buses and the number of devices connected to each SMBus bus; the dynamic device information includes the device type and function of each of the N devices connected via the SMBus bus. Optionally, the device type may be a network card or a graphics card, etc.
[0070] In a specific example, the BMC can read the UDID of each device according to the SMBus specification, so that the type and function of the device can be determined.
[0071] After the MCTP service and SMBus service are started and initialized, the device management process can be executed.
[0072] In relation to S201, take a device to be monitored as an example, the device is any one of the N devices connected to the server via the SMBus bus. When the state of the device changes, for example, it is necessary to transmit data in the device to the server, or vice versa, a state change event is generated at the MCTP protocol layer. In this case, the device that triggers the state change event is called a triggering device. The BMC monitors the state change event through the MCTP service.
[0073] S202 is involved, which is called a state change event in the MCTP protocol layer, and the operation corresponding to the SMBus protocol layer indication may be a read operation or a write operation, wherein a read operation is data transmission from a device to a server, and a write operation is data transmission from a server to a device.
[0074] This step is mainly for the case of read operation. Specifically, in this case, the BMC obtains the first data corresponding to the read operation through the SMBus service. Since the first data is composed of different fields, including fields in the MCTP format and other fields, the data in the MCTP format in the first data is encapsulated, and the encapsulated data is sent to the application service associated with the first data. Optionally, the application service here is related to the type of the first data. For example, if the first data is display data, the application service can be a service for display. This is just an example and does not form a specific limitation.
[0075] In addition, since the server does not communicate directly with the device, but is implemented through the MCTP service and SMBus service provided by the BMC as a transfer, the data transmission between the server and the device involved here is just a simple description and does not form a specific limitation.
[0076] Involving S203, this step is for the case of a write operation. Specifically, in this case, the BMC encapsulates the second data corresponding to the write operation into an SMBus-based MCTP format through the SMBus service and then writes it into the trigger device.
[0077] Optionally, the reading and writing of data are both implemented by the BMC calling the SMBus driver.
[0078] Considering that the prior art cannot monitor devices with the same physical address, and many devices are configured with a default physical address when leaving the factory, which results in the same physical address of some devices connected to the same SMBus bus. Therefore, the embodiment of the present application provides an address conflict solution through APR, which can be implemented through steps B1-B2:
[0079] B1: BMC detects the physical addresses of M devices.
[0080] Among them, the server is connected to N devices supporting the MCTP protocol through the SMBus bus, and there are many SMBus buses. The physical addresses of devices connected to different SMBus buses are usually different, but the physical addresses of different devices connected to the same SMBus bus may be the same. Here, any one of them is used as an example for explanation. For example, the server is connected to M devices through the first SMBus bus. The BMC detects the physical addresses of these M devices.
[0081] B2: If it is determined that the physical addresses of the first device and the second device are the same, the BMC reallocates a physical address for the first device or the second device.
[0082] Optionally, if there are two devices with the same physical address among the M devices, the related art cannot implement monitoring of the two devices. In the embodiment of the present application, the BMC reallocates the physical address for the first device or the second device to ensure that the physical addresses of the devices connected to an SMBus bus are different, thereby ensuring the monitoring effect of the device.
[0083] Optionally, use ARP to implement the process of reallocating physical addresses:
[0084] Among them, the SMBus bus corresponds to the ARP address pool one by one. For example, if there are T SMBus buses, T ARP address pools are set. Each address pool includes at least one available physical address. In the embodiment of the present application, the first address conflict protocol ARP address pool (referred to as the first ARP address pool) corresponding to the first SMBus bus is used as an example for description.
[0085] The BMC selects an unused physical address from the first ARP address pool and allocates it to the first device or the second device. The allocation process can be randomly selected. In addition, whether the selected physical address is allocated to the first device or the second device is not limited, as long as the physical addresses of the devices connected to the same SMBus are different.
[0086] Therefore, in the embodiment of the present application, for a device with a physical address conflict, the problem can be solved by ARP to automatically allocate a new physical address, thereby solving the problem that the device with a physical address conflict cannot be monitored in the prior art.
[0087] As server functions are enhanced, the number of devices that need to be monitored and managed is increasing. In order to better meet the increasing load management requirements, the embodiment of the present application provides a method for constructing a dynamic routing chain table, which includes link information of N devices, and the link information includes the node identification, link address, device type, and matching read and write methods of each device at the MCTP protocol layer. Among them, the device type can be a network card, a graphics card, etc.
[0088] In actual application, a new device may be connected to the server via the SMBus bus, or a device that is already connected to the server via the SMBus bus may be removed (disconnected from the server, or connected to the server via other types of buses).
[0089] In the case of newly added devices, in the related art, it is necessary to redesign the monitoring method in combination with the device information of the newly added devices, which is cumbersome. In the embodiment of the present application, as long as the newly added device is a device that supports the MCTP protocol, the dynamic routing chain table can be directly updated based on the device of the device, and then the configuration information can be adaptively updated according to the updated dynamic routing chain table, so as to facilitate the MCTP service and SMBus call in the BMC. Dynamic management of devices is realized with strong adaptive capability.
[0090] In the case of device removal, the device-related information in the dynamic routing list is directly deleted to update the dynamic routing list.
[0091] Therefore, the dynamic routing list is automatically updated through the dynamic monitoring mechanism, thereby realizing the automatic addition and deletion of devices and realizing the unified management of devices.
[0092] Optionally, the trigger device in the above embodiment is determined by the following steps C1-C2:
[0093] C1: The BMC parses the data packet in the state change event according to the MCTP format.
[0094] Among them, the state change event corresponds to a data packet, which is transmitted to the BMC through the MCTP service, and the BMC can parse the data packet according to the MCTP format.
[0095] C1: The BMC searches the dynamic routing table based on the header information in the parsing result and determines the triggering device among the N devices.
[0096] The header information in the parsing result carries one or more information such as the node identification, link address, device type, and matching read / write mode of the device at the MCTP protocol layer, so that the BMC can search in the dynamic routing list according to the header information in the parsing result and determine the triggering device among the N devices.
[0097] Figure 3 A flowchart of a complete device monitoring method provided in an embodiment of the present application is provided. Figure 3 At least the following steps are included:
[0098] S301: Initialization.
[0099] Specifically, initialization may include three aspects: D1-D3:
[0100] D1: Protocol stack initialization.
[0101] Optionally, start the MCTP protocol stack service in the MCTP service, load the configuration file, and parse the configuration file to complete the initialization of the protocol stack.
[0102] D2: Bus link information initialization.
[0103] Optionally, scan the physical addresses of the SMBus links to check which physical addresses are on each SMBus link, and initialize the SMBus bus link information.
[0104] D3: Address pool initialization.
[0105] Optionally, the BMC may initialize the address pool according to the number of SMBus buses and the maximum number of devices on each bus, and put unused physical addresses into the address pool so that when resolving address conflicts, unused physical addresses can be obtained from the address pool for allocation.
[0106] S302: Physical address conflict resolution.
[0107] In the embodiment of the present application, after initialization is completed, the BMC can detect all devices on the SMBus bus, determine whether there are devices with the same physical address on the same SMBus bus, and when devices with the same physical address are detected on the same SMBus bus, an unused physical address (or an idle physical address) can be selected from the ARP address pool for reallocation.
[0108] S303: Differentiate between types and functions of server devices.
[0109] Optionally, the BMC may read the UDID of the server device according to the SMBus specification, and then distinguish the device type and device function of the device according to the UDID.
[0110] S304: Filter the devices added to the dynamic routing list.
[0111] Optionally, it can be determined whether the server device supports MCTP device communication. If the device supports MCTP, device nodes are generated for all devices supporting MCTP, and the access link address and device type of each device supporting MCTP are recorded. Then, all devices supporting MCTP are uniformly managed by a dynamic routing chain table.
[0112] S305: Forwarding of read and write data.
[0113] Optionally, it is possible to monitor in real time whether a state change event occurs. When a state change event occurs, the data packet in the state change event can be parsed, and the trigger device can be queried in the dynamic routing list according to the parsing result, and then the driver can be called to read and write the trigger device. When the read and write operation is completed, the information of the trigger device (the information corresponding to the read and write operation) can be updated.
[0114] Specifically, when MCTP detects a state change event, it can parse the header information of the data packet in the state change event according to MCTP, and then query the trigger device in the dynamic routing chain table according to the header information; SMBus can monitor whether there is a forwarding operation (read operation or write operation) for reading and writing data. If there is readable data, it is necessary to perform a read operation on the trigger device, then the data is directly read, and the header information and tail information of the data packet (filtering out the data in MCTP format) are removed and sent to the application service; if a write operation is required for the trigger device, the header information and tail information of the data packet are added, and the data is written to the trigger device. When performing read and write operations, the SMBus driver can be called to implement read and write operations on the trigger device.
[0115] Therefore, the embodiment of the present application, through a new architecture based on SMBus combined with MCTP, automatically detects the physical addresses of all devices supporting the MCTP protocol connected to the SMBus bus through the BMC, and realizes automatic monitoring of the device. For devices with physical address conflicts, the device physical address conflict resolution is realized through ARP, and a new physical address is automatically allocated. In addition, the embodiment of the present application can also support the dynamic self-adaptation capability of the device, and the dynamic routing chain table can be automatically updated for the newly added or removed devices, so as to realize efficient and flexible unified monitoring and management of various devices on the server.
[0116] like Figure 4As shown, based on the same inventive concept, an embodiment of the present application provides a device monitoring apparatus, which is applied to a server, and the apparatus includes a first service unit 41 and a second service unit 42 .
[0117] The first service unit 41 is used to monitor the state change event through the MCTP service; wherein the triggering device of the state change event is any one of the N devices connected to the server through the SMBus bus; the N devices are all devices that support the MCTP protocol;
[0118] The second service unit 42 is configured to encapsulate the data in the MCTP format in the first data corresponding to the read operation through the SMBus service when the operation indicated by the state change event at the SMBus protocol layer is a read operation, and send the encapsulated data to the application service associated with the first data;
[0119] The second service unit 42 is further configured to encapsulate the second data corresponding to the write operation into an SMBus-based MCTP format and then write the second data into the trigger device through the SMBus service when the operation indicated by the state change event at the SMBus protocol layer is a write operation.
[0120] In an optional embodiment, the device further includes a processing unit, and the processing unit is used to:
[0121] Detecting physical addresses of M devices; wherein the M devices are part of N devices; the M devices are all connected to a first SMBus bus; the first SMBus bus is any one of a plurality of SMBus buses; M is less than or equal to N;
[0122] If it is determined that the physical addresses of the first device and the second device are the same, the physical address is reallocated for the first device or the second device; wherein the first device and the second device are devices among the M devices.
[0123] In an optional implementation manner, the processing unit is specifically configured to:
[0124] An unused physical address is selected from a first address conflict protocol ARP address pool and assigned to a first device or a second device; wherein the first address conflict protocol ARP address pool is an ARP address pool associated with a first SMBus bus among multiple ARP address pools; the SMBus bus corresponds to the ARP address pool one-to-one; and the first address conflict protocol ARP address pool includes at least one available physical address.
[0125] In an optional implementation, the processing unit is further configured to:
[0126] Construct a dynamic routing chain table; wherein the dynamic routing chain table includes link information of each of N devices; the link information of each device includes a node identifier, a link address, a device type, and part or all of the matching read and write methods of the device at the MCTP protocol layer;
[0127] Based on the dynamic routing list, N devices are managed.
[0128] In an optional implementation, the processing unit is further configured to:
[0129] Parse the data packets in the state change event according to the MCTP format;
[0130] According to the header information in the parsing result, the dynamic routing list is searched to determine the triggering device among the N devices.
[0131] In an optional implementation, the processing unit is further configured to:
[0132] If a new device is detected to be connected to the server via the SMBus bus, or if any one of the N devices is detected to be disconnected from the SMBus bus, the dynamic routing linked list is updated.
[0133] In an optional implementation, before the BMC monitors the state change event through the MCTP service, the processing unit is further configured to:
[0134] Start the MCTP service and establish an association between the MCTP service and the SMBus service.
[0135] Start the SMBus service and obtain bus link information and dynamic device information; the bus link information includes the number of SMBus buses and the number of devices connected to each SMBus bus; the dynamic device information includes the device type and function of each of the N devices connected through the SMBus bus.
[0136] Since the device is the device in the method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0137] Based on the same inventive concept as the device monitoring method, the embodiment of the present application also provides a server, which can be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a cloud server, etc. Figure 5 As shown, the server may include a processor 51 and a memory 52 .
[0138] The processor 51 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0139] The memory 52 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 52 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0140] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; the above computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to: mobile storage devices, random access memory (RAM, Random Access Memory), magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)) and other media that can store program codes.
[0141] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: a mobile storage device, a random access memory (RAM, Random Access Memory), a magnetic storage device (such as a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical storage device (such as CD, DVD, BD, HVD, etc.), and a semiconductor memory (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), a solid-state drive (SSD)) and other various media that can store program codes.
[0142] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the device monitoring methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the device monitoring method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0143] The above embodiments are only used to introduce the technical solutions of the present application in detail, but the description of the above embodiments is only used to help understand the methods of the embodiments of the present application and should not be understood as limiting the embodiments of the present application. Any changes or substitutions that can be easily thought of by technicians in this technical field should be included in the protection scope of the embodiments of the present application.
Claims
1. A device monitoring method, characterized in that: Applied to a server, the server includes a baseboard management controller BMC, the BMC provides a management controller transmission protocol MCTP service and a system management bus SMBus service, the method includes: The BMC monitors the state change event through the MCTP service; wherein the triggering device of the state change event is any one of N devices connected to the server through the SMBus bus; the N devices are all devices supporting the MCTP protocol; If the operation indicated by the state change event at the SMBus protocol layer is a read operation, the BMC encapsulates the data in the MCTP format in the first data corresponding to the read operation through the SMBus service, and sends the encapsulated data to the application service associated with the first data; If the operation indicated by the state change event at the SMBus protocol layer is a write operation, the BMC encapsulates the second data corresponding to the write operation into an SMBus-based MCTP format through the SMBus service and writes the second data into the trigger device.
2. The method according to claim 1, characterized in that The method further comprises: The BMC detects the physical addresses of M devices; wherein the M devices are part of the N devices; the M devices are all connected to a first SMBus bus; the first SMBus bus is any one of a plurality of SMBus buses; M is less than or equal to N; If it is determined that the physical addresses of the first device and the second device are the same, the BMC reallocates a physical address for the first device or the second device; wherein the first device and the second device are devices among the M devices.
3. The method according to claim 2, characterized in that The BMC reallocates a physical address for the first device or the second device, including: The BMC selects an unused physical address from a first address conflict protocol ARP address pool and assigns it to the first device or the second device; wherein the first address conflict protocol ARP address pool is an ARP address pool associated with a first SMBus bus among multiple ARP address pools; the SMBus bus corresponds to the ARP address pool one by one; and the first address conflict protocol ARP address pool includes at least one available physical address.
4. The method according to claim 1, characterized in that: The method further comprises: The BMC constructs a dynamic routing chain table; wherein the dynamic routing chain table includes link information of each of the N devices; the link information of each device includes part or all of the node identification, link address, device type and matching read and write mode of the device at the MCTP protocol layer; The BMC manages the N devices based on the dynamic routing chain table.
5. The method according to claim 4, characterized in that The method further comprises: The BMC parses the data packet in the state change event according to the MCTP format; The BMC searches the dynamic routing list according to the header information in the parsing result, and determines the triggering device among the N devices.
6. The method according to claim 4, characterized in that The method further comprises: If a new device is detected to be connected to the server via the SMBus bus, or if any one of the N devices is detected to be disconnected from the SMBus bus, the BMC updates the dynamic routing linked table.
7. The method according to any one of claims 1 to 6, characterized in that: Before the BMC monitors the state change event through the MCTP service, the method further includes: The BMC starts the MCTP service and establishes an association relationship between the MCTP service and the SMBus service; The BMC starts the SMBus service and obtains bus link information and dynamic device information; wherein the bus link information includes the number of the SMBus buses and the number of devices connected to each SMBus bus; the dynamic device information includes the device type and function of each of the N devices connected via the SMBus bus.
8. An equipment monitoring device, characterized in that: Applied to a server, the device comprises: A first service unit is configured to monitor a state change event through the MCTP service; wherein the triggering device of the state change event is any one of N devices connected to the server through the SMBus bus; and the N devices are all devices supporting the MCTP protocol; A second service unit is configured to encapsulate the data in the MCTP format in the first data corresponding to the read operation through the SMBus service when the operation indicated by the state change event at the SMBus protocol layer is a read operation, and send the encapsulated data to the application service associated with the first data; The second service unit is also used to encapsulate the second data corresponding to the write operation into an SMBus-based MCTP format through the SMBus service and then write it into the trigger device when the operation indicated by the state change event at the SMBus protocol layer is a write operation.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Case management system and method based on NVME-MI
CN111459863A
Firmware updating method and device of equipment, server and storage medium
CN116578316A
Equipment management method and device for target equipment, equipment and storage medium
CN116578458A
Server daughter card monitoring method and device, computer equipment and storage medium
CN116795642A
Network card monitoring method, device, system and equipment of baseboard management controller
CN116881072A