Network card temperature acquisition method and device, equipment and medium

By acquiring the path and I2C address based on the network card manufacturer's ID configuration temperature, the server configuration dependency problem caused by the diversity of network card models in the existing technology is solved, and flexibility and cost-effectiveness are improved.

CN119149344APending Publication Date: 2024-12-17INSPUR BUSINESS MACHINE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411336453.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing server network card temperature acquisition method highly depends on the configuration of network card models, making it difficult to enumerate all network card models in the configuration file of one server, increasing the cost of server development and maintenance and not conducive to increasing the flexibility of the server.

Method used

By configuring the network card temperature acquisition path based on the manufacturer ID of the network card manufacturer, matching it with the server's I2C address, in response to the network card temperature acquisition process, obtain the manufacturer ID of the in-location network card, and scan the matching I2C address to obtain the network card temperature, avoiding the Frequent modifications to server configuration files.

Benefits of technology

It enables temperature acquisition of different network cards without modifying the server configuration file, which reduces the cost of server development and maintenance and increases the flexibility of servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149344A_ABST
    Figure CN119149344A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a network card temperature acquisition method and device, equipment and a medium. The method comprises the following steps: configuring a plurality of network card temperature acquisition paths corresponding to a network card manufacturer to be matched with an I2C address of a server based on a manufacturer ID corresponding to the network card manufacturer; in response to the starting of the network card temperature acquisition process, acquiring a manufacturer ID corresponding to the in-place network card based on the slot position information; and obtaining a plurality of I2C addresses matched with the manufacturer ID based on the manufacturer ID corresponding to the in-place network card, scanning the effective I2C addresses, and obtaining the path based on the matched corresponding network card temperature so as to obtain the temperature of the in-place network card. According to the scheme, the situation that the mode of reading the temperature information of the network card by the server highly depends on the configuration of the network card signal is avoided, the configuration file of the server does not need to be modified for different types of network cards of the same manufacturer, the development and maintenance cost of the server is reduced, and the flexibility of the server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for obtaining the temperature of a network card. Background Art

[0002] The network card is a key hardware to ensure the quality of server network communication and support business, and its operating temperature is an important indicator for evaluating its health status. The existing server network card temperature acquisition method is based on the configuration file in the server. The server can read the temperature information of the network card that is consistent with the network card model in the configuration file, which is highly dependent on the configuration of the network card model. Since network card manufacturers will iteratively update network cards and iteratively update server configurations, there are many network card models in practice, and it is difficult to enumerate all network card models in a server configuration file, resulting in the server being restricted from reading the temperature information of network cards of different models. If a new network card model is added each time, the corresponding information needs to be modified in the server configuration file, which increases the development and maintenance costs of the server and is not conducive to increasing the flexibility of the server. Summary of the invention

[0003] In view of this, the network card temperature reading method in the prior art is highly dependent on the configuration of the network card model. In practice, there are many network card models, and it is difficult to enumerate all network card models in a configuration file of a server, which results in the server being restricted in reading temperature information of network cards of different models and increases the development and maintenance costs of the server. The present disclosure provides a network card temperature acquisition method, device, equipment and medium.

[0004] According to a first aspect of the present invention, a method for obtaining a temperature of a network card is provided, comprising: Based on the manufacturer ID corresponding to the network card manufacturer, multiple network card temperature acquisition paths corresponding to the network card manufacturer are configured to match the I2C address of the server; In response to starting the network card temperature acquisition process, acquiring a vendor ID corresponding to the in-slot network card based on the slot information; Based on the manufacturer ID corresponding to the in-place network card, a plurality of I2C addresses matching therewith are acquired, valid I2C addresses therein are scanned and a corresponding network card temperature acquisition path is matched therewith to acquire the temperature of the in-place network card.

[0005] In some embodiments, in response to starting the network card temperature acquisition process, the step of acquiring the vendor ID corresponding to the in-slot network card based on the slot information includes: In response to the BMC starting a network card temperature acquisition process, traversing the slots of the server to acquire an in-place device; Based on the slot information of the slot where the on-site device is located, it is determined whether the on-site device is an on-site network card. If it is confirmed that the on-site device is an on-site network card, the corresponding manufacturer ID is obtained from the BMC.

[0006] In some embodiments, the step of determining whether the in-place device is an in-place network card based on the slot information of the slot where the in-place device is located includes: Comparing the slot information of the slot where the in-place device is located with the BIOS file of the server to determine the type of the in-place device; In response to determining that the in-place device is a network card device type, the in-place device is used as an in-place network card.

[0007] In some embodiments, the step of scanning the valid I2C addresses and matching the corresponding network card temperature acquisition path based on the I2C addresses to acquire the temperature of the in-place network card includes: Scanning, by the BMC, in sequence according to the address sequence of the plurality of I2C addresses to determine whether they are valid I2C addresses; In response to the current I2C address being scanned as a valid I2C address, the scanning is stopped, and the temperature of the in-place network card is acquired based on the network card temperature acquisition path that matches the current I2C address.

[0008] In some embodiments, the step of acquiring the temperature of the in-place network card based on the network card temperature acquisition path corresponding to the current I2C address includes: The register corresponding to the current I2C address is accessed according to the network card temperature acquisition path corresponding to the current I2C address, so as to read the temperature of the in-position network card from the register.

[0009] In some embodiments, the step of configuring multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer includes: Based on the manufacturer ID corresponding to the network card manufacturer, multiple network card temperature acquisition paths corresponding to different network card manufacturers are respectively matched one by one with the I2C addresses of several pre-configured servers to match them.

[0010] In some embodiments, the method further comprises: The acquired temperature of the in-place network card is placed in the interface of the D-BUS, so that the target process acquires the temperature of the in-place network card by monitoring the D-BUS.

[0011] According to a second aspect of the present invention, a network card temperature acquisition device is provided, the device comprising: The first module is used to configure multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer; The second module is used for obtaining the manufacturer ID corresponding to the in-position network card based on the slot information in response to starting the network card temperature obtaining process; The third module is used to obtain a plurality of I2C addresses matching the manufacturer ID corresponding to the in-place network card, scan the valid I2C addresses therein and obtain the temperature acquisition path of the corresponding network card based on the matching, so as to obtain the temperature of the in-place network card.

[0012] According to a third aspect of the present invention, there is further provided an electronic device, the electronic device comprising: at least one processor; and The memory stores a computer program that can be run on the processor, and the processor executes the aforementioned network card temperature acquisition method when executing the program.

[0013] According to a fourth aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the aforementioned network card temperature acquisition method is executed.

[0014] The above-mentioned network card temperature acquisition method configures multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer, and establishes multiple network card temperature acquisition paths corresponding to different manufacturers through the manufacturer ID to match the I2C address of the server respectively. If the network card temperature acquisition process is started, the manufacturer ID corresponding to the in-place network card is obtained based on the slot information and the corresponding matching I2C addresses are obtained based on it, and the valid I2C addresses are scanned and the network card temperature acquisition path is matched based on it to obtain the temperature of the in-place network card, and the way the server reads the network card temperature is modified to be based on different manufacturer IDs, and different network card models under each manufacturer have corresponding network card temperature acquisition paths, so as to avoid the way the server reads the temperature information of the network card highly depending on the configuration of the network card signal. For adding different models of network cards under the same manufacturer, there is no need to modify the server configuration file, which reduces the development and maintenance costs of the server and increases the flexibility of the server.

[0015] In addition, the present invention also provides a network card temperature acquisition device, an electronic device and a computer-readable storage medium, which can also achieve the above-mentioned technical effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flow chart of a method for obtaining network card temperature provided by an embodiment of the present invention; Figure 2 A flowchart of configuring and obtaining the in-place information of a server slot provided by a second embodiment of the present invention is shown; Figure 3 A flowchart of obtaining a vendor ID corresponding to an in-place network card provided by a second embodiment of the present invention is shown; Figure 4 It shows a flow chart of obtaining the corresponding temperature of an in-place network card based on a manufacturer ID provided by a second embodiment of the present invention; Figure 5 The flowchart shown is a method of placing the acquired temperature of the in-place network card on the D-BUS interface provided by the third embodiment of the present invention; Figure 6 The diagram shown is a schematic diagram of transmitting the acquired temperature of an in-place network card to a target process based on D-BUS provided by a third embodiment of the present invention; Figure 7 A schematic diagram of the structure of a network card temperature acquisition device provided by another embodiment of the present invention; Figure 8 is an internal structure diagram of an electronic device in another embodiment of the present invention; Fig. 9 This is a structural diagram of a computer-readable storage medium in another embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0019] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0020] In one embodiment, please refer to Figure 1 As shown, the present invention provides a network card temperature acquisition method 100, specifically, comprising: Step 101, based on the manufacturer ID corresponding to the network card manufacturer, multiple network card temperature acquisition paths corresponding to the network card manufacturer are configured to match the I2C address of the server; Step 102, in response to starting the network card temperature acquisition process, acquiring the manufacturer ID corresponding to the in-slot network card based on the slot information; Step 103 , based on the manufacturer ID corresponding to the in-place network card, a number of I2C addresses matching therewith are obtained, valid I2C addresses therein are scanned and a corresponding network card temperature acquisition path is obtained based on the matching, so as to obtain the temperature of the in-place network card.

[0021] The above-mentioned network card temperature acquisition method configures multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID (Identity Document) corresponding to the network card manufacturer, and establishes multiple network card temperature acquisition paths corresponding to different manufacturers through the manufacturer ID to match the I2C (Inter-Integrated Circuit) address of the server respectively. If the network card temperature acquisition process is started, the manufacturer ID corresponding to the in-position network card is obtained based on the slot information and the corresponding matching I2C addresses are obtained based on it, and the valid I2C addresses are scanned and the temperature of the in-position network card is obtained based on the matching network card temperature acquisition path. The way in which the server reads the network card temperature is modified to be based on different manufacturer IDs, and different network card models under each manufacturer have corresponding network card temperature acquisition paths, so as to avoid the way in which the server reads the temperature information of the network card highly dependent on the configuration of the network card signal. For adding different models of network cards under the same manufacturer, there is no need to modify the server configuration file, thereby reducing the development and maintenance costs of the server and increasing the flexibility of the server.

[0022] According to some embodiments of the present invention, in response to starting the network card temperature acquisition process, the step of acquiring the manufacturer ID corresponding to the in-place network card based on the slot information includes: in response to the BMC (Baseboard Management Controller) starting the network card temperature acquisition process, traversing the slots of the server to acquire the in-place device; judging whether the in-place device is the in-place network card based on the slot information of the slot where the in-place device is located, and if it is confirmed that the in-place device is the in-place network card, acquiring the corresponding manufacturer ID from the BMC. A new interface for judging whether the device in the server slot is in-place is added, and the in-place device is acquired by traversing the slots of the server and judging whether the in-place device is the target device based on its slot information, so as to acquire the corresponding manufacturer ID from the BMC, which is conducive to quickly locating the position of the in-place device as a network card device and its corresponding manufacturer ID.

[0023] According to some embodiments of the present invention, the step of determining whether the in-place device is an in-place network card based on the slot information of the slot where the in-place device is located includes: comparing the slot information of the slot where the in-place device is located with the BIOS (Basic Input Output System) file of the server to determine the type of the in-place device; in response to determining that the in-place device is a network card device type, treating the in-place device as an in-place network card. By comparing with the BIOS file of the server to determine the type of the in-place device, the device is automatically identified through the BIOS information, reducing the workload of manual inspection and recording, and at the same time, providing a standardized method for determining the in-place network card.

[0024] According to some embodiments of the present invention, the steps of scanning the valid I2C address and matching the corresponding network card temperature acquisition path based thereon to obtain the temperature of the network card in place include: scanning in sequence through the BMC to see whether it is a valid I2C address in the address order of several I2C addresses; in response to the current I2C address scan being a valid I2C address, the scanning is stopped, and the temperature of the network card in place is obtained based on the network card temperature acquisition path that matches the current I2C address. The scanning is stopped after the valid I2C address is obtained, and the I2C address is accurately matched, which reduces the number of communications with invalid devices, thereby reducing the energy consumption of the system.

[0025] According to some embodiments of the present invention, the step of acquiring the temperature of the in-place network card based on the network card temperature acquisition path corresponding to the current I2C address includes: accessing the register corresponding to the current I2C address according to the network card temperature acquisition path corresponding to the current I2C address to read the temperature of the in-place network card from the register. Accessing the register corresponding to the current I2C address through the corresponding temperature acquisition path to acquire the corresponding temperature is conducive to regularly reading the network card temperature to monitor its working status in real time.

[0026] According to some embodiments of the present invention, the step of configuring multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer includes: based on the manufacturer ID corresponding to the network card manufacturer, the multiple network card temperature acquisition paths corresponding to different network card manufacturers are respectively matched one-to-one with the I2C addresses of several pre-configured servers to match them. The one-to-one correspondence between different network card temperature acquisition paths corresponding to different network card manufacturers and the I2C addresses is conducive to improving the accuracy of obtaining the temperature of the in-place network card.

[0027] According to some embodiments of the present invention, the method further includes: placing the acquired temperature of the in-place network card on the interface of D-BUS, so that the target process acquires the temperature of the in-place network card by monitoring D-BUS (Desktop Bus). Since D-Bus is an advanced inter-process communication (IPC) mechanism, it is widely used in Linux operating systems, allowing software applications to communicate synchronously or asynchronously, and send and receive cross-process messages. Compared with the traditional IPC mechanism (such as PIPE / FIFO / Socket / shared memory), D-Bus provides a low-latency, low-overhead and high-availability IPC mechanism, hiding the complexity of the underlying IPC mechanism, and providing developers with a more advanced and easy-to-use interface, which is conducive to improving the efficient interactive transmission of network card temperature data.

[0028] In order to further understand the method for obtaining the temperature of a network card proposed by the present invention, the method for obtaining the temperature of a network card proposed by the present invention is described in detail below based on a specific example.

[0029] The manufacturer ID corresponding to the network card manufacturer is the unique identification code of the network equipment manufacturer. It is used to accurately identify the manufacturer of the network card during the network equipment management and configuration process. During the server configuration process, the hardware ID of the network card is obtained through the device manager. Based on the hardware ID, the manufacturer ID corresponding to the network card can be obtained to identify the manufacturer corresponding to the network card. Each manufacturer pre-configures multiple different network card temperature acquisition paths, and different models of network cards correspond to different network card temperature acquisition paths.

[0030] First, according to the manufacturer IDs corresponding to the multiple network card manufacturers, configure the multiple network card temperature acquisition paths corresponding to the multiple network card manufacturers to match the I2C address of the server. For example, the Mellanox network card manufacturer has two corresponding network card temperature acquisition paths. The two network card temperature acquisition paths corresponding to the Mellanox network card manufacturer are configured to match the server's 0x1F address and 0x64 address one by one. If the scanned address is 0x1F, it means directly accessing the register 0x01 at address 0x1F through I2C, and reading a byte from it. The read value is the temperature of the network card; if the scanned address is 0x64, it means reading the Mellanox specification, and obtaining the network card temperature through MCTP over I2C over NCSI (Network Controller Sideband Interface), and parsing the corresponding network card temperature according to the command response. At the same time, configure the process of obtaining the in-place information of the server slot in the server, such as Figure 2 As shown, Figure 2 A flowchart of configuring and obtaining the in-place information of a server slot provided by the second embodiment of the present invention is shown, in which a hardware interface is configured in the device tree of the server, a driver function is then called according to the configuration information, and finally an interface function is provided to the user layer to obtain the in-place information of the slot.

[0031] further, Figure 3 The flowchart of obtaining the manufacturer ID corresponding to the in-place network card provided by the second embodiment of the present invention is shown. After the configuration of matching the temperature acquisition paths of multiple network cards corresponding to different manufacturer IDs with the corresponding I2C addresses is completed based on the manufacturer ID, if the BMC of the server starts the network card temperature acquisition process, the slots of the server are traversed, and the slot device information is obtained through the driver interface. If it is detected that there is a device in the current slot, the slot information of the slot is obtained, and compared with the BIOS file of the server to determine the type of the in-place device. If it is determined that the in-place device is a network card device type, the manufacturer ID corresponding to the in-place device (i.e., the in-place network card) is obtained through the general specification interface. Among them, if the type of the server is an OpenPower server, the corresponding BIOS file is PNOR (Parallel NOR Flash).

[0032] further, Figure 4 A flowchart of obtaining the corresponding temperature of an in-place network card based on a manufacturer ID provided by a second embodiment of the present invention is shown. Based on the obtained manufacturer ID corresponding to the in-place network card and the matching relationship between multiple network card temperature acquisition paths corresponding to different configured manufacturer IDs and the corresponding I2C addresses, the corresponding network card temperature acquisition path is adaptively adapted according to the manufacturer ID to obtain the corresponding temperature. Specifically, a number of I2C addresses matching the manufacturer ID corresponding to the in-place network card are obtained, and valid I2C addresses among the several I2C addresses are scanned in sequence according to the address sequence. Manufacturer A is used as an example for explanation. Manufacturer A has three corresponding network card temperature acquisition paths, which correspond to the I2C addresses in the order of M1-M3 respectively. Generally, the network card temperature acquisition path with a higher frequency of use is matched with the previous address. First, the BMC is used to scan whether the address M1 is valid. If it is valid, the scanning is stopped, and the temperature of the in-place network card is directly obtained by the network card temperature acquisition path corresponding to M1 (that is, method 1). For example, the register corresponding to the current I2C address is accessed by method 1 corresponding to M1 to read the temperature of the in-place network card from the register. Otherwise, it is determined whether the address M2 is valid, and so on, until a valid address is found and the scanning is stopped.

[0033] In order to further understand the method for obtaining the temperature of a network card proposed by the present invention, the method for obtaining the temperature of a network card proposed by the present invention is described in detail below based on another specific example. Figure 5The flowchart shown is a method for placing the acquired temperature of the in-place network card on the D-BUS interface provided by the third embodiment of the present invention. In a server developed based on the OpenBMC architecture, a monitoring process of net_monitor is added and started through net_monitor.service, wherein net_monitor.service is managed by the system of the BMC system. At the same time, a D-bus object is created in the net_monitor process and the acquired temperature information is placed on the D-bus interface. Figure 6 The schematic diagram shown is a third embodiment of the present invention, which provides a method for transmitting the acquired temperature of the in-place network card to the target process based on D-BUS. The target process (such as BMC Web / redfish / SNMP / IPMI, etc.) can obtain the temperature of the in-place network card by monitoring D-BUS, and can directly read the data and return it.

[0034] In some embodiments, please refer to Figure 7 As shown, the present invention also provides a network card temperature acquisition device 200, the device comprising: The first module 201 is used to configure multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer; The second module 202 is used to obtain the manufacturer ID corresponding to the in-slot network card based on the slot information in response to starting the network card temperature acquisition process; The third module 203 is used to obtain a number of I2C addresses matching the vendor ID of the in-place network card, scan the valid I2C addresses therein and match the corresponding network card temperature acquisition path based on the vendor ID to obtain the temperature of the in-place network card.

[0035] It should be noted that each module in the above-mentioned network card temperature acquisition device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0036] According to another aspect of the present invention, an electronic device is provided. The electronic device may be a server. Figure 8As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the network card temperature acquisition method described above is implemented.

[0037] According to another aspect of the present invention, a computer readable storage medium is provided. Fig. 9 As shown, a computer program is stored thereon, and when the computer program is executed by the processor, the above-mentioned method for obtaining the temperature of the network card is implemented.

[0038] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0039] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0040] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for obtaining network card temperature, characterized in that: include: Based on the manufacturer ID corresponding to the network card manufacturer, multiple network card temperature acquisition paths corresponding to the network card manufacturer are configured to match the I2C address of the server; In response to starting the network card temperature acquisition process, acquiring a vendor ID corresponding to the in-slot network card based on the slot information; Based on the manufacturer ID corresponding to the in-place network card, a plurality of I2C addresses matching therewith are acquired, valid I2C addresses therein are scanned and a corresponding network card temperature acquisition path is matched therewith to acquire the temperature of the in-place network card.

2. The method for obtaining the temperature of a network card according to claim 1, characterized in that: The step of obtaining the vendor ID corresponding to the in-slot network card based on the slot information in response to starting the network card temperature acquisition process includes: In response to the BMC starting a network card temperature acquisition process, traversing the slots of the server to acquire an in-place device; Based on the slot information of the slot where the on-site device is located, it is determined whether the on-site device is an on-site network card. If it is confirmed that the on-site device is an on-site network card, the corresponding manufacturer ID is obtained from the BMC.

3. The method for obtaining the temperature of a network card according to claim 2, characterized in that: The step of judging whether the in-place device is an in-place network card based on the slot information of the slot where the in-place device is located comprises: Comparing the slot information of the slot where the in-place device is located with the BIOS file of the server to determine the type of the in-place device; In response to determining that the in-place device is a network card device type, the in-place device is used as an in-place network card.

4. The method for obtaining the temperature of a network card according to claim 1, characterized in that: The step of scanning the valid I2C addresses and matching the corresponding network card temperature acquisition path based on the I2C addresses to acquire the temperature of the in-place network card includes: Scanning, by the BMC, in sequence according to the address sequence of the plurality of I2C addresses to determine whether they are valid I2C addresses; In response to the current I2C address being scanned as a valid I2C address, the scanning is stopped, and the temperature of the in-place network card is acquired based on the network card temperature acquisition path that matches the current I2C address.

5. The method for obtaining the temperature of a network card according to claim 4, characterized in that: The step of acquiring the temperature of the in-place network card based on the network card temperature acquisition path corresponding to the current I2C address includes: The register corresponding to the current I2C address is accessed according to the network card temperature acquisition path corresponding to the current I2C address, so as to read the temperature of the in-position network card from the register.

6. The method for obtaining the temperature of a network card according to claim 1, characterized in that: The step of configuring the corresponding multiple network card temperature acquisition paths to match the I2C address of the server based on the manufacturer ID corresponding to the network card includes: Based on the manufacturer ID corresponding to the network card manufacturer, multiple network card temperature acquisition paths corresponding to different network card manufacturers are respectively matched one by one with the I2C addresses of several pre-configured servers to match them.

7. The method for obtaining the temperature of a network card according to claim 1, characterized in that: The method further comprises: The acquired temperature of the in-place network card is placed in the interface of the D-BUS, so that the target process acquires the temperature of the in-place network card by monitoring the D-BUS.

8. A network card temperature acquisition device, characterized in that: The device comprises: The first module is used to configure multiple network card temperature acquisition paths corresponding to the network card manufacturer to match the I2C address of the server based on the manufacturer ID corresponding to the network card manufacturer; The second module is used for obtaining the manufacturer ID corresponding to the in-position network card based on the slot information in response to starting the network card temperature obtaining process; The third module is used to obtain a plurality of I2C addresses matching the manufacturer ID corresponding to the in-place network card, scan the valid I2C addresses therein and obtain the temperature acquisition path of the corresponding network card based on the matching, so as to obtain the temperature of the in-place network card.

9. An electronic device, characterized in that: include: at least one processor; as well as A memory, wherein the memory stores a computer program that can be run in the processor, and when the processor executes the program, the network card temperature acquisition method according to any one of claims 1 to 7 is executed.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the network card temperature acquisition method according to any one of claims 1 to 7 is executed.