A method, device, equipment and storage medium for monitoring the operation of a server FRU
By dynamically detecting and managing I2C expansion topology to generate virtual I2C buses for each channel, the method addresses the complexity of monitoring server FRUs with changing configurations, enabling direct management and accurate monitoring of FRU devices.
Patent Information
- Application Number
- CN202211368740.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-11-03
AI Technical Summary
The existing server FRU operation monitoring methods cannot adapt to dynamically changing component configurations, resulting in high complexity of monitoring programs and the inability to directly manage FRU devices.
By obtaining the I2C extender connection topology of the server, dynamically bind the driver to generate a virtual I2C bus, directly manage the FRU device, and reduce the complexity of the monitoring program.
It realizes effective operation monitoring and management of dynamically changing server FRU, reduces the complexity of the development of monitoring programs, and improves detection accuracy and efficiency.
Smart Images

Figure CN115617616B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a method, device, equipment and storage medium for monitoring the operation of a server FRU. Background Art
[0002] With the continuous development of Internet services, the hardware configuration of servers has become increasingly complex. For the increasingly flexible combination of server components, it is possible to detect the field replaceable units (FRUs) on the server to determine which components are in place, and then monitor the working status of the components in place. Considering that more and more components are connected to the Inter-Integrated Circuit (I2C), in order to avoid address conflicts, the erasable programmable read-only memories of multiple components can be connected to an I2C expander, and multiple I2C expanders can be further cascaded.
[0003] Currently, the existing method for monitoring the operation of a server FRU usually controls the main control chip of the Baseboard Management Controller (BMC), scans the erasable programmable read-only memories with FRU information on the I2C based on a pre-set I2C expander cascade configuration file to obtain the FRU devices on the server, and then indirectly monitors the operation of each FRU device by managing each I2C expander. However, in the prior art, based on the pre-set I2C expander cascade configuration file, only fixed component configurations are supported, and it is impossible to adapt to the dynamically changing server component configurations. Secondly, indirectly managing FRU devices through I2C expanders will increase the development complexity of the monitoring program. Summary of the Invention
[0004] The present invention provides a method, device, equipment and storage medium for monitoring the operation of a server FRU, which can effectively monitor the operation of a dynamically changing server FRU, can directly manage FRU devices, and thus can reduce the development complexity of the monitoring program.
[0005] According to an aspect of the present invention, there is provided a method for monitoring the operation of a server FRU, including:
[0006] Obtaining the connection topology of the Inter-Integrated Circuit (I2C) expander corresponding to the server;
[0007] According to the I2C expander connection topology, obtaining the driver programs corresponding to the I2C expanders, and generating virtual I2C buses matching each channel corresponding to each I2C expander through the driver programs corresponding to the I2C expanders;
[0008] Based on the virtual I2C buses matched with the respective channels of each of the I2C expanders, obtain at least one field replaceable unit (FRU) corresponding to the server, and the operating status corresponding to each of the FRUs.
[0009] Optionally, obtaining the I2C expander connection topology corresponding to the server includes:
[0010] Obtain at least one primary I2C expander corresponding to the server by sending I2C expander query messages to each address within a preset address range;
[0011] Obtain at least one primary channel corresponding to each of the primary I2C expanders by sending channel switching instructions to each of the primary I2C expanders;
[0012] Determine whether there is a subordinate I2C expander for each of the primary channels. If not, establish the I2C expander connection topology corresponding to the server based on the respective primary I2C expanders.
[0013] By adopting the above technical solution, accurate detection of the I2C expander can be achieved, thereby improving the accuracy of the obtained I2C expander connection topology.
[0014] Optionally, after determining whether there is a subordinate I2C expander for each of the primary channels, it further includes:
[0015] If so, obtain each secondary I2C expander corresponding to each of the primary I2C expanders, and each secondary channel corresponding to each of the secondary I2C expanders, and re-determine whether there is a subordinate I2C expander for each of the secondary channels until it is detected that there is no subordinate I2C expander for each current-level I2C expander, and obtain all the I2C expanders corresponding to the server;
[0016] Establish the I2C expander connection topology corresponding to the server based on all the I2C expanders corresponding to the server.
[0017] By adopting the above technical solution, the missed detection probability of the I2C expander can be reduced, the effective detection of all I2C expanders can be ensured, and the accuracy of the obtained I2C expander connection topology can be further improved.
[0018] Optionally, obtaining the driver corresponding to each I2C expander according to the I2C expander connection topology includes:
[0019] According to the I2C expander connection topology, obtain the data structure corresponding to each of the I2C expanders, and according to the data structure corresponding to each of the I2C expanders, obtain the driver corresponding to each of the I2C expanders.
[0020] By adopting the above technical solution, the corresponding driver can be dynamically bound to each I2C expander to establish a virtual I2C bus corresponding to each channel, enabling direct management and monitoring of the FRU and reducing the development complexity of the monitoring program.
[0021] Optionally, the data structure includes at least one of the address corresponding to the I2C expander, the number of channels corresponding to the I2C expander, the channel number through which the I2C expander is connected to the upper-level I2C expander, and the pointer pointing to the data structure corresponding to the upper-level I2C expander.
[0022] By adopting the above technical solution, an accurate description of the I2C expander connection topology can be achieved, adapting to the dynamically changing server component configuration.
[0023] Optionally, based on the virtual I2C buses matched with the channels corresponding to the I2C expanders, at least one field replaceable unit (FRU) corresponding to the server and the operating status corresponding to each FRU are obtained, including:
[0024] Based on the virtual I2C buses matched with the channels corresponding to the I2C expanders, the slave devices corresponding to the channels and the stored data matched with the memories of the slave devices are obtained;
[0025] If it is detected that the stored data matched with the memory of the current slave device conforms to the preset data rule, the current slave device is used as the current FRU, and based on the virtual I2C bus matched with the channel corresponding to the current slave device, the operating status corresponding to the current FRU is obtained.
[0026] By adopting the above technical solution, an accurate judgment of the FRU on the server can be achieved, thereby enabling accurate monitoring of the operating status of the FRU.
[0027] Optionally, based on the virtual I2C bus matched with the channel corresponding to the current slave device, obtaining the operating status corresponding to the current FRU includes:
[0028] Based on the virtual I2C bus matched with the channel corresponding to the current slave device, the status parameters corresponding to the current FRU are obtained;
[0029] If it is detected that the status parameters corresponding to the current FRU meet the preset status detection conditions, the operating status corresponding to the current FRU is obtained as the normal status.
[0030] By adopting the above technical solution, an accurate judgment of the operating status corresponding to the FRU can be achieved, thereby enabling accurate monitoring of the server operating status.
[0031] According to another aspect of the present invention, there is provided an operating monitoring device for a server FRU, including:
[0032] A connection topology acquisition module, configured to acquire an integrated circuit bus I2C expander connection topology corresponding to the server;
[0033] A virtual I2C bus generation module, configured to acquire driver programs corresponding to each I2C expander according to the I2C expander connection topology, and generate virtual I2C buses matching each channel corresponding to each I2C expander through the driver programs corresponding to each I2C expander;
[0034] An FRU acquisition module, configured to acquire at least one field replaceable unit FRU corresponding to the server and the operating status corresponding to each FRU based on the virtual I2C buses matching each channel corresponding to each I2C expander.
[0035] According to another aspect of the present invention, there is provided an electronic device, the electronic device including:
[0036] At least one processor; and
[0037] A memory communicatively connected to the at least one processor; wherein,
[0038] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the operating monitoring method of the server FRU according to any embodiment of the present invention.
[0039] According to another aspect of the present invention, there is provided a computer-readable storage medium, the computer-readable storage medium storing computer instructions, and the computer instructions are used to implement the operating monitoring method of the server FRU according to any embodiment of the present invention when executed by a processor.
[0040] In the technical solution of the embodiment of the present invention, by obtaining the connection topology of the integrated circuit bus I2C expander corresponding to the server, and according to the I2C expander connection topology, obtaining the driver corresponding to each I2C expander, and through the driver corresponding to each I2C expander, generating a virtual I2C bus that matches each channel corresponding to each I2C expander; then, based on the virtual I2C buses that match each channel corresponding to each I2C expander, obtaining multiple field replaceable units FRUs corresponding to the server, and the operating status corresponding to each FRU, by dynamically detecting the I2C expander connection topology, and binding the corresponding driver to each I2C expander to establish a virtual I2C bus that matches each channel, it is possible to effectively monitor the operation of the dynamically changing server FRUs, and it is possible to directly manage the FRU devices, thereby reducing the development complexity of the monitoring program.
[0041] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 is a flowchart of a method for monitoring the operation of a server FRU according to Embodiment 1 of the present invention;
[0044] Figure 2A is a flowchart of a method for monitoring the operation of a server FRU according to Embodiment 2 of the present invention;
[0045] Figure 2B is a schematic flowchart of a method for monitoring the operation of a server FRU according to Embodiment 2 of the present invention;
[0046] Figure 3 is a schematic structural diagram of a device for monitoring the operation of a server FRU according to Embodiment 3 of the present invention;
[0047] Figure 4 is a schematic structural diagram of an electronic device for implementing the method for monitoring the operation of a server FRU in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0049] It should be noted that the terms "first", "second", "target", etc. in the description and claims of the present invention and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0050] Embodiment 1
[0051] Figure 1 This is a flowchart of a method for monitoring the operation of a server FRU according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of detecting and monitoring the operation of each component of the server during the BMC startup phase. This method can be executed by a running monitoring device of the server FRU. The running monitoring device of the server FRU can be implemented in the form of hardware and / or software. The running monitoring device of the server FRU can be configured in an electronic device. Typically, the electronic device can be a computer device or a server. As Figure 1 shown, the method includes:
[0052] S110. Obtain the connection topology of the integrated circuit bus I2C expander corresponding to the server.
[0053] Among them, the I2C expander may include multiple channels, and each channel may be connected to multiple server components (such as Risers, hard disk backplanes, and power supply devices, etc.) or I2C expanders. Each server component can connect its own Electrically Erasable Programmable Read-Only Memory (EEPROM) chip to the I2C expander through a certain channel. Only when the corresponding channel is enabled can the BMC communicate with the corresponding EEPROM chip. Among them, the EEPROM chip can be a storage carrier for FRU information and communicate with other chips using I2C. In this embodiment, the number and connection relationship of the I2C expanders in the server are not specifically limited.
[0054] It should be noted that the addresses of the I2C expanders are all within a fixed address range (0x70 - 0x78). In this embodiment, all the currently included I2C expanders in the server and the connection relationship between the expanders can be detected based on the address range corresponding to the I2C expander, and an I2C expander connection topology can be established according to the connection relationship between the expanders.
[0055] S120. Obtain the driver programs corresponding to the I2C expanders according to the I2C expander connection topology, and generate virtual I2C buses matching each channel of each I2C expander through the driver programs corresponding to the I2C expanders.
[0056] In a specific example, a corresponding Linux driver program can be dynamically bound to each I2C expander according to the I2C expander connection topology; among them, the Linux driver program is used to create a corresponding virtual I2C bus for each channel of the corresponding I2C expander in the BMC system. Thus, for the EEPROM chips of the server components connected to each channel, the upper-layer monitoring program can directly communicate with them based on the corresponding virtual I2C bus.
[0057] S130. Based on the virtual I2C buses matching each channel of each I2C expander, obtain at least one Field Replaceable Unit (FRU) corresponding to the server and the operating status of each FRU.
[0058] Among them, the Field Replaceable Unit (FRU) can be a component that can be flexibly configured in the server, such as a hard disk backplane, a power supply device, etc.
[0059] Specifically, based on the virtual I2C buses matched to each channel, the stored information in the EEPROM chips of the server components connected to each channel can be read. After that, the stored information can be verified to determine whether it conforms to the data format of the FRU information. If it is detected that the stored information corresponding to a certain server component conforms to the data format of the FRU information, then this server component can be determined as an FRU device, and device information such as the device model and product name of this FRU device can be obtained based on the stored information.
[0060] After that, based on the virtual I2C bus with this FRU device, the corresponding operating status of this FRU device can be obtained to achieve the operation monitoring of the FRU device. For example, the status parameters of the FRU device can be obtained based on the virtual I2C bus. For example, temperature, voltage, etc. When it is detected that each status parameter is within the preset range of status parameters, the operating status can be determined as the normal status; if it is detected that there is a status parameter exceeding the preset range of status parameters, the operating status can be determined as the abnormal status.
[0061] The technical solution of the embodiment of the present invention obtains the connection topology of the integrated circuit bus I2C expander corresponding to the server, and according to the I2C expander connection topology, obtains the driver programs corresponding to each I2C expander, and through the driver programs corresponding to each I2C expander, generates the virtual I2C buses matched to each channel corresponding to each I2C expander; after that, based on the virtual I2C buses matched to each channel corresponding to each I2C expander, obtains multiple field replaceable units FRUs corresponding to the server and the corresponding operating status of each FRU. By dynamically detecting the I2C expander connection topology and binding the corresponding driver program to each I2C expander to establish the virtual I2C buses matched to each channel, the effective operation monitoring of the dynamically changing server FRUs can be realized, the direct management of the FRU devices can be realized, and thus the development complexity of the monitoring program can be reduced.
[0062] In an optional implementation manner of this embodiment, obtaining the connection topology of the integrated circuit bus I2C expander corresponding to the server may include:
[0063] By sending I2C expander query messages to each address within a preset address range, at least one primary I2C expander corresponding to the server is obtained;
[0064] By sending channel switching instructions to each of the primary I2C expanders, at least one primary channel corresponding to each of the primary I2C expanders is obtained;
[0065] Determine whether there is a secondary I2C expander for each of the primary channels. If not, based on each of the primary I2C expanders, establish the I2C expander connection topology corresponding to the server.
[0066] Among them, the preset address range can be the range of I2C extender deployment addresses. Typically, it can be 0x70 - 0x78. In a specific example, I2C extender query messages can be sequentially sent to each address within the preset address range. If a feedback confirmation message (e.g., ACK message) is received for the current address, it can be determined that there is an I2C extender at the current address. Thus, multiple primary I2C extenders corresponding to the server can be obtained. Among them, the primary I2C extender can be the I2C extender located at the top layer in the I2C extender cascade network.
[0067] Specifically, after obtaining each primary I2C extender, for each I2C extender, a channel switching instruction can be executed respectively, and according to the instruction execution result, the corresponding primary channels and the number of channels can be obtained. Further, it can be determined whether there is a subordinate I2C extender after each primary channel. In one case, if it is determined that there is no subordinate I2C extender after each primary channel, that is, the current server only includes one layer of I2C extenders, an I2C extender connection topology corresponding to the server can be directly created based on each primary I2C extender.
[0068] In this embodiment, based on the preset address range and the channel switching instruction, accurate detection of the I2C extenders in the server can be achieved, thereby improving the accuracy of the obtained I2C extender connection topology.
[0069] In another alternative embodiment of this embodiment, after determining whether there is a subordinate I2C extender in each of the primary channels, it may further include:
[0070] If so, obtain each secondary I2C extender corresponding to each of the primary I2C extenders, and each secondary channel corresponding to each of the secondary I2C extenders, and re-determine whether there is a subordinate I2C extender in each of the secondary channels until it is detected that there is no subordinate I2C extender in each current-level I2C extender, and obtain all the I2C extenders corresponding to the server;
[0071] Establish an I2C extender connection topology corresponding to the server according to all the I2C extenders corresponding to the server.
[0072] In another case, if it is determined that there are lower-level I2C expanders for each first-level I2C expander, one or more second-level I2C expanders corresponding to each first-level I2C expander, and multiple second-level channels corresponding to each second-level I2C expander can be continuously obtained based on a preset address range and a channel switching instruction. After that, each second-level channel can be further detected for lower-level I2C expanders, and the above process can be repeated until it is detected that there are no lower-level I2C expanders for each current-level I2C expander, that is, the current-level I2C expander is the bottommost I2C expander, so as to finally obtain all the I2C expanders of the current server and the connection relationship between the I2C expanders. After that, an I2C expander connection topology corresponding to the server can be established based on the I2C expanders and the connection relationship between the I2C expanders.
[0073] In another alternative implementation manner of this embodiment, obtaining the driver corresponding to each I2C expander according to the I2C expander connection topology may include:
[0074] According to the I2C expander connection topology, obtain the data structure corresponding to each I2C expander, and according to the data structure corresponding to each I2C expander, obtain the driver corresponding to each I2C expander.
[0075] Among them, the data structure may include at least one of the address corresponding to the I2C expander, the number of channels corresponding to the I2C expander, the channel number through which the I2C expander is connected to the upper-level I2C expander, and the pointer pointing to the data structure corresponding to the upper-level I2C expander. The pointer can be used to query the information of the upper-level I2C expander. It can be understood that for the first-level I2C expander, the content of its corresponding data structure may only include the address corresponding to the I2C expander and the number of channels corresponding to the I2C expander.
[0076] In this embodiment, the connection topology relationship between the I2C expanders can be described by using the data structure corresponding to each I2C expander, and a corresponding driver can be dynamically bound to each I2C expander according to the data structure corresponding to each I2C expander. Among them, the driver may be a Linux driver, which is used to establish a corresponding virtual I2C bus for each channel of the I2C expander.
[0077] In this embodiment, by dynamically binding a corresponding driver to each I2C expander, it can be avoided that the monitoring program indirectly manages each FRU device through the I2C expander, and direct management of the FRU device can be realized, thereby reducing the development complexity of the monitoring program.
[0078] Secondly, in the prior art, for two types of components that use the same I2C slave device address and I2C bus number but different I2C expander chip models (such as PCA9543, PCA9546, PCA9548, etc.), it is impossible to achieve simultaneous support by pre-configuring the Linux kernel device tree. In this embodiment, by detecting the I2C expander connection topology in real time, it is possible to avoid the need to pre-plan the I2C expander chip model, I2C device address, I2C bus number, and cascading topology relationship in the kernel device tree in advance. Therefore, it can adapt to dynamic and changing configuration requirements.
[0079] Embodiment 2
[0080] Figure 2A The flowchart of a method for monitoring the operation of a server FRU provided in Embodiment 2 of the present invention. This embodiment further refines the above technical solution, and the technical solution in this embodiment can be combined with one or more of the above embodiments. As Figure 2A shown, the method includes:
[0081] S210. Obtain at least one primary I2C expander corresponding to the server by sending I2C expander query messages to each address within a preset address range.
[0082] S220. Obtain at least one primary channel corresponding to each of the primary I2C expanders by sending channel switching instructions to each of the primary I2C expanders.
[0083] S230. Determine whether there is a secondary I2C expander for each of the primary channels. If so, obtain each secondary I2C expander corresponding to each of the primary I2C expanders, and each secondary channel corresponding to each of the secondary I2C expanders, and re-determine whether there is a secondary I2C expander for each of the secondary channels until it is detected that there is no secondary I2C expander for each current-level I2C expander, and obtain all the I2C expanders corresponding to the server.
[0084] Optionally, if it is determined that there is no secondary I2C expander for each primary channel, the I2C expander connection topology corresponding to the server can be directly established according to each primary I2C expander.
[0085] S240. Establish the I2C expander connection topology corresponding to the server according to all the I2C expanders corresponding to the server.
[0086] S250. Obtain the driver corresponding to each I2C expander according to the I2C expander connection topology, and generate a virtual I2C bus matching each channel corresponding to each I2C expander through the driver corresponding to each I2C expander.
[0087] Optionally, after obtaining the I2C expander connection topology, the upper-layer monitoring program can also be used to directly manage the channel switches of each I2C expander to implement the detection and operation monitoring of FRU devices. Secondly, for the multi-thread scenario, locking processing can be performed for I2C expander operations.
[0088] S260. Based on the virtual I2C buses matched with the respective channels corresponding to the respective I2C expanders, obtain the slave devices corresponding to the respective channels, and the stored data matched with the memories corresponding to the respective slave devices.
[0089] Among them, the slave device can be a server component connected to each channel; the stored data matched with the memory corresponding to the slave device can be the device information stored in the EEPROM corresponding to the server component. In this embodiment, direct communication can be performed with the memories corresponding to the respective slave devices based on the virtual I2C buses matched with the respective channels, so that the stored data matched with the memories can be read.
[0090] S270. If it is detected that the stored data matched with the memory corresponding to the current slave device conforms to a preset data rule, then use the current slave device as the current FRU, and based on the virtual I2C bus matched with the channel corresponding to the current slave device, obtain the operating state corresponding to the current FRU.
[0091] Among them, the preset data rule can be the data format corresponding to the FRU information set in advance. For example, it can be the specified device name, device model, etc. In a specific example, the device name or device model field value can be extracted from the stored data, and the extracted field value is matched with the preset data rule. If it is determined that the match is successful, the current slave device can be determined as the current FRU. After determining that the current slave device is an FRU device, the operating state corresponding to the current FRU can be obtained based on the virtual I2C bus corresponding to the current slave device to perform targeted management and monitoring on the current FRU.
[0092] In addition, if it is detected that the stored data matched with the memory corresponding to the current slave device does not conform to the preset data rule, it means that the current slave device is not an FRU device, that is, flexible configuration cannot be performed. In this embodiment, for non-FRU devices, operation monitoring may not be performed.
[0093] In the technical solution of the embodiment of the present invention, after obtaining the I2C extender connection topology corresponding to the server, according to the I2C extender connection topology, obtain the driver corresponding to each I2C extender, and generate a virtual I2C bus matching each channel corresponding to each I2C extender through the driver corresponding to each I2C extender; then, based on the virtual I2C buses matching each channel corresponding to each I2C extender, obtain the slave devices corresponding to each channel and the stored data matching the memory of each slave device; if it is detected that the stored data matching the memory of the current slave device conforms to the preset data rule, then use the current slave device as the current FRU, and based on the virtual I2C bus matching the channel corresponding to the current slave device, obtain the operating state corresponding to the current FRU; by detecting the stored data based on the preset data rule, accurate judgment of the FRU on the server can be realized, and thus accurate monitoring of the operating state of the FRU can be realized.
[0094] In an optional implementation manner of this embodiment, obtaining the operating state corresponding to the current FRU based on the virtual I2C bus matching the channel corresponding to the current slave device may include:
[0095] Obtain the state parameters corresponding to the current FRU based on the virtual I2C bus matching the channel corresponding to the current slave device;
[0096] If it is detected that the state parameters corresponding to the current FRU meet the preset state detection conditions, then obtain the operating state corresponding to the current FRU as the normal state.
[0097] Among them, the state parameters may include temperature, voltage, current, etc. The preset state detection conditions may be the previously set state parameter ranges. When the state parameters corresponding to a certain FRU are within this state parameter range, it can be determined that the preset state detection conditions are met.
[0098] In this embodiment, the state parameters corresponding to the current FRU can be obtained in real time based on the virtual I2C bus, and it is judged whether the state parameters meet the preset state detection conditions; if so, it can be determined that the current FRU is in the normal state; and if the state parameters do not meet the preset state detection conditions, it can be determined that the current FRU is in the abnormal state.
[0099] In a specific implementation manner of this embodiment, the flow of the method for monitoring the operation of the server FRU can be as Figure 2BAs shown below. First, detect the I2C expanders to obtain each primary I2C expander and the number of channels of each I2C expander. Then, detect each channel separately and determine whether there is a subordinate I2C expander on the channel according to the detection result. If it is determined that there is a subordinate I2C expander, return to continue detecting the I2C expander until it is detected that there is no subordinate I2C expander on each channel of the current-level I2C expander.
[0100] If it is determined that there is no subordinate I2C expander on each channel, create an I2C expander connection topology, and bind the corresponding Linux driver to each I2C expander according to the I2C expander connection topology to generate a virtual I2C bus corresponding to each channel. Finally, based on each virtual I2C bus, detect and obtain each FRU device corresponding to the server, and monitor the operation of each FRU device.
[0101] The technical solution of the embodiment of the present invention can automatically detect all I2C expanders and FRU devices on the I2C bus during the BMC startup phase, which can improve the convenience of identifying and monitoring components. Compared with the conventional technology, there is no need to pre-set a specific configuration file, and only through the dynamic detection during program operation, the FRU device can be successfully discovered in a complex I2C topology, and accurate and efficient detection of the FRU on the server can be achieved. Secondly, when there is an I2C topology change caused by a component type change or a motherboard I2C topology change caused by a project design change, automatic adaptation can be achieved without any code modification, which can greatly reduce the maintenance workload.
[0102] Embodiment Three
[0103] Figure 3 It is a schematic structural diagram of an operating monitoring device for a server FRU provided by Embodiment Three of the present invention. As Figure 3 shown, the device includes: a connection topology acquisition module 310, a virtual I2C bus generation module 320, and an FRU acquisition module 330; wherein,
[0104] The connection topology acquisition module 310 is used to acquire the integrated circuit bus I2C expander connection topology corresponding to the server;
[0105] The virtual I2C bus generation module 320 is used to obtain the driver corresponding to each I2C expander according to the I2C expander connection topology, and generate a virtual I2C bus matching each channel corresponding to each I2C expander through the driver corresponding to each I2C expander;
[0106] The FRU acquisition module 330 is configured to acquire at least one field replaceable unit (FRU) corresponding to the server and the operating status of each FRU based on the virtual I2C buses respectively matched with the channels of the respective I2C expanders.
[0107] In the technical solution of the embodiment of the present invention, by acquiring the connection topology of the integrated circuit bus (I2C) expanders corresponding to the server, and according to the I2C expander connection topology, acquiring the driver programs corresponding to the respective I2C expanders, and generating, through the driver programs corresponding to the respective I2C expanders, virtual I2C buses respectively matched with the channels of the respective I2C expanders; thereafter, based on the virtual I2C buses respectively matched with the channels of the respective I2C expanders, acquiring a plurality of field replaceable units (FRUs) corresponding to the server and the operating status of each FRU, by dynamically detecting the I2C expander connection topology and binding a corresponding driver program to each I2C expander to establish virtual I2C buses respectively matched with the channels, it is possible to effectively monitor the operation of the dynamically changing server FRUs, and it is possible to directly manage the FRU devices, thereby reducing the development complexity of the monitoring program.
[0108] Optionally, the connection topology acquisition module 310 includes:
[0109] The primary I2C expander acquisition unit is configured to acquire at least one primary I2C expander corresponding to the server by sending I2C expander query messages to each address within a preset address range.
[0110] The primary channel acquisition unit is configured to acquire at least one primary channel corresponding to each of the primary I2C expanders by sending channel switching instructions to the respective primary I2C expanders.
[0111] The connection topology establishment unit is configured to determine whether there are secondary I2C expanders subordinate to each of the primary channels, and if not, establish the I2C expander connection topology corresponding to the server according to the respective primary I2C expanders.
[0112] Optionally, the connection topology acquisition module 310 further includes:
[0113] The all I2C expander acquisition unit is configured to, if so, acquire the respective secondary I2C expanders corresponding to the respective primary I2C expanders and the respective secondary channels corresponding to the respective secondary I2C expanders, and re-determine whether there are secondary I2C expanders subordinate to each of the secondary channels until it is detected that there are no secondary I2C expanders subordinate to each current-level I2C expander, and acquire all the I2C expanders corresponding to the server.
[0114] The connection topology establishment unit is further configured to establish an I2C expander connection topology corresponding to the server according to all the I2C expanders corresponding to the server.
[0115] Optionally, the virtual I2C bus generation module 320 is specifically configured to obtain data structures corresponding to the I2C expanders according to the I2C expander connection topology, and obtain driver programs corresponding to the I2C expanders according to the data structures corresponding to the I2C expanders.
[0116] Optionally, the data structure includes at least one of the address corresponding to the I2C expander, the number of channels corresponding to the I2C expander, the channel number by which the I2C expander is connected to the upper-level I2C expander, and a pointer pointing to the data structure corresponding to the upper-level I2C expander.
[0117] Optionally, the FRU acquisition module 330 includes:
[0118] A stored data acquisition unit, configured to obtain slave devices corresponding to the channels and stored data matched with the memories of the slave devices according to the virtual I2C buses matched with the channels corresponding to the I2C expanders.
[0119] An operating state acquisition unit, configured to use the current slave device as the current FRU if it is detected that the stored data matched with the memory of the current slave device conforms to a preset data rule, and obtain the operating state corresponding to the current FRU according to the virtual I2C bus matched with the channel corresponding to the current slave device.
[0120] Optionally, the operating state acquisition unit is specifically configured to obtain state parameters corresponding to the current FRU according to the virtual I2C bus matched with the channel corresponding to the current slave device.
[0121] If it is detected that the state parameters corresponding to the current FRU satisfy a preset state detection condition, obtain the operating state corresponding to the current FRU as a normal state.
[0122] The server FRU operation monitoring device provided by the embodiments of the present invention can execute the server FRU operation monitoring method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0123] Embodiment 4
[0124] Figure 4The structural schematic diagram of an electronic device 40 that can be used to implement the embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0125] As Figure 4 shown, the electronic device 40 includes at least one processor 41, and a memory communicatively connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc. The memory stores a computer program executable by the at least one processor. The processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. The input / output (I / O) interface 45 is also connected to the bus 44.
[0126] Multiple components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0127] The processor 41 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as the operation monitoring method of the server FRU.
[0128] In some embodiments, the method for monitoring the operation of the server FRU can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the method for monitoring the operation of the server FRU described above can be performed. Alternatively, in other embodiments, the processor 41 can be configured to perform the method for monitoring the operation of the server FRU by any other suitable means (e.g., by means of firmware).
[0129] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0131] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein can be implemented in a computing system that includes backend components (such as, for example, a data server), or a computing system that includes middleware components (such as, for example, an application server), or a computing system that includes frontend components (such as, for example, a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (such as, for example, a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0134] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0135] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0136] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for monitoring the operation of a server FRU, characterized in that, Including: Obtain the connection topology of the integrated circuit bus I2C expander corresponding to the server; According to the I2C expander connection topology, obtain the driver corresponding to each I2C expander, and generate a virtual I2C bus matching each channel corresponding to each I2C expander through the driver corresponding to each I2C expander; Based on the virtual I2C buses matching each channel corresponding to each I2C expander, obtain at least one field replaceable unit FRU corresponding to the server, and the operating status corresponding to each FRU; The obtaining the driver corresponding to each I2C expander according to the I2C expander connection topology includes: According to the I2C expander connection topology, obtain the data structure corresponding to each I2C expander, and according to the data structure corresponding to each I2C expander, obtain the driver corresponding to each I2C expander; The data structure includes at least one of the address corresponding to the I2C expander, the number of channels corresponding to the I2C expander, the channel number to which the I2C expander is connected to the upper-level I2C expander, and the pointer to the data structure corresponding to the upper-level I2C expander; Wherein, according to the data structure corresponding to each I2C expander, a corresponding driver is dynamically bound to each I2C expander.
2. The method according to claim 1, wherein The obtaining the connection topology of the integrated circuit bus I2C expander corresponding to the server includes: Obtain at least one primary I2C expander corresponding to the server by sending I2C expander query messages to each address within a preset address range; Obtain at least one primary channel corresponding to each primary I2C expander by sending channel switching instructions to each primary I2C expander; Judge whether there is a lower-level I2C expander for each primary channel. If not, establish the I2C expander connection topology corresponding to the server according to the primary I2C expanders.
3. The method according to claim 2, wherein After judging whether there is a lower-level I2C expander for each primary channel, it further includes: If so, obtain each secondary I2C expander corresponding to each primary I2C expander, and each secondary channel corresponding to each secondary I2C expander, and re-judge whether there is a lower-level I2C expander for each secondary channel until it is detected that there is no lower-level I2C expander for each current-level I2C expander, and obtain all I2C expanders corresponding to the server; Establish the I2C expander connection topology corresponding to the server according to all I2C expanders corresponding to the server.
4. The method according to claim 1, wherein The obtaining at least one field replaceable unit FRU corresponding to the server, and the operating status corresponding to each FRU based on the virtual I2C buses matching each channel corresponding to each I2C expander includes: Based on the virtual I2C buses matching each channel corresponding to each I2C expander, obtain the slave devices corresponding to each channel, and the stored data matching the memories corresponding to each slave device; If it is detected that the stored data matched with the memory corresponding to the current slave device conforms to the preset data rule, then use the current slave device as the current FRU, and based on the virtual I2C bus matched with the channel corresponding to the current slave device, obtain the operating status corresponding to the current FRU.
5. The method according to claim 4, wherein Obtaining the operating status corresponding to the current FRU based on the virtual I2C bus matched with the channel corresponding to the current slave device includes: Based on the virtual I2C bus matched with the channel corresponding to the current slave device, obtain the status parameters corresponding to the current FRU; If it is detected that the status parameters corresponding to the current FRU meet the preset status detection conditions, then obtain that the operating status corresponding to the current FRU is the normal status.
6. A running monitoring device for a server FRU, characterized in that, Including: A connection topology acquisition module, configured to acquire the I2C extender connection topology corresponding to the server; A virtual I2C bus generation module, configured to obtain the driver corresponding to each I2C extender according to the I2C extender connection topology, and generate the virtual I2C buses matched with each channel corresponding to each I2C extender through the drivers corresponding to each I2C extender; An FRU acquisition module, configured to obtain at least one field replaceable unit FRU corresponding to the server and the operating status corresponding to each FRU based on the virtual I2C buses matched with each channel corresponding to each I2C extender; The virtual I2C bus generation module is specifically configured to obtain the data structure corresponding to each I2C extender according to the I2C extender connection topology, and obtain the driver corresponding to each I2C extender according to the data structure corresponding to each I2C extender; The data structure includes at least one of the address corresponding to the I2C extender, the number of channels corresponding to the I2C extender, the channel number for which the I2C extender is connected to the upper-level I2C extender, and the pointer pointing to the data structure corresponding to the upper-level I2C extender; Among them, according to the data structure corresponding to each I2C extender, the corresponding driver is dynamically bound to each I2C extender.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for monitoring the operation of the server FRU according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the method for monitoring the operation of the server FRU according to any one of claims 1-5 when executed by a processor.
Citation Information
Patent Citations
BMC-based equipment monitoring method, device and system and storage medium
CN113127308A
I2C (Inter-Integrated Circuit) debugging method, system and device of BMC (Baseboard Management Controller) and computer readable storage medium
CN114328045A