Device information acquisition method and electronic device
By acquiring the identity information of target devices on the device topology during server startup and locating key devices based on count values, the problems of poor flexibility in acquiring device information and high development costs are solved, enabling the server to flexibly adapt to and stably operate on diverse devices.
Patent Information
- Application Number
- CN202511557405.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-29
AI Technical Summary
Existing technologies have poor flexibility in acquiring device information, high development costs, and cannot adapt to device firmware updates, resulting in limited server compatibility with diverse devices.
By acquiring the identity information of target devices on the device topology during server startup and dynamically locating key target devices based on count values, the system replaces manual hard-coding and enables flexible acquisition of device information.
It reduces development costs and human resource consumption, improves the server's compatibility with diverse devices, ensures accurate acquisition of device asset information during firmware updates, and guarantees the stable operation of the server system.
Smart Images

Figure CN121037232B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of device management, and particularly relates to a device information acquisition method and an electronic device. BACKGROUND
[0002] The internal of the intelligent device usually contains multiple virtual devices, forming a multi-Function (functional unit) subsystem architecture, and the device asset information of each device in the server is important information for realizing the whole life cycle management of the device and guaranteeing the stable operation of the server. However, due to the device architecture, firmware version and system environment factors of different manufacturers and other aspects, the position of the key device representing the core identity information of the device in the device topology is uncertain.
[0003] In the related art, the device topology information is mainly determined by manual analysis, the position index of the key device is determined, and then the hard-coded processing logic is added for the specific device in the BIOS (Base Input / Output System, basic input / output system) code, so as to acquire the device information. However, this method cannot adapt to the device firmware update, has poor flexibility, and has high development cost. SUMMARY
[0004] The present application provides a device information acquisition method and an electronic device, to at least solve the problems of poor flexibility in acquiring device information and high development cost in the related art.
[0005] The present application provides a device information acquisition method applied to a starting system, including the following steps: in a server starting process, acquiring first identity information of a target device on a device topology, storing the first identity information of the target device to a pre-set first configuration list, the device topology including multiple devices, and the device information level of the target device being greater than that of other devices on the device topology; acquiring second identity information of a device node on a device link of the server, querying the first configuration list based on the second identity information of the device node, to determine whether the first identity information is consistent with the second identity information on the first configuration list; if the second identity information is consistent with the first identity information, identifying a count value in the first identity information, acquiring a device topology of the device node, and querying the target device on the device topology based on the count value, to acquire device information of the target device; if the second identity information is not consistent with the first identity information, acquiring a device topology of the device node, taking a first device of the device topology as the target device on the device topology, and acquiring device information of the target device.
[0006] The application further provides a device information acquisition method applied to a substrate management controller, including the following steps: acquiring a first command sent by a starting system, setting first identity information of a target device on a device topology in a first setting page in response to an adding instruction of the device topology, generating the first command according to the first identity information after setting is completed; identifying the first identity information in the first command, obtaining information identification and first device identification data by analyzing the first identity information, establishing a data structure body if the information identification is a target identification set in advance; storing the first device identification data by using the data structure body, reading fourth identity information of the target device on the device topology from a second memory, and storing the fourth identity information to a fourth configuration list set in advance; querying the fourth configuration list based on the data structure body, updating the fourth identity information by using the first identity information if the query is successful, adding the first identity information in the fourth configuration list if the query fails; storing the fourth configuration list to the second memory, generating a saving completion identification, generating feedback information according to the saving completion identification, sending the feedback information to the starting system, and executing any one of the device information acquisition methods in a starting server process of the starting system.
[0007] The application further provides a device information acquisition method applied to a substrate management controller, including the following steps: acquiring a first command sent by a starting system, setting first identity information of a target device on a device topology in a first setting page in response to an adding instruction of the device topology, generating the first command according to the first identity information after setting is completed; identifying the first identity information in the first command, obtaining information identification and first device identification data by analyzing the first identity information, establishing a data structure body if the information identification is a target identification set in advance; storing the first device identification data by using the data structure body, reading fourth identity information of the target device on the device topology from a second memory, and storing the fourth identity information to a fourth configuration list set in advance; querying the fourth configuration list based on the data structure body, updating the fourth identity information by using the first identity information if the query is successful, adding the first identity information in the fourth configuration list if the query fails; storing the fourth configuration list to the second memory, generating a saving completion identification, generating feedback information according to the saving completion identification, sending the feedback information to the starting system, and executing any one of the device information acquisition methods in a starting server process of the starting system.
[0008] The application further provides an electronic device including a memory for storing a computer program, and a processor for executing the computer program to realize the steps of any one of the device information acquisition methods.
[0009] Since the device asset information of each device in the server is important information for realizing device full life cycle management and ensuring stable operation of the server, the device asset information of each device in the server needs to be obtained. However, due to device architecture, firmware version, system environment factors and other factors of different manufacturers, the location of the key device representing the core identity information of the device in the device topology is uncertain. The hard coding method in the related technology cannot adapt to firmware update, and the key device of each device needs to be re-written based on the code, which has poor flexibility. Therefore, the embodiment of the present application can dynamically and accurately locate the key target device based on the count value in the identity information of the target device in the device topology, replace the manual hard coding method to obtain the key target device information, and does not need to be hard coded and adapted for each device. Only the identity information of the device needs to be pre-configured, which can adapt to more devices, reduce labor and development cost, improve the compatibility of the server to diversified devices, and ensure that the device asset information can be accurately obtained when the enumeration order of the device changes, thereby ensuring the freedom of device update and the long-term stable operation of the server system. Therefore, the technical problems of poor flexibility and high development cost of device information acquisition in the related technology can be solved, and the technical effects of flexible device information acquisition and low development cost can be achieved. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0011] Figure 1 The flowchart of the device information acquisition method provided by an embodiment of the present application is shown in the figure.
[0012] Figure 2 The flowchart of the device information acquisition method provided by an embodiment of the present application is shown in the figure.
[0013] Figure 3 The flowchart of the device information acquisition method provided by another embodiment of the present application is shown in the figure.
[0014] Figure 4 The flowchart of the device information acquisition method provided by another embodiment of the present application is shown in the figure.
[0015] Figure 5 The hardware interaction diagram for obtaining device information provided by an embodiment of the present application is shown in the figure.
[0016] Figure 6A flowchart of adding device information is provided for an embodiment of the present application.
[0017] Figure 7 A schematic diagram of a device information acquisition apparatus is provided for an embodiment of the present application.
[0018] Figure 8 A schematic diagram of a device information acquisition apparatus is provided for another embodiment of the present application.
[0019] Figure 9 A schematic diagram of a device information acquisition apparatus is provided for yet another embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0021] It should be noted that, in the description of the present application, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0022] Before describing the solutions of the present application, the related technologies of the present application will be introduced.
[0023] In the server system architecture, the wide application of intelligent devices (such as intelligent network cards, intelligent storage controllers, GPUs, etc.) significantly improves the system performance, but also brings the multi-Function challenge of device management. These intelligent devices usually contain multiple virtual devices inside, forming a multi-Function subsystem architecture.
[0024] However, the key device representing the core identity information of the intelligent device is uncertain in the internal topology. This device carrying important asset information (including manufacturer ID, device model, serial number, firmware version, etc.) can be the first, second or later device in the internal device tree. This uncertainty is mainly due to the differences in device architecture of different manufacturers, firmware version updates, and system environment factors, etc.
[0025] The method for obtaining device information in the related art mainly determines the position index of the key device by manually analyzing the device topology information output by the lspci command, and then adds the hard-coded processing logic for the specific device in the BIOS code. Although this method can temporarily solve the problem, it has the following problems:
[0026] Firstly, this method lacks flexibility, and each new device supported needs to modify the BIOS code, resulting in bloated code base and difficult to maintain, and the development team needs to maintain separate support code for each device model, greatly increasing the development burden.
[0027] Secondly, the maintenance cost of the scheme is high, from device testing, analysis to code modification and verification, the whole process needs to consume a lot of human resources and time cost, prolonging the time to market of new products.
[0028] In addition, the method of the related art cannot adapt to device firmware updates. When the smart device manufacturer releases new firmware that may change the internal device enumeration order, the original hard-coded position information is immediately invalid, resulting in asset information acquisition error. Users face a dilemma: either give up device firmware updates and cannot obtain new functions and security patches; or bear the risk of asset information error.
[0029] With the continuous increase of the types of smart devices, this hard-coded based scheme is unsustainable, and the special processing logic in the code seriously limits the compatibility of the server platform to diversified smart devices. At the same time, from the development trend of technology, the application range of smart devices is continuously expanding, and new devices are emerging, and the internal architecture of the device is also increasingly multi-function. The method in the related art cannot meet the development needs.
[0030] Therefore, the present application proposes an information acquisition method to solve at least one of the above technical problems.
[0031] In order for those skilled in the art to better understand the present application scheme, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0032] Figure 1 A flowchart of a device information acquisition method according to an embodiment of the present application.
[0033] As Figure 1 shown, the device information acquisition method is applied to a startup system, which includes steps S101-S104, wherein the startup system can be a BIOS system of a server.
[0034] In step S101, in a server startup process, first identity information of a target device on a device topology is acquired, and the identity information of the target device is stored in a pre-set first configuration list. The device topology includes a plurality of devices, and the device information level of the target device is higher than that of other devices on the device topology.
[0035] The first identity information can be acquired from a first memory, and the first memory is used to provide storage space for a startup system and can be an NVRAM (Non-Volatile Random Access Memory). The identity information includes a DID (device ID), a VID (vendor ID), an SSID (subsystem device ID), an SVID (subsystem vendor ID), and a Count (count value). The first identity information can also be referred to as core identity information. The target device can be a core device or a key device in a multi-Function device. The target device carries core identity information (i.e., asset information) of the device. The multi-Function device is connected to a server motherboard based on a PCIE (Peripheral Component Interconnect Express) bus. Its core feature is that a single physical device internally encapsulates multiple function units or virtual devices. These function units or virtual devices work together to form a subsystem, which can not only exert the comprehensive performance of hardware, but also needs to manage the identity and function information (such as manufacturer ID, serial number, and firmware version) of each virtual device through a specific way. For example, the multi-Function device can be a smart network card, a smart memory, a GPU, etc. The device information includes a manufacturer ID, a device model, a serial number, a firmware version, a class code, a subclass code, etc.
[0036] It can be understood that in the server startup process, the first identity information of the target device on the device topology can be acquired from the first memory, and the first identity information of the target device is stored in the pre-set first configuration list, so as to facilitate subsequent matching of the identity information of the device. In addition, the device information level of the target device is higher than that of other devices on the device topology.
[0037] For example, the smart network card A includes a network port 1, a network port 2, and a network port 3. Each network port corresponds to a Function. The network port 1 carries the core identity information of the smart network card A. Therefore, the network port 1 is the target device, and the network port 2 and the network port 3 are other devices on the device topology of the smart network card A. The device information level of the network port 2 is higher than that of the network port 2 and the network port 3.
[0038] In some embodiments of the present application, before obtaining the first identity information of the target device on the device topology, the method comprises: in response to an adding instruction of the device topology, setting the first identity information of the target device on the device topology in a first setting page, after the setting is completed, judging whether the first identity information is valid; if the first identity information is valid, updating the first identity information to a first storage, generating a first command according to the first identity information, sending the first command to a baseboard management controller, the baseboard management controller responding to the first command, saving the first identity information to a second storage; obtaining feedback information of the baseboard management controller, and if a saving completion identifier is identified in the feedback information, generating at least one of an adding success prompt and a server restart prompt.
[0039] The first setting page is a first setting page for setting the first identity information of the target device on the device topology in the starting system, which can be referred to as an adding setting page. The first command can be an IPMI command, which is issued by the starting system and is used to store the information of the multiple Function devices and the core identity information of the first built-in device, and set the interface specification and the standard of the stored information. The second storage is used to provide a storage space for the baseboard management controller, and can be an EEPROM (Electrically Erasable Programmable Read-Only Memory).
[0040] It can be understood that the embodiments of the present application can respond to the adding instruction of the device topology, set the first identity information of the target device on the device topology in the first setting page, after the setting is completed, judge whether the first identity information is valid; if the first identity information is valid, update the first identity information to the first storage, generate the first command according to the first identity information, send the first command to the baseboard management controller, the baseboard management controller respond to the first command, save the first identity information to the second storage, obtain the feedback information of the baseboard management controller, if the saving completion identifier is identified in the feedback information, generate at least one of the adding success prompt and the server restart prompt. Through the command, the adding of the target device on the device topology can be realized, without adding the hard code of the position index of the target device in the starting system, thereby reducing the code development cost.
[0041] Specifically, the user can enter the BIOS setting path, slot configuration -> integrated input / output configuration, add a composite device information support module, and the module contains an adding option - adding device.
[0042] Click to add device, pop-up add settings page, set DID, VID, SSID, SVID, COUNT information, used to set the core identity information of multi-function device (i.e. the first identity information), click the confirm button after setting, judge the validity of the data. If valid, the information is deduplicated and the latest information is updated to the first memory NVRAM of BIOS, and needs to be sent to BMC for saving through the IPMI command of information storage process, and BMC saves the information to the second memory EEPROM. After saving, it prompts "add device successfully, need to restart the server to take effect", and provides "immediate restart" and "restart later" buttons.
[0043] In some embodiments of the present application, before obtaining the first identity information of the target device on the device topology, the third command sent by the baseboard management controller is obtained, the baseboard management controller responds to the addition instruction of the device topology, sets the first identity information of the target device on the device topology in the third setting page, and generates the third command according to the first identity information after setting; identify the first identity information in the third command, parse the first identity information to obtain information identifier and first device identifier data, if the information identifier is the target identifier set in advance, establish the data structure body; store the first device identifier data by using the data structure body, read the third identity information of the target device on the device topology from the first memory, and store the third identity information to the second configuration list set in advance; query the second configuration list based on the data structure body, if the query is successful, update the third identity information by using the first identity information, if the query fails, add the first identity information in the second configuration list; store the second configuration list to the first memory, generate a save completion identifier, generate feedback information according to the save completion identifier, and send the feedback information to the baseboard management controller.
[0044] The third command is also an IPMI command, which is issued by the baseboard management controller, and is used to store the information of the multi-function device and the core identity information of the first built-in device, and set the interface specification and the standard of storing information; the third setting page is the interface of the baseboard management controller for adding device identity information; the target identifier is a pre-set identifier, which is used to ensure the legitimacy of the information, filter valid commands, exclude invalid / illegal data, and can be used to determine the type of the command, so as to manage the device information; the first device identifier data can include DID, VID, SSID, SVID, etc.; the second configuration list stores the third identity information of the target device read from the first memory.
[0045] It can be understood that the embodiment of the application can add device identity information at the substrate management controller end, when receiving the third command of adding device information issued by the substrate management controller, identify the first identity information in the third command, parse the first identity information to obtain information identifier and first device identifier data, and when determining that the information identifier is a target identifier of a pre-device, it is indicated that it is a legal instruction, then a data structure body is established, the first device identifier data is stored by using the data structure body, the third identity information of the target device on the device topology is read from the first memory, and the third identity information is stored to the second configuration list set in advance, and the second configuration list is queried by using the data structure body.
[0046] If the query is successful, it indicates that the identity information of the device has been set before, then the third identity information stored before is updated by using the latest first identity information, so as to ensure that the information is the latest, if the query fails, it indicates that the identity information of the device has not been set before, the first identity information is added to the second configuration list, the second configuration list is stored to the first memory, a save completion identifier is generated, feedback information is generated according to the save completion identifier, and the feedback information is sent to the substrate management controller.
[0047] When a new device is added in the server system, the embodiment of the application does not need to modify the BIOS code as in the related art, the development team also does not need to maintain separate support code for each device model, and at the same time, it also does not need to consume a large amount of human resources and time cost in the process of code modification and verification from device testing and analysis as in the related art, only by the above-mentioned way of adding device identity information, a plurality of devices can be flexibly adapted, and the development cost and human time cost are reduced.
[0048] The data structure body of the embodiment of the application can be used to store device identifier data, and can also be used to store device count value, in other words, the data structure body of the embodiment of the application is used to store device identity information, and the form of the data structure body can be as follows: typedef struct{ UINT16 Did; UINT16 Vid; UINT16 Ssid; UINT16 Svid; UINT16 Count} DEVICE_MESSAGE, wherein Did, Vid, Ssid, and Svid are device identifier data, and Count is a count value.
[0049] UINT16 Did;
[0050] UINT16 Vid;
[0051] UINT16 Ssid;
[0052] UINT16 Svid;
[0053] UINT16 Count
[0054] } DEVICE_MESSAGE, wherein Did, Vid, Ssid, and Svid are device identifier data, and Count is a count value.
[0055] In some embodiments of the present application, the second configuration list is queried based on the data structure, including: obtaining second device identification data by parsing the third identity information; if the first device identification data and the second device identification data are consistent, it is determined that the query is successful; if the first device identification data and the second device identification data are inconsistent, it is determined that the query fails.
[0056] It can be understood that the embodiments of the present application can obtain second device identification data by parsing the third identity information, and determine whether the identity information of the device is previously stored in the second configuration list by comparing the second device identification data with the first device identification data in the first identity information, so as to avoid repeated operations on the same device, guarantee the uniqueness of the information, and further improve the accuracy of subsequent device information acquisition.
[0057] For example, the device identification data DID, VID, SSID, and SVID obtained by parsing the third identity information are x1, x2, x3, and x4, respectively, and the first device identification data is x1, x2, x3, and x4, and it is determined that the query is successful.
[0058] In some embodiments of the present application, after generating at least one of the new success prompt and the server restart prompt, it further includes: in response to a deletion instruction of the device topology, setting the first identity information of the target device on the device topology in the second setting page, and after the setting is completed, determining whether the first identity information is valid; if the first identity information is valid, deleting the first identity information from the first memory, generating a second command according to the first identity information, sending the second command to the baseboard management controller, and the baseboard management controller responds to the second command to delete the first identity information from the second memory; obtaining feedback information of the baseboard management controller, and if a deletion completion identifier is identified in the feedback information, generating at least one of a deletion success prompt and a server restart prompt.
[0059] The first setting page is used for setting the first identity information of the target device on the device topology in the starting system, which can be called a deletion setting page; the second command can be an IPMI command, which is issued by the starting system and is used to delete the information of the multiple Function devices and the core identity information of the first built-in device.
[0060] It is understood that, in response to a device topology deletion command, the first identity information of the target device on the device topology is set on the first settings page. After setting, it is determined whether the first identity information is valid. If the first identity information is valid, it is updated to the first memory. A second command is generated based on the first identity information, and the first command is sent to the baseboard management controller. The baseboard management controller responds to the second command, saves the first identity information to the second memory, and obtains feedback information from the baseboard management controller. If the feedback information identifies the saving completion flag, at least one of the following is generated: a successful addition prompt and a server restart prompt. The deletion of device information of the target device on the device topology can be achieved through commands. During firmware updates, it is only necessary to delete the device information of the device and add it again, avoiding the risk of incorrect acquisition of device asset information when the user selects to update. At the same time, during the process of adding device information, the system and the baseboard manager are started to interact to ensure information consistency and improve the accuracy of subsequent device information acquisition.
[0061] Specifically, users can enter the BIOS settings path, slot configuration -> integrated input / output configuration, add a new composite device information support module, which includes a delete option - delete device.
[0062] Clicking "Delete Device" will bring up the deletion settings page. The settings include DID, VID, SSID, and SVID information. After clicking the "Confirm" button, the data validity will be checked. If valid, the BIOS NVRAM will be updated in the same way as the IPMI command processing logic. This update requires sending the IPMI command to the BMC via the information deletion process. After processing, a message will appear stating "Device deletion successful, server restart required for effect," and "Restart Now" and "Restart Later" buttons will be provided to meet user needs in different situations.
[0063] In some embodiments of the present application, before obtaining the first identity information of the target device on the device topology, the fourth command sent by the baseboard management controller is obtained, the baseboard management controller responds to the deletion instruction of the device topology, sets the first identity information of the target device on the device topology in the fourth setting page, and generates the fourth command according to the first identity information after the setting is completed; the first identity information in the fourth command is identified, the information identifier and the first device identifier data are obtained by analyzing the first identity information, if the information identifier is a pre-set target identifier, a data structure body is established; the first device identifier data is stored by using the data structure body, the third identity information of the target device on the device topology is read from the first storage, and the third identity information is stored to the pre-set third configuration list; the third configuration list is queried based on the data structure body, if the query is successful, the corresponding third identity information is deleted from the first storage, the third configuration list is stored to the first storage, a deletion completion identifier is generated, feedback information is generated according to the deletion completion identifier, and the feedback information is sent to the baseboard management controller.
[0064] The fourth command is also an IPMI command, which is sent by the baseboard management controller and used to delete the information of the multi-function device and the core identity information of the first built-in device; the fourth setting page is an interface for deleting the device identity information on the baseboard management controller side; and the third configuration list stores the third identity information of the target device read from the first storage.
[0065] It can be understood that the embodiments of the present application can delete the device identity information on the baseboard management controller side, when the fourth command for deleting the device information sent by the baseboard management controller is received, the first identity information in the fourth command is identified, the information identifier and the first device identifier data are obtained by analyzing the first identity information, and when it is determined that the information identifier is a pre-set target identifier, it is indicated that it is a legal instruction, then a data structure body is established, the first device identifier data is stored by using the data structure body, the third identity information of the target device on the device topology is read from the first storage, and the third identity information is stored to the pre-set second configuration list, and the second configuration list is queried by using the data structure body.
[0066] If the query is successful, it is indicated that the identity information of the device has been set before, the device information corresponding to the device is deleted, the first identity information is added to the third configuration list, the third configuration list is stored to the first storage, a deletion completion identifier is generated, feedback information is generated according to the deletion completion identifier, and the feedback information is sent to the baseboard management controller.
[0067] To sum up, the embodiment of the application can flexibly adapt to various devices by the above-mentioned adding and deleting device identity information without modifying the BIOS code, without the development team maintaining separate support code for each device model, without the process of consuming a large amount of human resources and time cost from device testing, analysis to code modification and verification in the related art, reducing the development cost and human time cost, and shortening the time to market of new products.
[0068] In addition, it also needs to be explained that the embodiment of the application can not only add and delete device identity information, but also the starting system and the baseboard manager can also perform the query operation on the identity information.
[0069] In step S102, the second identity information of the device node on the device link of the server is obtained, and the first configuration list is queried based on the second identity information of the device node to determine whether the second identity information is consistent with the first identity information on the first configuration list.
[0070] The first configuration list is used to store the first identity information of the target device, and the second identity information includes DID, VID, SSID, and SVID information of the device node.
[0071] It can be understood that the embodiment of the application can obtain the second identity information of the device node on the device link of the server, query the first configuration list based on the second identity information of the device node, and determine whether the second identity information is consistent with the first identity information on the first configuration list, so as to obtain the device information of the target device subsequently.
[0072] Specifically, the embodiment of the application can obtain the multi-Function device core identity information stored in the NVRAM through the getVariable function, and store the read information into the first configuration list. The Pcieinfo module executes the node on all PCIE links in turn, obtains the DID, VID, SSID, and SVID information (second identity information) of the node in turn, and compares the DID, VID, SSID, and SVID of the node with the first identity information in the first configuration list in turn.
[0073] In step S103, if the second identity information is consistent with the first identity information, the count value in the first identity information is recognized, the device topology of the device node is obtained, the target device on the device topology is queried from the device topology based on the count value, and the device information of the target device is obtained.
[0074] The count value can be a Count value.
[0075] It can be understood that, when the second identity information is consistent with the first identity information on the first configuration list, the counting value in the first identity information is recognized, and the target device on the device topology of the device node is queried based on the counting value, the device information of the target device is acquired, and the device information of the target device is taken as the core identity information of the device.
[0076] In step S104, if the second identity information is inconsistent with the first identity information, the device topology of the device node is acquired, the first device of the device topology is taken as the target device on the device topology, and the device information of the target device is acquired.
[0077] It can be understood that, when the second identity information is inconsistent with the first identity information on the first configuration list, the first device in the device topology of the device node is taken as the target device on the device topology, and the device information of the first device is taken as the core identity information of the device, so as to ensure that the device information can be recognized when the target device of the device node is not configured by the user, avoid the risk of loss of device asset information, ensure the compatibility of the device, and guarantee the stable operation of the server system.
[0078] Since the device asset information of each device in the server is important information for realizing the whole life cycle management of the device and guaranteeing the stable operation of the server, it is necessary to acquire the device asset information of each device in the server. However, due to the device architecture, firmware version, system environment factors and other factors of different manufacturers, the position of the key device representing the core identity information of the device in the device topology is uncertain. The hard coding method in the related technology cannot adapt to firmware updates, and the key device of each device is re-written based on the code, which has poor flexibility. Therefore, the embodiment of the application can dynamically and accurately locate the key target device based on the counting value in the identity information of the target device on the device topology, replace the manual hard coding method to acquire the key target device information, and does not need to hard code and adapt to each device separately. Only the identity information of the device needs to be pre-configured, which can flexibly adapt to more devices, reduce the labor and development cost, improve the compatibility of the server to diversified devices, and ensure that the device asset information can be accurately acquired when the enumeration order of the device changes, guarantee the freedom of device update, and further guarantee the long-term stable operation of the server system.
[0079] In some embodiments of the application, after acquiring the device information of the target device, the device information is stored in the first storage, and the storage information of the first storage is transmitted to the baseboard management controller. The baseboard management controller recognizes the device information in the storage information and displays the device information.
[0080] The starting system can deliver the device information to the baseboard management controller through H2B (Host to BMC).
[0081] It can be understood that, after the device information of the target device is acquired, the device information is stored in the first memory, and the storage information of the first memory is delivered to the baseboard management controller. The baseboard management controller identifies the device information in the storage information and displays the device information, so as to complete the delivery of the device information and also provide it for other functions.
[0082] Specifically, the execution flow of the information acquisition of the embodiment of the application is as shown in Figure 2 The execution flow of the information acquisition of the embodiment of the application is as shown in
[0083] Step 1: The server is started.
[0084] Step 2: A structure body is added, which is used to store the core identity information of the multiple Function devices that have been set,
[0085] typedef struct{UINT16 Did;
[0086] UINT16Vid;
[0087] UINT16Ssid;
[0088] UINT16Svid;
[0089] UINT16Count
[0090] } DEVICE_MESSAGE; and a variable DEVICE_MESSAGE *DevList is defined.
[0091] Step 3: The multiple Function device core identity information (first identity information) stored in the NVRAM (first memory) is acquired through the getVariable function, and the read information is stored in the DevList (first configuration list).
[0092] Step 4: The Pcieinfo module is executed to poll all nodes on the PCIE link in sequence, and the DID, VID, SSID and SVID information of the nodes are acquired in sequence. If the acquisition is successful, the next step is entered, otherwise, step 8 is jumped to.
[0093] Step 5: The DID, VID, SSID and SVID of the node are compared with the information in the DevList in sequence. If the corresponding device information is found, step 6 is entered, otherwise, if it is an EP device, step 8 is jumped to, and in other cases, step 4 is jumped to for further searching.
[0094] It should be noted that EP is an endpoint device, that is, the device is obtained, if in DevList, special processing is required, if not in the list, it is considered to be a specific device information that needs to be displayed, which can represent a specific in-place device.
[0095] Step 6: Get the corresponding Count value (count value) in DevList, and sequentially find the Countth device information of the same BUS (node) number.
[0096] Step 7: If the device is found, get all useful information of the device, including DID, VID, SSID, SVID, ClassCode (class code), SubClassCode (subclass code), MaxLinkWidth (maximum link width), MaxLinkSpeed (maximum link rate) and all information stored according to the interaction specification. The information is the final information displayed to the outside of the device, and the next BUS number is obtained and the step 4 is jumped to continue searching; if not found, continue to the next step.
[0097] Step 8: Get the device information of the first Function of the device as the core identity information of the device, and get all useful information of the Function device, including DID, VID, SSID, SVID, ClassCode, SubClassCode, MaxLinkWidth, MaxLinkSpeed and all information stored according to the interaction specification. The information is the final information displayed to the outside of the device, and the step 4 is jumped to continue searching.
[0098] Step 9: After polling, the finally summarized storage information is transmitted to BMC through H2B to display PCIE device and other functions, so as to complete the transmission of PCIE device information.
[0099] Step 10: End.
[0100] According to the device information acquisition method provided in the embodiments of the present application, the count value in the identity information of the target device on the device topology can be defined, and the key target device can be dynamically and accurately positioned based on the count value. The key target device information is acquired by replacing the manual hard coding mode, without the need for separate hard coding adaptation for each device. Only the identity information of the device needs to be pre-configured, which can flexibly adapt to more devices, reduce labor and development costs, improve the compatibility of the server to diversified devices, and at the same time, even when the firmware is updated, the device can still be positioned by matching the identity information, ensuring that the device asset information can be accurately acquired when the device enumeration order changes, protecting the freedom of device update, and further ensuring the long-term stable operation of the server system.
[0101] The above embodiment focuses on describing the device information acquisition method of the present application from the starting system end, and the following embodiment focuses on describing the device information acquisition method of the present application from the baseboard management controller end. The embodiments can be cross-referenced for the details not described.
[0102] Figure 3 A flowchart of the device information acquisition method according to another embodiment of the present application.
[0103] As shown in Figure 3 The device information acquisition method is applied to a baseboard management controller and includes the following steps.
[0104] In step S201, a first command sent by a starting system is acquired. The starting system responds to an adding instruction of a device topology, sets first identity information of a target device on the device topology in a first setting page, and generates a first command according to the first identity information after the setting is completed.
[0105] The first setting page is a page for setting the first identity information of the target device on the device topology at the starting system end, which can be referred to as an adding setting page. The first command can be an IPMI command, which is sent by the starting system and used to store information of a plurality of functions and core identity information of a first built-in device, and set interface specifications and storage information standards.
[0106] It can be understood that the first command sent by the starting system can be acquired according to the embodiments of the present application. The starting system responds to the adding instruction of the device topology, sets the first identity information of the target device on the device topology in the first setting page, and generates the first command according to the first identity information after the setting is completed.
[0107] In some embodiments of the present application, before the first command sent by the starting system is acquired, the following steps are further included. The first identity information of the target device on the device topology is set in a third setting page in response to the adding instruction of the device topology. After the setting is completed, it is determined whether the first identity information is valid. If the first identity information is valid, the first identity information is updated to a second storage, a third command is generated according to the first identity information, the third command is sent to the starting system, the starting system responds to the third command, and the first identity information is saved to a first storage. Feedback information of the starting system is acquired. If an identification of a saving completion is identified in the feedback information, at least one of an adding success prompt and a server restart prompt is generated.
[0108] The third setting page is a first identity information setting page for setting a target device on a device topology at a BMC end, and can be referred to as an adding setting page. The third command is also an IPMI command, which is sent by the BMC and used to store information of a multi-Function device and core identity information of a first built-in device, and set interface specifications and standards of stored information.
[0109] It can be understood that the embodiments of the present application can set the first identity information of the target device on the device topology in the third setting page in response to an adding instruction of the device topology. After the setting is completed, it is judged whether the first identity information is valid. If the first identity information is valid, the first identity information is updated to the second memory. The third command is generated according to the first identity information, and the third command is sent to the starting system. The starting system saves the first identity information to the first memory in response to the third command. The feedback information of the starting system is obtained. If a save completion identifier is identified in the feedback information, at least one of an adding success prompt and a server restart prompt is generated.
[0110] Specifically, the user of the embodiments of the present application can add device information at the BMC end. The process includes the following steps.
[0111] 1. Click the adding button to pop up an input box, which includes DID, VID, SSID, SVID, COUNT prompt information and information setting box;
[0112] 2. After the information is filled in, click the "Confirm" button to enter the next step, or click the "Cancel" button to exit the adding setting box;
[0113] 3. Check all input information. All information must be numerical. If the information is filled in incorrectly, the corresponding detailed information is prompted. Otherwise, enter the next step;
[0114] 4. The BMC stores the core identity information of the multi-Function device into the EEPROM (second memory) specified position according to the protocol requirements, and generates an IPMI command (third command) according to the IPMI requirements of the added multi-Function device information and sends it to the starting system;
[0115] 5. After the starting system receives the command, it suspends the current task and immediately enters the interrupt processing program;
[0116] 6. The interrupt processing program is called to parse the IPMI command according to the interaction specification and update the multi-Function device core identity information stored in the NVRAM (second memory);
[0117] 7. After the modification is completed, the starting system returns a response of 00 to the BMC, and clears the interrupt flag;
[0118] 8. The front-end display prompt box: "add device successfully, need to restart the server to take effect", and provide "immediate restart" and "later restart" options.
[0119] In step S202, the first identity information in the first command is identified, the information identifier and the first device identifier data are obtained by parsing the first identity information, and if the information identifier is a pre-set target identifier, a data structure body is established.
[0120] The information identifier can be an information header; the target identifier is a pre-set identifier, which is used to ensure the legitimacy of the information, filter valid commands, exclude invalid / illegal data, and can be used to determine the type of command for managing device information; and the device identifier data can include DID, VID, SSID, SVID, etc.
[0121] It can be understood that the embodiments of the present application can obtain the information identifier and the first device identifier data by parsing the first identity information, and if the information identifier is a pre-set target identifier, it indicates that it is a legal instruction, and then the data structure body is established.
[0122] In step S203, the first device identifier data is stored in the data structure body, the fourth identity information of the target device on the device topology is read from the second memory, and the fourth identity information is stored in the pre-set fourth configuration list.
[0123] The fourth configuration list stores the fourth identity information of the target device read from the second memory.
[0124] It can be understood that the embodiments of the present application can use the data structure body to read the fourth identity information of the target device on the device topology from the second memory, and store the fourth identity information in the pre-set fourth configuration list, so as to query the device identity information subsequently.
[0125] In step S204, the fourth configuration list is queried based on the data structure body, if the query is successful, the first identity information is used to update the fourth identity information, and if the query fails, the first identity information is added to the fourth configuration list.
[0126] It can be understood that the embodiments of the present application can query the fourth configuration list based on the data structure body, when the query is successful, it indicates that the identity information of the device has been stored in the second memory previously, and the latest first identity information is used to update the previous fourth identity information, so that the identity information in the fourth configuration list is the latest information, which is convenient for subsequent acquisition of accurate device information, and when the query fails, it indicates that the identity information of the device has not been stored in the second memory previously, and the identity information can be added to the fourth configuration list directly.
[0127] In step S205, the fourth configuration list is stored to the second memory, a save completion identifier is generated, feedback information is generated according to the save completion identifier, the feedback information is sent to the starting system, and the starting system starts the server to execute the device information acquisition method described above.
[0128] It can be understood that the device information acquisition method described above can be executed in the process of storing the fourth configuration list to the second memory, generating a save completion identifier, generating feedback information according to the save completion identifier, sending the feedback information to the starting system, and starting the server by the starting system, so as to accurately acquire device information.
[0129] Figure 4 A flowchart of a device information acquisition method according to still another embodiment of the application is provided.
[0130] As shown in Figure 4 , the device information acquisition method is applied to a baseboard management controller and includes the following steps.
[0131] In step S301, a second command sent by a starting system is acquired, the starting system responds to a deletion instruction of a device topology, sets first identity information of a target device on the device topology in a second setting page, and generates a second command according to the first identity information after setting is completed.
[0132] The second setting page is a first identity information setting page for deleting a target device on the device topology on the starting system side, and can be referred to as a deletion setting page. The second command can be an IPMI command, which is sent by the starting system and used to delete information of a plurality of functions and core identity information of a first built-in device of a target device.
[0133] It can be understood that the device information acquisition method described above can be executed in the process of storing the fourth configuration list to the second memory, generating a save completion identifier, generating feedback information according to the save completion identifier, sending the feedback information to the starting system, and starting the server by the starting system, so as to accurately acquire device information.
[0134] In some embodiments of the application, before the second command sent by the starting system is acquired, the method further includes: responding to a deletion instruction of a device topology, setting first identity information of a target device on the device topology in a fourth setting page, judging whether the first identity information is valid after setting is completed, deleting the first identity information from the second memory if the first identity information is valid, generating a fourth command according to the first identity information, sending the fourth command to the starting system, and responding to the fourth command by the starting system to delete the first identity information from the first memory; acquiring feedback information of the starting system, and generating at least one of a deletion success prompt and a server restart prompt if a deletion completion identifier is identified in the feedback information.
[0135] The fourth setting page is a first identity information setting page for setting a target device on a device topology at a baseboard management controller end, and can be referred to as a deletion setting page. The fourth command is also an IPMI command, which is sent by the baseboard management controller and used to delete information of a multi-function device and core identity information of a first built-in device.
[0136] It can be understood that the embodiments of the present application can set the first identity information of the target device on the device topology in response to an adding instruction of the device topology in the fourth setting page. After the setting is completed, it is determined whether the first identity information is valid. If the first identity information is valid, the first identity information is updated to the second memory. The fourth command is generated according to the first identity information, and the fourth command is sent to the starting system. The starting system deletes the first identity information from the first memory in response to the fourth command. The feedback information of the starting system is obtained. If a save completion identifier is identified in the feedback information, at least one of a deletion success prompt and a server restart prompt is generated.
[0137] Specifically, the user of the embodiments of the present application can delete the device information at the baseboard management controller end. The process includes the following steps.
[0138] 1. Click the "delete" button to pop up an input box, including DID, VID, SSID, SVID prompt information and information setting box;
[0139] 2. After the information is filled in, click the "confirm" button to enter the next step, and click the "cancel" button to exit the adding setting box;
[0140] 3. Check all input information. All information must be numerical. If the information is filled in incorrectly, the corresponding detailed information is prompted. Otherwise, enter the next step;
[0141] 4. The baseboard management controller finds and deletes the core identity information of the multi-function device in the EEPROM (second memory) according to the protocol requirements. If the information exists, enter the next step. Otherwise, prompt "no related device information found" and return;
[0142] 5. Generate an IPMI command according to the requirements of deleting the core identity information of the multi-function device and send it to the starting system;
[0143] 6. After the starting system receives the command, it suspends the current task and immediately enters the interrupt processing program;
[0144] 7. The starting system parses the IPMI command according to the interaction specification, and deletes the core identity information of the multi-function device stored in the NVRAM (first memory);
[0145] 8. After the modification is completed, the system returns a response of 00 to the baseboard management controller, and clears the interrupt flag;
[0146] 9. The front end displays a prompt box: "Device deletion is successful, and the server needs to be restarted to take effect", and provides "Restart immediately" and "Restart later" buttons.
[0147] In step S302, the first identity information in the second command is identified, the first identity information is parsed to obtain information identification and first device identification data, and if the information identification is a pre-set target identification, a data structure body is established.
[0148] The information identification can be an information header, the target identification is a pre-set identification, is used to ensure the legitimacy of information, filter valid commands, exclude invalid / illegal data, and can be used to determine the type of command, and is used to manage device information; and the device identification data can include DID, VID, SSID, SVID, etc.
[0149] It can be understood that the first identity information is parsed to obtain information identification and first device identification data, and if the information identification is a pre-set target identification, it indicates that it is a legal instruction, and then the data structure body is established.
[0150] In step S303, the first device identification data is stored by using the data structure body, the fifth identity information of the target device on the device topology is read from the second memory, and the fifth identity information is stored in the pre-set fifth configuration list.
[0151] The fifth configuration list stores the fifth identity information of the target device read from the second memory.
[0152] It can be understood that the first device identification data is stored by using the data structure body, the fifth identity information of the target device on the device topology is read from the second memory, and the fifth identity information is stored in the pre-set fifth configuration list, so as to facilitate subsequent query of device identity information.
[0153] In step S304, the fifth configuration list is queried based on the data structure body, if the query is successful, the corresponding fifth identity information is deleted from the second memory, the fifth configuration list is stored in the second memory, a deletion completion identification is generated, feedback information is generated according to the deletion completion identification, the feedback information is sent to the startup system, and the startup system starts the server process to execute the above-mentioned device information acquisition method.
[0154] It can be understood that the embodiments of the present application can query the fifth configuration list based on the data structure, and when the query is successful, it indicates that the identity information of the device has been stored in the second memory in the past, and then the corresponding fifth identity information is deleted, so as to facilitate subsequent accurate device information acquisition. The fifth configuration list can be stored in the second memory, a deletion completion identifier is generated, feedback information is generated according to the deletion completion identifier, the feedback information is sent to the starting system, and the device information acquisition method is executed in the starting system server process to accurately acquire device information.
[0155] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.
[0156] Based on the above device information acquisition method, the execution process of the embodiments of the present application mainly includes two parts: one is to configure device information, and the other is to acquire device information. The BMC (Baseboard Management Controller) and the BIOS can both configure device information, and information interaction is needed during and after the configuration process to ensure information synchronization and improve the accuracy of subsequent device information acquisition.
[0157] The hardware architecture of device information interaction and acquisition of the embodiments of the present application is shown in Figure 5 , which includes management and protocol layer, BMC, BIOS, communication medium, interface, etc.
[0158] The management and protocol layer includes IPMI management software, IPMI protocol layer, and communication interface layer. The IPMI management software is used to initiate management instructions (i.e. configuration instructions), the IPMI protocol layer is a protocol carrier for information transmission, and carries the interaction commands of BMC and BIOS, and the communication interface layer is a conversion bridge between protocol and hardware, which converts IPMI commands and Redfish protocol instructions into hardware interaction signals recognizable by BMC and BIOS.
[0159] The BMC is used to register IPMI commands according to protocol specifications, and is used for IPMI command interaction whether the setting is successful or not, and Redfish protocol interaction. When a user configures multi-function device information through BIOS, the user needs to realize the bidirectional transmission of configuration instructions through the Redfish protocol.
[0160] The BIOS is used to read device information from the memory and dynamically locate multi-function devices.
[0161] I. In the configuration device information stage, the IPMI command support information interaction is added.
[0162] (1) BMC side.
[0163] 1. Information adding process.
[0164] Step 1: BMC adds an IPMI command of an OEM, which is used to store the information of a multi-Function device and the identity information of the first built-in device, and sets the interface specification and the standard of the stored information, including the information identification bit _DEVID_, DID, VID, SSID, SVID and COUNT of the device (identity information).
[0165] Step 2: When BMC receives the command, it parses and judges whether the information header (i.e. information identification) is _DEVID_ (pre-set target identification). If the information header is _DEVID_, go to Step 3; otherwise, return 01, indicating that the setting information is invalid, and the execution ends.
[0166] Step 3: Add a structure (i.e. data structure) for storing the parsed information typedef struct{UINT16 Did;
[0167] UINT16Vid;
[0168] UINT16Ssid;
[0169] UINT16Svid;
[0170] UINT16Count
[0171] } DEVICE_MESSAGE;
[0172] And set the variable DevMessage for storing the identity information of the added multi-Function device core.
[0173] Step 4: Parse the information of the IPMI command in order, with each field being two bytes, i.e. DID, VID, SSID, SVID and COUNT, and store the information in DevMessage.
[0174] Step 5: Define the variable DEVICE_MESSAGE *EepromDevList, read the identity information of the multi-Function device core in the specified position of EEPROM (the second memory), return the stored number N, and store it to EepromDevList (the fourth configuration list).
[0175] Step 6: Compare the information in DevMessage (which stores the first identity information) with the information in EepromDevList (the fourth configuration list). If it already exists, update EepromDevList according to DevMessage. If it does not exist, add the information of DevMessage at the end of EepromDevList.
[0176] Step 7: Rewrite all the information of EepromDevList in the specified location in EEPROM, and return information 00, indicating that the information has been successfully stored in EEPROM.
[0177] Step 8: End.
[0178] 2. Information deletion process.
[0179] Step 1: Add an IPMI command for an OEM to delete the core identity information of a multi-Function device, including the flag bit _DEVID_, the DID, VID, SSID, and SVID of the device.
[0180] Step 2: When the BMC receives the command, parse and judge the information header to be _DEVID_. If the information header is _DEVID_, go to Step 3; otherwise, return 01, indicating that the information header is incorrect, and end.
[0181] Step 3: Add a structure body to store the parsed information typedef struct{UINT16 Did;
[0182] UINT16Vid;
[0183] UINT16Ssid;
[0184] UINT16Svid
[0185] } DEVICE_MESSAGE;
[0186] And add a variable _DevDelete to store the core identity information of the multi-Function device to be deleted.
[0187] Step 4: Parse the information of the IPMI command in order, with each field being two BYTES, in the order of DID, VID, SSID, and SVID, and store the information in DevDelete (which stores the first identity information).
[0188] Step 5: Add a variable DEVICE_MESSAGE *EepromDevList to store the set core identity information of the multi-Function device.
[0189] Step 6: Get the multi-Function device core identity information from the specified location of the EEPROM as required and fill the return information into EepromDevList (the fifth configuration list).
[0190] Step 7: Poll the information in EepromDevList, query whether there is information matching DevDelete, if matching is successful, jump to the next step; otherwise, return information 05, indicating that there is no information to be deleted, jump to the end.
[0191] Step 8: Delete the DevDelete information in EepromDevList.
[0192] Step 9: Rewrite all information of EepromDevList in the specified location of the EEPROM and return information 00, indicating that the device information in the EEPROM has been successfully deleted.
[0193] Step 10: End.
[0194] Specifically, the BMC WEB adds a module, and the functions include adding, deleting, and querying functions.
[0195] This module realizes the adding, deleting, and querying of the multi-Function device information core identity of the user on the BMC WEB end, and the specific process is as follows:
[0196] 1. Add device information, as shown in Figure 6
[0197] Step 1: Click the "Add" button.
[0198] Step 2: Pop up the input box, including DID, VID, SSID, SVID, COUNT prompt information and information setting box.
[0199] Step 3: After filling in the information, click the button.
[0200] Step 4: Click the "Cancel" button to exit the add setting box.
[0201] Step 5: Click the "Confirm" button to check all input information. All information must be numerical type. If the information is filled incorrectly, go to step 12; otherwise, go to the next step.
[0202] Step 6: The BMC stores the multi-Function device core identity information into the specified location of the EEPROM according to the protocol requirements, and generates an IPMI command according to the IPMI requirements of the added multi-Function device information and sends it to the BIOS.
[0203] Step 7: After receiving the command, the BIOS pauses the current task and immediately enters the interrupt handler;
[0204] Step 8: The interrupt handler is called to parse the IPMI command according to the interaction specification and update the multi-function device core identity information stored in NVRAM (i.e., the first memory).
[0205] Step 9: After the modification is completed, the BIOS returns a 00 response to the BMC and clears the interrupt flag.
[0206] Step 10: The front end displays a prompt box: "Device added successfully, server restart required for the changes to take effect".
[0207] Step 11: Provides "Restart Now" and "Restart Later" options.
[0208] Step 12: Display detailed information about the corresponding error.
[0209] 2. Delete device information.
[0210] Step 1: Click the "Delete" button. An input box will pop up, including DID, VID, SSID, SVID prompts and an information settings box;
[0211] Step 2: After filling in the information, click the "Confirm" button to proceed to the next step; click the "Cancel" button to exit the new settings box.
[0212] Step 3: Validate all input information. All information must be numeric. If the information is entered incorrectly, display detailed information about the error; otherwise, proceed to the next step.
[0213] Step 4: BMC searches for and deletes the core identity information of the multi-function device in the EEPROM according to the protocol requirements. If the information exists, proceed to the next step; otherwise, it will prompt "No relevant device information found" and return.
[0214] Step 5: Generate an IPMI command and send it to the BIOS according to the IPMI requirements for deleting the core identity information of multi-function devices;
[0215] Step 6: After receiving the command, the BIOS pauses the current task and immediately enters the interrupt handler;
[0216] Step 7: The BIOS parses the IPMI command according to the interaction specification and deletes the core identity information of the multi-function device stored in NVRAM;
[0217] Step 8: After the modification is completed, the BIOS returns a 00 response to the BMC and clears the interrupt flag;
[0218] Step 9: The front end displays a prompt box: "Device deletion successful, server needs to be restarted to take effect", and provides "Restart immediately" and "Restart later" buttons.
[0219] 2. Query device information.
[0220] Click the "Query" button, and the BMC returns all stored multi-Function device information according to the actual storage condition, and displays each piece of information on the BMC WEB interface.
[0221] (II) BIOS end.
[0222] SETUP adds a Complex Device Info Support module under SETUP;
[0223] 1. Enter the BIOS SETUP path, Socket Configuration -> IIOConfiguration, and add a Complex Device Info Support module. The module includes the newly added options Add Device, Delete Device, and the Show DeviceMessage area, which are used to add, delete, and display the multi-Function device core identity information, respectively.
[0224] 2. Click Add Device to pop up the new setting page. The setting information includes DID, VID, SSID, SVID, and COUNT, which are used to set the multi-Function device core identity information. After setting is completed, click the "Confirm" button to judge the validity of the data. If the data is valid, the information is updated to the BIOS NVRAM (i.e., the first memory) after deduplication, and needs to be sent to the BMC for saving through the IPMI command of the information storage process. After saving is completed, a prompt "Device addition successful, server needs to be restarted to take effect" is displayed, and the "Restart immediately" and "Restart later" buttons are provided. At the same time, the information query command is used to update the Show DeviceMessage information display area. Click the "Cancel" button to make no settings and return to the previous page.
[0225] 3, click Delete Device, pop-up delete settings page, set information includes DID, VID, SSID, SVID information, click "OK" button, judge the validity of the data. If valid, update the BIOS NVRAM in accordance with the IPMI command processing logic, and need to send to the BMC through the information delete process IPMI command, after the processing is completed, prompt "delete device success, need to restart the server to take effect", and provide "immediate restart" and "later restart" button; at the same time, update the Show Device Message information display area using the information query command; click "cancel" button, do not do anything and back to the settings page;
[0226] 4, Show Device Message information display, each time the Add Device, Delete Device function is executed successfully, all the set device information is queried through the information query process, and the page is updated synchronously when entering the page, and displayed on the page.
[0227] II, information acquisition stage, BIOS boot process, as shown in Figure 2 .
[0228] Step 1: server startup.
[0229] Step 2: add a structure body for storing the core identity information of the set multi-function device,
[0230] typedef struct{UINT16Did;
[0231] UINT16Vid;
[0232] UINT16Ssid;
[0233] UINT16Svid;
[0234] UINT16Count
[0235] } DEVICE_MESSAGE; and define variable DEVICE_MESSAGE *DevList.
[0236] Step 3: get the multi-function device core identity information (first identity information) stored in the NVRAM (first memory) through the getVariable function, and store the read information into DevList (first configuration list).
[0237] Step 4: The Pcieinfo module performs polling on all nodes on the PCIE link in turn, and obtains the DID, VID, SSID, and SVID information of the nodes in turn. If the obtaining is successful, the next step is entered, otherwise, step 8 is jumped to.
[0238] Step 5: The DID, VID, SSID, and SVID of the node are compared with the information in the DevList in turn. If the corresponding device information is found, step 6 is entered; otherwise, if it is an EP device, step 8 is jumped to, and other cases jump to step 4 to continue searching.
[0239] It should be noted that EP is an endpoint device, that is, the device is obtained. If it is in the DevList, it needs to be specially processed, and if it is not in the list, it is considered to be specific device information that needs to be displayed, which can represent a specific in-place device.
[0240] Step 6: The Count value (count value) corresponding to the DevList is obtained, and the Countth device information of the same BUS (node) number is searched in turn.
[0241] Step 7: All useful information of the device is obtained, including DID, VID, SSID, SVID, ClassCode, SubClassCode, MaxLinkWidth, MaxLinkSpeed, and all information is stored according to the interaction specification. The information is used as the final device information displayed to the outside, the next BUS number is obtained, and step 4 is jumped to continue searching; if it cannot be found, the next step is continued.
[0242] Step 8: The device information of the first Function of the device is obtained as the core identity information of the device, and all useful information of the Function device is obtained, including DID, VID, SSID, SVID, ClassCode, SubClassCode, MaxLinkWidth, MaxLinkSpeed, and all information is stored according to the interaction specification. The information is used as the final device information displayed to the outside, and step 4 is jumped to continue searching.
[0243] Step 9: After the polling is completed, the final summarized storage information is transmitted to the BMC through H2B for PCIE device display and other functional use, thereby completing the transmission of the PCIE device information.
[0244] Step 10: End.
[0245] In summary, the embodiment of the application realizes automatic scanning and feature matching of the device topology by defining the key device feature identifier-count value, dynamically locates the key device, so that the platform can flexibly adapt to more devices, break away from the hard coding restrictions, adapt to new devices without modifying the BIOS code, simplify the code library and reduce maintenance costs, automatically adapt to firmware updates, avoid asset information acquisition errors, protect device update freedom, improve the compatibility of servers for diversified intelligent devices, shorten the product launch cycle, and meet the rapid development needs of intelligent devices.
[0246] One embodiment of the application also provides a device information acquisition apparatus.
[0247] Figure 7 A schematic diagram of the device information acquisition apparatus according to one embodiment of the application.
[0248] As shown in Figure 7 The device information acquisition apparatus is applied to a startup system and includes a first acquisition module 101, a first query module 102, a second acquisition module 103, and a third acquisition module 104.
[0249] The first acquisition module 101 is configured to acquire first identity information of a target device on a device topology during a server startup process, and store the first identity information of the target device to a pre-set first configuration list. The device topology includes a plurality of devices, and the device information level of the target device is higher than that of other devices on the device topology.
[0250] The first query module 102 is configured to acquire second identity information of a device node on a device link of the server, query the first configuration list based on the second identity information of the device node, and determine whether the first identity information is consistent with the second identity information on the first configuration list.
[0251] The second acquisition module 103 is configured to identify a count value in the second identity information if the second identity information is consistent with the first identity information, acquire a device topology of the device node, query the target device on the device topology based on the count value, and acquire device information of the target device.
[0252] The third acquisition module 104 is configured to acquire a device topology of the device node if the second identity information is inconsistent with the first identity information, take a first device of the device topology as the target device on the device topology, and acquire device information of the target device.
[0253] In some embodiments of the application, the device information acquisition apparatus 10 of the embodiment of the application further includes a first update module.
[0254] The first updating module is configured to, in response to an adding instruction of the device topology, set the first identity information of the target device on the device topology on the first setting page before obtaining the first identity information of the target device on the device topology, and determine whether the first identity information is valid after the setting is completed. If the first identity information is valid, the first identity information is updated to the first storage, the first command is generated according to the first identity information, the first command is sent to the baseboard management controller, the baseboard management controller responds to the first command, and the first identity information is saved to the second storage. The feedback information of the baseboard management controller is obtained, and at least one of the adding success prompt and the server restart prompt is generated after a save completion identifier is identified in the feedback information.
[0255] In some embodiments of the present application, the device information acquisition apparatus 10 of the embodiments of the present application further comprises a first deleting module.
[0256] The first deleting module is configured to, in response to a deleting instruction of the device topology, set the first identity information of the target device on the device topology on the second setting page after the at least one of the adding success prompt and the server restart prompt is generated, and determine whether the first identity information is valid after the setting is completed. If the first identity information is valid, the first identity information is deleted from the first storage, the second command is generated according to the first identity information, the second command is sent to the baseboard management controller, the baseboard management controller responds to the second command, and the first identity information is deleted from the second storage. The feedback information of the baseboard management controller is obtained, and at least one of the deleting success prompt and the server restart prompt is generated after a delete completion identifier is identified in the feedback information.
[0257] In some embodiments of the present application, the device information acquisition apparatus 10 of the embodiments of the present application further comprises a first parsing module.
[0258] The first analysis module is configured to, before obtaining the first identity information of the target device on the device topology, obtain a third command sent by the baseboard management controller, the baseboard management controller setting the first identity information of the target device on the device topology on a third setting page in response to an adding instruction of the device topology, and generating the third command according to the first identity information after the setting is completed; identifying the first identity information in the third command, analyzing the first identity information to obtain information identification and first device identification data, establishing a data structure if the information identification is a pre-set target identification; storing the first device identification data by using the data structure, reading third identity information of the target device on the device topology from a first memory, and storing the third identity information to a pre-set second configuration list; querying the second configuration list based on the data structure, updating the third identity information by using the first identity information if the query is successful, adding the first identity information in the second configuration list if the query fails; storing the second configuration list to the first memory, generating a save completion identification, generating feedback information according to the save completion identification, and sending the feedback information to the baseboard management controller.
[0259] In some embodiments of the present application, the device information acquisition apparatus 10 of the embodiments of the present application further comprises a second analysis module.
[0260] The second analysis module is configured to, before obtaining the first identity information of the target device on the device topology, obtain a fourth command sent by the baseboard management controller, the baseboard management controller setting the first identity information of the target device on the device topology on a fourth setting page in response to a deleting instruction of the device topology, and generating the fourth command according to the first identity information after the setting is completed; identifying the first identity information in the fourth command, analyzing the first identity information to obtain information identification and first device identification data, establishing a data structure if the information identification is a pre-set target identification; storing the first device identification data by using the data structure, reading third identity information of the target device on the device topology from a first memory, and storing the third identity information to a pre-set third configuration list; querying the third configuration list based on the data structure, deleting the corresponding third identity information from the first memory if the query is successful, storing the third configuration list to the first memory, generating a deletion completion identification, generating feedback information according to the deletion completion identification, and sending the feedback information to the baseboard management controller.
[0261] Figure 8 A schematic diagram of a device information acquisition apparatus according to another embodiment of the present application.
[0262] As shown in Figure 8 The device information acquisition apparatus 20 applied to a baseboard management controller comprises a fourth obtaining module 201, a third analysis module 202, a first storage module 203, a second query module 204, and a sending module 205.
[0263] The fourth obtaining module 201 is configured to obtain a first command sent by a starting system, and the starting system is configured to set first identity information of a target device on a device topology in a first setting page in response to an adding instruction of the device topology, and generate the first command according to the first identity information after the setting is completed.
[0264] The third analyzing module 202 is configured to identify the first identity information in the first command, analyze the first identity information to obtain information identification and first device identification data, and establish a data structure if the information identification is a target identification set in advance.
[0265] The first storage module 203 is configured to store the first device identification data by using the data structure, read fourth identity information of the target device on the device topology from a second storage, and store the fourth identity information in a fourth configuration list set in advance.
[0266] The second querying module 204 is configured to query the fourth configuration list based on the data structure, update the fourth identity information by using the first identity information if the query is successful, and add the first identity information in the fourth configuration list if the query fails.
[0267] The sending module 205 is configured to store the fourth configuration list to the second storage, generate a saving completion identification, generate feedback information according to the saving completion identification, send the feedback information to the starting system, and execute the device information obtaining apparatus in the starting system during starting of a server.
[0268] In some embodiments of the present application, the device information obtaining apparatus 20 further comprises a second updating module.
[0269] The second updating module is configured to set the first identity information of the target device on the device topology in a third setting page in response to the adding instruction of the device topology before obtaining the first command sent by the starting system, judge whether the first identity information is valid after the setting is completed, update the first identity information to the second storage if the first identity information is valid, generate a third command according to the first identity information, send the third command to the starting system, save the first identity information to a first storage in response to the third command by the starting system, and generate at least one of an adding success prompt and a server restart prompt if a saving completion identification is identified in the feedback information.
[0270] Figure 9 A schematic diagram of a device information obtaining apparatus according to still another embodiment of the present application.
[0271] As Figure 9As shown, the device information acquisition apparatus 30 applied to the substrate management controller comprises a fifth acquisition module 301, a fourth analysis module 302, a second storage module 303 and a third query module 304.
[0272] The fifth acquisition module 301 is configured to acquire a second command sent by a starting system, the starting system responding to a deletion instruction of a device topology, setting first identity information of a target device on the device topology in a second setting page, and generating the second command according to the first identity information after the setting is completed.
[0273] The fourth analysis module 302 is configured to identify the first identity information in the second command, analyze the first identity information to obtain information identification and first device identification data, and establish a data structure if the information identification is a pre-set target identification.
[0274] The second storage module 303 is configured to store the first device identification data by using the data structure, read fifth identity information of the target device on the device topology from a second storage, store the fifth identity information to a pre-set fifth configuration list, and delete the corresponding fifth identity information from the second storage based on the data structure.
[0275] The third query module 304 is configured to query the fifth configuration list based on the data structure, delete the corresponding fifth identity information from the second storage if the query is successful, store the fifth configuration list to the second storage, generate a deletion completion identification, generate feedback information according to the deletion completion identification, and send the feedback information to the starting system.
[0276] In some embodiments of the present application, the device information acquisition apparatus 30 further comprises a second deletion module.
[0277] The second deletion module is configured to, before acquiring the second command sent by the starting system, respond to the deletion instruction of the device topology, set the first identity information of the target device on the device topology in the fourth setting page, and judge whether the first identity information is valid after the setting is completed.
[0278] It should be noted that the description of the features in the embodiments of the device information acquisition apparatus can refer to the related description of the embodiments of the device information acquisition method, which will not be repeated here.
[0279] Embodiments of the present application also provide an electronic device, comprising a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the device information acquisition method embodiments described above.
[0280] Those skilled in the art will further appreciate that the units and algorithms described in connection with the examples disclosed herein can be embodied directly in hardware, in software, or in a combination of the two. For ease of understanding, the illustrative description has been generally described in functional terms. The term "software" should be interpreted to include any program instructions, firmware, code, or other data that can be read by a computer or other hardware device to cause the hardware device to perform a function. The software may
[0281] The above describes in detail a device information acquisition method provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the examples is only for helping to understand the method of the present application and its core idea. It should be noted that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. An apparatus information acquisition method characterized by comprising: The method is applied to a starting system, and the method comprises the following steps: In a server starting process, first identity information of a target device on a device topology is acquired, and the first identity information of the target device is stored in a first configuration list set in advance, the device topology comprises a plurality of devices, and device information level of the target device is higher than that of other devices on the device topology; Second identity information of a device node on a device link of the server is acquired, the first configuration list is queried based on the second identity information of the device node to determine whether the second identity information is consistent with the first identity information on the first configuration list; If the second identity information is consistent with the first identity information, a count value in the first identity information is identified, a device topology of the device node is acquired, the target device on the device topology is queried from the device topology based on the count value, and device information of the target device is acquired; If the second identity information is not consistent with the first identity information, a device topology of the device node is acquired, a first device of the device topology is taken as the target device on the device topology, and device information of the target device is acquired.
2. The device information acquisition method according to claim 1, characterized by, Before the first identity information of the target device on the device topology is acquired, the following steps are further included: In response to an adding instruction of the device topology, the first identity information of the target device on the device topology is set on a first setting page, and after the setting is completed, it is determined whether the first identity information is valid; If the first identity information is valid, the first identity information is updated to a first memory, a first command is generated according to the first identity information, the first command is sent to a baseboard management controller, the baseboard management controller saves the first identity information to a second memory in response to the first command; Feedback information of the baseboard management controller is acquired, and at least one of an adding success prompt and a server restart prompt is generated after a save completion identifier is identified in the feedback information.
3. The device information acquisition method according to claim 2, characterized by, After the at least one of the adding success prompt and the server restart prompt is generated, the following steps are further included: In response to a deleting instruction of the device topology, the first identity information of the target device on the device topology is set on a second setting page, and after the setting is completed, it is determined whether the first identity information is valid; If the first identity information is valid, the first identity information is deleted from the first memory, a second command is generated according to the first identity information, the second command is sent to the baseboard management controller, and the baseboard management controller deletes the first identity information from the second memory in response to the second command; Feedback information of the baseboard management controller is acquired, and at least one of a deleting success prompt and a server restart prompt is generated after a delete completion identifier is identified in the feedback information.
4. The device information acquisition method according to claim 1, characterized by, Before the first identity information of the target device on the device topology is acquired, the following steps are further included: obtain a third command sent by a baseboard management controller, the baseboard management controller sets first identity information of a target device on a device topology on a third setting page in response to an adding instruction of the device topology, and generates the third command according to the first identity information after setting is completed; identify the first identity information in the third command, analyze the first identity information to obtain information identification and first device identification data, and if the information identification is target identification that is set in advance, establish a data structure body; store the first device identification data by using the data structure body, read third identity information of the target device on the device topology from a first memory, and store the third identity information to a second configuration list that is set in advance; query the second configuration list based on the data structure body, update the third identity information by using the first identity information if the query is successful, and add the first identity information to the second configuration list if the query fails; store the second configuration list to the first memory, generate a saving completion identification, generate feedback information according to the saving completion identification, and send the feedback information to the baseboard management controller.
5. The device information acquisition method according to claim 1, wherein Before obtaining the first identity information of the target device on the device topology, the method comprises the following steps: obtain a fourth command sent by a baseboard management controller, the baseboard management controller sets first identity information of a target device on a device topology on a fourth setting page in response to a deleting instruction of the device topology, and generates the fourth command according to the first identity information after setting is completed; identify the first identity information in the fourth command, analyze the first identity information to obtain information identification and first device identification data, and if the information identification is target identification that is set in advance, establish a data structure body; store the first device identification data by using the data structure body, read third identity information of the target device on the device topology from a first memory, and store the third identity information to a third configuration list that is set in advance; query the third configuration list based on the data structure body, delete the corresponding third identity information from the first memory if the query is successful, store the third configuration list to the first memory, generate a deleting completion identification, generate feedback information according to the deleting completion identification, and send the feedback information to the baseboard management controller.
6. An apparatus information acquisition method characterized by comprising: The method is applied to a baseboard management controller, and the method comprises the following steps: obtain a first command sent by a starting system, the starting system sets first identity information of a target device on a device topology on a first setting page in response to an adding instruction of the device topology, and generates the first command according to the first identity information after setting is completed; identify the first identity information in the first command, analyze the first identity information to obtain information identification and first device identification data, and if the information identification is target identification that is set in advance, establish a data structure body; storing the first device identification data by using the data structure, reading fourth identity information of the target device on the device topology from the second memory, and storing the fourth identity information into a fourth configuration list preset; querying the fourth configuration list based on the data structure, updating the fourth identity information by using the first identity information if the querying is successful, and adding the first identity information into the fourth configuration list if the querying is unsuccessful; storing the fourth configuration list into the second memory, generating a saving completion identifier, generating feedback information according to the saving completion identifier, and sending the feedback information to the starting system, wherein the starting system starts a server process and executes the device information acquisition method according to any one of claims 1-5.
7. The device information acquisition method according to claim 6, wherein Before acquiring the first command sent by the starting system, the method further comprises: in response to an adding instruction of the device topology, setting the first identity information of the target device on the device topology on a third setting page, and judging whether the first identity information is valid after the setting is completed; if the first identity information is valid, updating the first identity information to the second memory, generating a third command according to the first identity information, and sending the third command to the starting system, wherein the starting system saves the first identity information to a first memory in response to the third command; acquiring feedback information of the starting system, and generating at least one of an adding success prompt and a server restart prompt if a saving completion identifier is identified in the feedback information.
8. An apparatus information acquisition method characterized by comprising: The method is applied to a baseboard management controller, and the method comprises the following steps: acquiring a second command sent by a starting system, wherein the starting system sets the first identity information of the target device on the device topology on a second setting page in response to a deleting instruction of the device topology, and generates a second command according to the first identity information after the setting is completed; identifying the first identity information in the second command, analyzing the first identity information to obtain information identifier and first device identification data, and establishing a data structure if the information identifier is a target identifier preset; storing the first device identification data by using the data structure, reading fifth identity information of the target device on the device topology from the second memory, and storing the fifth identity information into a fifth configuration list preset; querying the fifth configuration list based on the data structure, deleting the corresponding fifth identity information from the second memory if the querying is successful, storing the fifth configuration list into the second memory, generating a deleting completion identifier, generating feedback information according to the deleting completion identifier, and sending the feedback information to the starting system, wherein the starting system starts a server process and executes the device information acquisition method according to any one of claims 1-5.
9. The device information acquisition method according to claim 8, wherein Before acquiring the second command sent by the starting system, the method further comprises: in response to a deleting instruction of the device topology, setting the first identity information of the target device on the device topology on a fourth setting page, and judging whether the first identity information is valid after the setting is completed; if the first identity information is valid, deleting the first identity information from the second memory, generating a fourth command according to the first identity information, sending the fourth command to the starting system, and the starting system deleting the first identity information from the first memory in response to the fourth command; obtaining feedback information of the starting system, and if a deletion completion identifier is identified in the feedback information, generating at least one of a deletion success prompt and a server restart prompt.
10. An electronic device, comprising: The device comprises: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the device information acquisition method according to any one of claims 1-9.
Citation Information
Patent Citations
Server and asset information obtaining method, providing method and device thereof
CN115629825A
PCIe topology acquisition method and device
CN116361220A