Asset information management method, electronic equipment, storage medium and product
Through linked list data block storage and garbage collection mechanisms, the asset information storage of the BMC EEPROM dynamically manages the problem of storage space waste caused by fixed structure formats, and improves data storage efficiency and device adaptation flexibility.
Patent Information
- Application Number
- CN202510891470.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In the prior art, the storage method of asset information in the server BMC EEPROM is in a fixed structure format, resulting in waste of storage space and abnormal data storage, affecting data storage efficiency.
Linked list data blocks are used to store asset information, dynamically allocate storage space, build linked list data blocks based on the equipment's minimum asset information data needs, and search for free space in the storage unit, triggering the garbage collection mechanism to recycle historical data.
Under the same storage space, the linked list storage solution can increase the number of data blocks several times, avoid waste of storage space, improve data storage space utilization, and reduce the time and cost of solving equipment adaptation abnormal problems.
Smart Images

Figure CN120386495A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an asset information management method, electronic equipment, storage medium, and product. Background Art
[0002] The Baseboard Management Controller (BMC) is a server-specific management controller. Its primary function is to automatically monitor the server's operational status, primarily including the health of various hardware components. The server BIOS (Basic Input / Output System) is firmware loaded onto the computer's hardware system. Its primary functions include power-on self-tests, booting the bootloader, and providing a configuration interface. One of the server BMC's functions is to display server asset information, including the name, type, and status of devices such as network cards, hard drives, and GPUs. This asset information is typically obtained through BIOS interaction during system power-on / POST, and is written to the BMC's EEPROM (Electrically Erasable Programmable Read-Only Memory) immediately or according to policy. The BMC's web process periodically polls the BMC EEPROM for formatted data and displays it on a web page, allowing server maintenance engineers to determine the model, status, and other aspects of each device. Currently, asset information for various components in M6 and M7 servers is stored and retrieved in the BMC EEPROM using a predefined asset information data structure developed during platform BMC development. The data length in the reserved structure and the number of devices of the same type (taking into account the number of virtualized devices) usually reserve a large space to accommodate future expansion. If the actual project is not adapted to use devices with a large number or length, it may cause idle EEPROM storage space, thereby affecting the normal storage of other information that may need to be stored in the EEPROM. Summary of the Invention
[0003] The present application provides an asset information management method, electronic device, storage medium, and product to at least address the technical problem in the related art that asset information of various server components is currently stored and read in the BMC EEPROM in the format of an asset information data structure, resulting in a large reserved space that causes EEPROM storage space to be idle, thus affecting data storage.
[0004] This application provides an asset information management method, including: During the hardware self-test phase of the basic input and output system, the asset information of the device is obtained through the basic input and output system and sent to the controller; In response to the controller interacting with the basic input / output system to obtain the asset information of various devices, obtain the smallest asset information data among the asset information of various devices, calculate the number of data blocks required to store the smallest asset information data, search for free space in the controller storage unit, and determine whether the controller can store the asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data; In response to the controller storage unit being able to store the asset information, construct a linked list data block according to the data blocks with the minimum number of data blocks required to store the smallest asset information data, and store the asset information of each type of device in each linked list data block; In response to the controller storage unit not being able to store the asset information, trigger the garbage collection mechanism to recycle the historical data in the controller storage unit.
[0005] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above asset information management methods when executing the computer program: In the hardware self-check stage of the basic input / output system, obtain the asset information of the device through the basic input / output system and send it to the controller; In response to the controller interacting with the basic input / output system to obtain the asset information of various devices, obtain the smallest asset information data among the asset information of various devices, calculate the number of data blocks required to store the smallest asset information data, search for free space in the controller storage unit, and determine whether the controller can store the asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data; In response to the controller storage unit being able to store the asset information, construct a linked list data block according to the data blocks with the minimum number of data blocks required to store the smallest asset information data, and store the asset information of each type of device in each linked list data block; In response to the controller storage unit not being able to store the asset information, trigger the garbage collection mechanism to recycle the historical data in the controller storage unit.
[0006] This application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above asset information management methods are implemented: In the hardware self-check stage of the basic input / output system, obtain the asset information of the device through the basic input / output system and send it to the controller; In response to the controller interacting with the basic input and output system to obtain asset information of various types of devices, obtaining the smallest asset information data in the asset information of the various types of devices, calculating the number of data blocks required to store the smallest asset information data, searching for free space in a storage unit of the controller, and determining whether the controller can store the asset information based on whether the number of data blocks in the free space found is greater than the number of data blocks required to store the smallest asset information data; In response to the controller storage unit being able to store the asset information, constructing linked list data blocks according to a minimum number of data blocks required to store the minimum asset information data, and storing the asset information of each type of equipment in each linked list data block; In response to the controller storage unit being unable to store the asset information, a garbage collection mechanism is triggered to recycle historical data in the controller storage unit.
[0007] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned asset information management methods: During the hardware self-test phase of the basic input and output system, the asset information of the device is obtained through the basic input and output system and sent to the controller; In response to the controller interacting with the basic input and output system to obtain asset information of various types of devices, obtaining the smallest asset information data in the asset information of the various types of devices, calculating the number of data blocks required to store the smallest asset information data, searching for free space in a storage unit of the controller, and determining whether the controller can store the asset information based on whether the number of data blocks in the free space found is greater than the number of data blocks required to store the smallest asset information data; In response to the controller storage unit being able to store the asset information, constructing linked list data blocks according to a minimum number of data blocks required to store the minimum asset information data, and storing the asset information of each type of equipment in each linked list data block; In response to the controller storage unit being unable to store the asset information, a garbage collection mechanism is triggered to recycle historical data in the controller storage unit.
[0008] Through this application, since the controller no longer stores the asset information of the device in a fixed size according to the asset information data structure format, it obtains the smallest asset information data in the asset information of each type of device, and stores the asset information of each type of device in a linked list data block. The number of data blocks in the linked list data block is set to the minimum data blocks required to store the minimum asset information data. The size of the linked list data block can be several to dozens of times smaller than the structure for storing asset information data in a fixed space. When the storage space size of the same controller storage unit remains unchanged, the number of linked list data blocks that can be set is increased by several to dozens of times, avoiding the idle storage space caused by reserving a very large space, thereby improving the utilization rate of data storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0010] Figure 1 A schematic diagram of how the current server's BMC and BIOS interact to obtain asset information and display it on the web; Figure 2 This is a schematic diagram of an asset information management method in one embodiment of the present application; Figure 3 This is a flowchart of an asset information management method in one embodiment of the present application; Figure 4 This is a flow chart of triggering a garbage collection mechanism in one embodiment of the present application; Figure 5 This is a flow chart of executing a garbage collection mechanism in one embodiment of the present application; Figure 6 A flowchart illustrating an implementation of an exception display mechanism in one embodiment of the present application; Figure 7 This is a structural block diagram of an asset information management device in one embodiment of the present application; Figure 8 This is a diagram of the internal structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0011] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0012] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0013] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0014] As described in the background art, the current storage method of the asset information of each component of the M6 and M7 servers in the BMC EEPROM is to use the asset information data structure determined in advance during the development of the platform BMC, and store and read it in a format. For example, for the network card asset information structure, 4 network ports are reserved, and considering the virtual network ports of each network port, there are a total of 8 MAC addresses of network ports. Each is designed according to the storage lengths of the maximum device type, SN, manufacturer, presence, bandwidth and other fields. The asset information of other devices such as GPUs and hard disks is stored in this way. This storage method with a fixed data structure can ensure that each asset information device can be stably stored in a fixed position in a fixed structure when the BIOS and BMC interact. However, when adapting to new and different asset information devices in each project, there are often differences in fields such as device names and manufacturers between the newly adapted asset information devices and the data structure initially formulated by the platform, and device virtualization is enabled (such as the NPAR (NIC Partitioning) function of the Broadcom network card, which can split the resources of an actual 2-port network card and send asset information to the BMC in the manner of a 16-port network card). This situation was difficult to anticipate when formulating the fixed structure of the platform BMC EEPROM asset information data. When the BIOS sends such abnormal asset information to the fixed area of the BMC EEPROM, the BMC cannot effectively store all the information in the fixed structure of the EEPROM asset information, resulting in subsequent display anomalies in the BMC web process because the complete asset information data structure cannot be obtained. If this problem occurs in the BMC of the project model during the maintenance phase, usually because the platform data structure code is difficult to modify during the maintenance phase, it can usually only be avoided by means of data truncation, and it depends on the BMC engineer to issue a new BMC version for adaptation, testing, and distribution, which affects the timeliness of solving such problems. At the same time, the data lengths in the reserved structure and the number of the same type of devices (considering the virtualized quantity) usually reserve a very large value considering future adaptation and expansion. If a large number and length of devices are not adapted and used in an actual project, it may cause the EEPROM storage space to be idle, thus affecting the normal storage of other information that may need to be stored in the EEPROM.
[0015] In C language, a linked list is a data structure composed of multiple nodes, and each node contains data and a pointer to the next node. The following are the basic concepts and implementation methods of the linked list: Single linked list: Each node contains a data field and a pointer field that points to the next node. The head node points to the first node of the linked list, and the tail node points to NULL.
[0016] Doubly linked list: Each node contains a previous pointer and a next pointer, allowing bidirectional traversal.
[0017] A structure is usually used to represent a linked list node. The structure of a linked list node is defined as follows: struct Node { int data; / / Data field struct Node* next; / / Pointer field }}.
[0018] As Figure 1 shown Figure 1 The following are the normal and emergency refresh methods for the current server BMC and BIOS images. The principle of the current server BMC and BIOS interacting to obtain asset information and display it on the WEB (website) is as follows: When the server is powered on, during the POST (Power-On Self-Test) stage when the BIOS runs, the BMC will obtain hardware asset information (such as serial number, model, firmware version, etc.) from the BIOS through IPMI (or other interfaces such as Redfish). When the hardware configuration changes, such as replacing the CPU or memory, enabling the network card virtualization function, etc., the BMC will store the changed asset information in the EEPROM. The format and storage location are determined by the asset information structure defined during the development of the platform BMC. After the BMC web process periodically polls and grabs the asset information data at this location, it will display the changed hardware configuration information on the BMC web, thus realizing the real-time display of the changed asset information.
[0019] The asset information management method provided by this application can be applied to such as Figure 2In the application environment shown. Among them, the asset information management method is applicable to the server to display asset information through the BMC web. The server can be implemented by an independent server or a server cluster composed of multiple servers. The server includes a BIOS (Basic Input Output System, that is, the basic input output system) and a controller (Baseboard Management Controller, abbreviated as BMC). The BIOS obtains the asset information of network cards, hard disks, CPUs (central processing units), and other devices that need to display asset information in the BMC. The BIOS still sends the device data of network cards, hard disks, CPUs, etc. that need to display asset information in the BMC web to the BMC through IPMI interaction during the POST (hardware self-check) stage of the server startup process. Different from the current design, the BMC no longer sets the asset information storage data of different devices according to a fixed size and position. The entire BMC EEPROM space used for asset information storage is divided into linked list databases of different sizes. Each data block contains: the address pointer of the next block, the data length of the current block, and the storage space for the actual data content. The linked list database space of the BMC EEPROM used for asset information storage, the number and size of the data blocks are determined in the platform BMC code. Different from the number specified in the previous fixed-position storage, the database size of the linked list space can be set to the number of data blocks required for the smallest asset information data storage. For example, if the total data size of the asset information to be displayed in the memory is the smallest among all devices and cannot be virtualized, the linked list data block size can be set to the size of the asset information to be displayed in the memory. Because the size of the data block is several times to dozens of times smaller than the fixed-space storage scheme, such as the data space allocated by the fixed-space storage scheme is reserved for long asset information data for future-adapted devices, and usually extended. For example, the M6 asset information reserves 4 network ports, and each reserves 2 times the virtual network port asset information, a total of 8 network card asset information storage spaces. And SN and manufacturer name need to be reserved according to the maximum expandable quantity. Then, when the storage size of the BMC EEPROM remains unchanged, the number of linked list data blocks is several times to dozens of times the fixed-space quantity.
[0020] As Figure 3 shown, an embodiment of the present application provides an asset information management method, including the following steps: Step S1, in the hardware self-check stage of the basic input output system, obtain the asset information of the device through the basic input output system and send it to the controller; Step S2, in response to the controller interacting with the basic input and output system to obtain asset information of various devices, obtain the smallest asset information data in the asset information of various devices, calculate the number of data blocks required to store the smallest asset information data, search for free space in the controller storage unit, and determine whether the controller can store the asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data; Step S3, in response to the controller storage unit being able to store the asset information, constructing linked list data blocks based on the minimum number of data blocks required to store the minimum asset information data, and storing the asset information of each type of device in each linked list data block; Step S4: In response to the controller storage unit being unable to store the asset information, a garbage collection mechanism is triggered to recycle the historical data in the controller storage unit.
[0021] In this embodiment, since the controller no longer stores the asset information of the device in a fixed size according to the asset information data structure format, it obtains the smallest asset information data among the asset information of each type of device, and stores the asset information of each type of device in a linked list data block. The number of data blocks in the linked list data block is set to the minimum data blocks required to store the smallest asset information data. The size of the linked list data block can be several to dozens of times smaller than the structure for storing asset information data in a fixed space. When the storage space size of the same controller storage unit remains unchanged, the number of linked list data blocks that can be set is increased by several to dozens of times, avoiding the idle storage space caused by reserving a very large space, thereby improving the utilization rate of data storage space.
[0022] The BMC EEPROM uses a linked list database space for asset information storage. The number and size of data blocks are determined in the platform BMC code. Unlike the previously fixed-location storage, the database size in this linked list space can be set to the minimum number of data blocks required to store the asset information. For example, if the total asset information to be displayed in memory is the smallest among all devices and cannot be virtualized, the linked list data block size can be set to the size of the asset information to be displayed in memory. This is because the data block size is several to dozens of times smaller than that of a fixed-space storage solution. Fixed-space storage allocates data space to reserve long asset information data for future compatible devices and is typically expanded. For example, the M6 reserves four network ports for asset information, each with two virtual network port asset information blocks, totaling eight network card asset information. Furthermore, the SN and vendor name must be reserved to the maximum scalable size. Therefore, while the BMC EEPROM storage size remains unchanged, the number of linked list data blocks can be several to dozens of times the fixed space size.
[0023] like Figure 4As shown, in this embodiment, searching for free space in the controller storage unit and determining whether the controller can store asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data includes: Obtaining the first data block in the controller storage unit and sequentially traversing the continuously available data space along the next data block pointer of the linked list from the first data block pointer; Searching in the continuously available data space according to the number of data blocks required to store the smallest asset information data to find whether there are consecutive data blocks greater than the number of data blocks required to store the smallest asset information data. If so, it is determined that the controller storage unit can store asset information, the data blocks are marked as allocated, and the file identifier is set according to the device type. Otherwise, it is determined that the controller storage unit cannot store asset information.
[0024] Among them, the multiple small linked list data blocks in the BMC's EEPROM are not dedicated to a certain component. Instead, during the BIOS POST process, the BIOS obtains the corresponding number of data blocks required to calculate the data size in sequence, and then sequentially traverses the continuous available data space along the next data pointer of the linked list from the first data block pointer. For example, if the required data space for a network card asset information is 1800 Bytes and one linked list data block is 512 Bytes, then search forward along the first linked list data block pointer to find a space with 4 consecutive data blocks. If found, write the space of these 4 consecutive data blocks into the network card asset information, and use the file identifier to indicate that it has been occupied by the network card asset information data for the front-end BMC web process to call and obtain the data for display on the web.
[0025] In this embodiment, constructing a linked list data block according to the data blocks with the minimum number of data blocks required to store asset information, and storing the asset information of each type of device in each linked list data block includes: Setting a linked list data block for storing asset information in the free space, setting the number of linked list data blocks according to the number of data blocks required to store the smallest asset information data, and the total space of the linked list data blocks is greater than or equal to the storage requirement space of the asset information; Each data block in the linked list data block contains the address pointer of the next data block, the data length of the current data block, and the storage space for storing the actual data content; Setting the number of linked list data blocks according to the number of device types, and storing the asset information of each type of device in each linked list data block.
[0026] Such as Figure 5 As shown, in this embodiment, the asset information management method further includes: When it is detected that the used size of the linked list database exceeds the warning threshold, or when traversing the linked list database, continuous available data blocks cannot be found, the garbage collection mechanism for the storage space of asset information in the controller storage unit is triggered.
[0027] Among them, the warning threshold is preferably 70%.
[0028] As Figure 5 shown, in this embodiment, triggering the garbage collection mechanism for the storage space of asset information in the controller storage unit includes: Checking whether the timestamp of the occupied data block is the latest; In response to the timestamp of the occupied data block being the latest, checking whether the timestamp of the next occupied data block is the latest through the next address pointer of the linked list; In response to the timestamp of the occupied data block having updated timestamp data, it is determined that the asset information data stored in the current occupied data block has expired, the occupied data block is deleted and released, and then it is checked whether the timestamp of the next occupied data block is the latest through the next address pointer of the linked list.
[0029] As Figure 5 shown, in this embodiment, triggering the garbage collection mechanism for the storage space of asset information in the controller storage unit further includes: In response to traversing all asset information data blocks and deleting expired data, performing a hot reorganization on the current linked list database to form an address sorting after deletion, forming new compactly arranged addresses, and placing the freed idle data blocks at the end of the linked list database.
[0030] That is, when it is detected that the used size of the linked list database exceeds the warning threshold, or when no available continuous block can be found for the asset information sent from the BIOS, starting from the head address of the linked list type asset information storage space in the BMC EEPROM, according to the data type and the timestamp of the data, it is compared whether it is the latest value of this data type. If it is not the latest value, it proves that there is updated timestamp data. When updating the asset information data of this type sent from the BIOS to the BMC, this asset information data has become obsolete, and it is deleted and the occupied data block is released. After traversing all asset information data blocks and deleting expired data, a hot reorganization is performed on the existing data block linked list, that is, an address sorting after deletion is formed, new compactly arranged addresses are formed, and the freed idle data blocks are placed at the end of the EEPROM, that is, a garbage collection operation is performed.
[0031] As Figure 6 shown, in this embodiment, the asset information management method further includes: When executing the garbage collection mechanism, it is continuously judged whether the free space in the controller storage unit after clearing non - latest data can store asset information; Exit the garbage collection mechanism in response to the free space in the controller storage unit being able to store asset information after clearing non-up-to-date data; In response to the free space in the controller storage unit being unable to store asset information after clearing non-up-to-date data, do not store asset information in the free space and execute the exception display mechanism.
[0032] It can be understood that if the data occupancy still exceeds the threshold or continuous available data blocks cannot be found after the garbage collection operation, the exception display mechanism is entered. Due to the dynamic storage mechanism of this solution, compared with the existing BMC EEPROM fixed format for storing asset information, it has the characteristic of more compact utilization of the data structure, and the utilization rate of EEPROM will be greatly improved, and generally will not enter the exception display mechanism due to data overflow.
[0033] In this embodiment, the asset information management method further includes: In response to displaying asset information through the controller page, obtain the stored asset information in the controller storage unit and determine whether there is un-stored asset information; Display on the controller page in the display priority order of asset information, where the stored asset information is directly displayed, and the un-stored asset information executes the exception display mechanism to generate a display details button.
[0034] In this embodiment, the asset information management method further includes: In response to the display details button being clicked, call the interaction interface between the basic input / output system and the controller to obtain the asset information from the source and display it on the controller page; Determine whether the asset information corresponding to the display details button is successfully displayed. If so, exit the exception display mechanism; if not, delete the non-important asset information in the asset information corresponding to the display details button and execute defragmentation to release the storage space of the controller storage unit.
[0035] In this embodiment, the asset information management method further includes: In response to there being non-important asset information to be deleted in the asset information corresponding to the display details button, control to store the important asset information in the released space during the next interaction between the basic input / output system and the controller.
[0036] In this embodiment, the asset information management method further includes: In response to the free space in the controller storage unit being unable to store asset information after clearing non-up-to-date data, determine whether there are non-high-priority display items with no space for storage; In response to there being non-high-priority display items with no space for storage, record the non-high-priority display items in the form of pop-up windows, logs or serial ports on the controller page, and the recorded non-high-priority display items can be manually obtained through IPMI commands.
[0037] Specifically, first define the priority of asset information display. For example, "MAC address", "on-site status", etc. can be set as high-priority display items. First, generate a "display details" button on the web. When the user clicks it, directly call the BIOS and BMC interaction interface to obtain asset information from the source and display it on the BMC web, skipping the EEPROM. If the execution fails, forcefully delete non-important asset information such as "production date" and "serial number", perform disk defragmentation to release the storage space of the EEPROM, and store important asset information in the released space during the next BIOS and BMC interaction. If it is determined that there is no space to store non-high-priority display items, a pop-up window / log or serial port record will be generated on the web with a method for manually obtaining this information through IPMI commands for the user to manually obtain the information.
[0038] In this embodiment, the asset information management method further includes: In response to the fact that the free space in the controller storage unit cannot store asset information after clearing non-up-to-date data, obtain the number of data blocks required to store the smallest asset information data, control to search for free space in the controller storage unit again during the next interaction between the basic input / output system and the controller, and determine whether the free space is greater than the space required to store the asset information. If so, use a distributed storage method to store the asset information in the free space.
[0039] Among them, for asset information that cannot be stored, a distributed storage method is used to attempt storage to avoid space residue caused by continuous data block storage.
[0040] After reinstalling and restarting the BMC, the BMC determines the file uploaded using the microcontroller SPI communication. If it is not the BMC image itself, it calls the interface to refresh other firmware, automatically performs the next component refresh, and restarts the component module to take effect.
[0041] In this embodiment, the asset information management method further includes: In response to obtaining the asset information of a new device through the basic input / output system during the hardware self-check stage of the basic input / output system, expand the linked list database. The expanded space is equal to the number of data blocks required to store the asset information data of the new device minus the free space in the linked list database.
[0042] With such settings, the controller storage unit can be minimized and filled with linked list data blocks. Moreover, when adding the asset information of a new device, the linked list database is expanded, and after expansion, it remains filled with linked list data blocks. This method does not directly expand the space of a linked list data block, but the expanded space is equal to the number of data blocks required to store the asset information data of the new device minus the free space in the linked list database, always keeping the linked list database filled with linked list data blocks.
[0043] Compared with the current fixed storage solution for BMC asset information, this embodiment can improve storage flexibility, accommodate asset information ranging from a few bytes to hundreds of bytes, without the need to preset a fixed length, and improve storage utilization. In extreme cases that are unforeseeable before platform development, such as when the NPAR (NIC Partitioning) function is enabled on a Broadcom network card to split the resources of an actual 2-port network card and send asset information to the BMC in the manner of a 16-port network card, it can also be stored by dynamically allocating a common linked list space, avoiding truncation or overflow problems caused by a fixed length, and reducing the human and material resources consumed in BMC version development, testing, client import, etc. due to the failure to adapt to different device asset information and resulting in abnormal display of asset information.
[0044] During the POST process of the BIOS, the corresponding number of data blocks required to calculate the data size is sequentially obtained, and then the next data pointer of the linked list is used to sequentially traverse the continuous available data space from the first data block pointer. Then, a space with continuous data blocks is searched for by progressing along the first linked list data block pointer. If found, the continuous data block space is written to the device asset information, and a file identifier is used to indicate that it has been occupied by the network card asset information data, for the front-end BMC web process to call and obtain the data for display on the web. The BMC monitors and traverses to release the occupied storage information that has become obsolete using timestamps and file resource identifiers, and implements a garbage collection mechanism through defragmentation to maintain the validity and occupancy continuity of the data in the used linked list space, and provides a walk-around solution for exceptional cases, such as skipping the EEPROM.
[0045] In the above asset information management method, since the controller no longer stores the asset information of the device in a fixed size according to the asset information data structure format, the smallest asset information data among the asset information of various devices is obtained, and the asset information of various devices is stored in linked list data blocks. The number of data blocks in the linked list data blocks is set to the minimum number of data blocks required to store the smallest asset information data, enabling the size of the linked list data blocks to be several times to dozens of times smaller than the structure of the asset information data stored in a fixed space. Without changing the storage space size of the same controller storage unit, the number of linked list data blocks that can be set can be increased by several times to dozens of times, avoiding the waste of storage space caused by reserving a large space and improving the utilization rate of the data storage space.
[0046] 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 implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0047] In one embodiment, such asFigure 7 As shown in the figure, an asset information management device 10 is provided, including: an asset information acquisition module 1, a storage space judgment module 2, a linked list data block setting module 3, and a garbage collection mechanism module 4.
[0048] The asset information acquisition module 1 is used to obtain the asset information of the device through the basic input / output system during the hardware self-check phase of the basic input / output system, and send it to the controller.
[0049] The storage space judgment module 2 is used to, in response to the controller interacting with the basic input / output system to obtain the asset information of various devices, obtain the smallest asset information data among the asset information of various devices, calculate the number of data blocks required to store the smallest asset information data, search for free space in the controller storage unit, and judge whether the controller can store the asset information according to whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data.
[0050] The linked list data block setting module 3 is used to, in response to the controller storage unit being able to store the asset information, construct a linked list data block according to the data blocks with the least number of data blocks required to store the smallest asset information data, and store the asset information of each type of device in each linked list data block.
[0051] The garbage collection mechanism module 4 is used to, in response to the controller storage unit being unable to store the asset information, trigger the garbage collection mechanism to recycle the historical data in the controller storage unit.
[0052] In this embodiment, searching for free space in the controller storage unit and judging whether the controller can store the asset information according to whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data includes: Obtain the first data block in the controller storage unit, and sequentially traverse the continuous available data space along the next data block pointer of the linked list from the first data block pointer; Search for whether there are consecutive set data blocks in the continuous available data space that are greater than the number of data blocks required to store the smallest asset information data according to the number of data blocks required to store the smallest asset information data. If so, it is determined that the controller storage unit can store the asset information, mark the data block as allocated, and set the file identifier according to the device type. If not, it is determined that the controller storage unit cannot store the asset information.
[0053] In this embodiment, obtaining the linked list data block for storing the asset information in the free space, and setting the number of linked list data blocks to the least number of data blocks required to store the asset information data includes: Set a linked - list - type data block for storing asset information in the free space. Set the number of linked - list - type data blocks according to the number of data blocks required for storing the smallest asset information data, and the total space of the linked - list - type data blocks is greater than or equal to the storage requirement space of the asset information. Each data block in the linked - list - type data block contains an address pointer to the next data block, the data length of the current data block, and a storage space for storing the actual data content. Set the number of linked - list - type data blocks according to the number of device types, and store the asset information of each type of device in each linked - list - type data block.
[0054] In this embodiment, the garbage collection mechanism module 4 is further used for: When it is monitored that the used size of the linked - list database exceeds the warning threshold, or when traversing the linked - list database, no continuous available data block can be found, trigger the garbage collection mechanism for the storage space of the asset information in the controller storage unit.
[0055] In this embodiment, triggering the garbage collection mechanism for the storage space of the asset information in the controller storage unit includes: Check whether the timestamp of the occupied data block is the latest. In response to the timestamp of the occupied data block being the latest, check whether the timestamp of the next occupied data block is the latest through the next - address pointer of the linked list. In response to the timestamp of the occupied data block having updated timestamp data, it is determined that the asset information data stored in the current occupied data block has expired, delete and release the occupied data block, and check whether the timestamp of the next occupied data block is the latest through the next - address pointer of the linked list.
[0056] In this embodiment, triggering the garbage collection mechanism for the storage space of the asset information in the controller storage unit further includes: In response to traversing all asset information data blocks and deleting expired data, perform a hot reorganization on the current linked - list database, form an address sorting after deletion, form a new compactly arranged address, and place the released free data blocks at the end of the linked - list database.
[0057] In this embodiment, the garbage collection mechanism module 4 is further used for: When the garbage collection mechanism is executed, real - time judge whether the free space in the controller storage unit after clearing non - latest data can store asset information. In response to the free space in the controller storage unit after clearing non - latest data being able to store asset information, exit the garbage collection mechanism. In response to the free space in the controller storage unit after clearing non - latest data not being able to store asset information, do not store asset information in the free space and execute the exception display mechanism.
[0058] In this embodiment, as shown, the asset information management device 10 further includes: a display asset information module 5, and the display asset information module 5 is configured to: When responding to the display of asset information through the controller page, obtain the stored asset information in the controller storage unit and determine whether there is un-stored asset information; Display on the controller page according to the display priority order of the asset information, where the stored asset information is directly displayed, and the un-stored asset information executes an exception display mechanism to generate a display details button.
[0059] In this embodiment, the display asset information module 5 is further configured to: When responding to the click of the display details button, call the interaction interface between the basic input / output system and the controller to obtain the asset information from the source and display it on the controller page; Determine whether the asset information corresponding to the display details button is successfully displayed. If so, exit the exception display mechanism. If not, delete the non-important asset information in the asset information corresponding to the display details button, and perform defragmentation to release the storage space of the controller storage unit.
[0060] In this embodiment, the asset information management device is further configured to: When responding to the deletion of non-important asset information in the asset information corresponding to the display details button, control to store the important asset information in the released space during the next interaction between the basic input / output system and the controller.
[0061] In this embodiment, the display asset information module 5 is further configured to: When responding that the free space in the controller storage unit after clearing non-latest data cannot store asset information, determine whether there is a non-high-priority display item with no space for storage; When responding that there is a non-high-priority display item with no space for storage, record the non-high-priority display item in a pop-up window, log, or serial port on the controller page, and the recorded non-high-priority display item can be manually obtained through the IPMI command.
[0062] In this embodiment, the display asset information module 5 is further configured to: When responding that the free space in the controller storage unit after clearing non-latest data cannot store asset information, obtain the number of data blocks required for storing the smallest asset information data, control to search for free space in the controller storage unit again during the next interaction between the basic input / output system and the controller, and determine whether the free space is greater than the space required for storing the asset information. If so, store the asset information in the free space in a distributed storage manner.
[0063] In the above-mentioned asset information management device, since the controller no longer stores the asset information of the device in a fixed size according to the asset information data structure format, it obtains the smallest asset information data among the asset information of each type of device, and stores the asset information of each type of device in a linked list data block. The number of data blocks in the linked list data block is set to the minimum data blocks required to store the smallest asset information data. The size of the linked list data block can be several to dozens of times smaller than the structure for storing asset information data in a fixed space. When the storage space size of the same controller storage unit remains unchanged, the number of linked list data blocks that can be set is increased by several to dozens of times, avoiding the idle storage space caused by reserving a very large space, thereby improving the utilization rate of data storage space.
[0064] For the description of the features in the embodiment corresponding to the asset information management device, please refer to the relevant description of the embodiment corresponding to the asset information management method, and will not be repeated here.
[0065] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned asset information management method embodiments.
[0066] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as follows: Figure 7 Figure 8 As shown. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electronic device is used to store asset information management data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an asset information management method is implemented.
[0067] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned asset information management method embodiments when run.
[0068] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0069] An embodiment of the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above-described embodiments of the asset information management method are implemented.
[0070] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-described embodiments of the asset information management method are implemented.
[0071] Those skilled in the art can further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0072] The above has introduced in detail an asset information management method, an electronic device, a storage medium, and a product provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. An asset information management method, characterized in that, The described asset information management method includes: In the hardware self - test stage of the basic input / output system, obtain the asset information of the device through the basic input / output system and send it to the controller; In response to the controller interacting with the basic input / output system to obtain the asset information of various devices, obtain the smallest asset information data among the asset information of various devices, calculate the number of data blocks required to store the smallest asset information data, search for free space in the controller storage unit, and determine whether the controller can store the asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data; In response to the controller storage unit being able to store the asset information, construct a linked - list - type data block according to the data blocks with the minimum number of data blocks required to store the smallest asset information data, and store the asset information of each type of device in each linked - list - type data block; In response to the controller storage unit being unable to store the asset information, trigger the garbage collection mechanism to recycle the historical data in the controller storage unit.
2. The asset information management method according to claim 1, characterized in that The searching for free space in the controller storage unit and determining whether the controller can store the asset information based on whether the number of data blocks in the found free space is greater than the number of data blocks required to store the smallest asset information data includes: Obtain the first data block in the controller storage unit, and sequentially traverse the continuously available data space along the next data - block pointer of the linked list starting from the first - data - block pointer; According to the number of data blocks required to store the smallest asset information data, search in the continuously available data space to find whether there are consecutive data blocks greater than the number of data blocks required to store the smallest asset information data. If so, determine that the controller storage unit can store the asset information, mark the data block as allocated, and set the file identifier according to the device type. Otherwise, determine that the controller storage unit cannot store the asset information.
3. The asset information management method according to claim 2, wherein The constructing a linked - list - type data block according to the data blocks with the minimum number of data blocks required to store the smallest asset information data and storing the asset information of each type of device in each linked - list - type data block includes: Set a linked - list - type data block for storing asset information in the free space, set the number of the linked - list - type data blocks according to the number of data blocks required to store the smallest asset information data, and the total space of the linked - list - type data blocks is greater than or equal to the storage requirement space of the asset information; Each data block in the linked - list - type data block contains the address pointer of the next data block, the data length of the current data block, and the storage space for storing the actual data content; Set the number of linked - list - type data blocks according to the number of device types, and store the asset information of each type of device in each linked - list - type data block.
4. The asset information management method according to claim 2, wherein The asset information management method further includes: In response to monitoring that the used size of the linked - list database exceeds the warning threshold, or when traversing the linked - list database, no continuously available data block can be found, trigger the garbage collection mechanism for the storage space of the asset information in the controller storage unit.
5. The asset information management method according to claim 4, wherein The garbage collection mechanism for triggering the controller storage unit to store the asset information space includes: Check whether the timestamp of the occupied data block is the latest; In response to the timestamp of the occupied data block being the latest, check whether the timestamp of the next occupied data block is the latest through the next address pointer of the linked list; In response to the timestamp of the occupied data block having updated timestamp data, determine that the asset information data stored in the current occupied data block has expired, delete and release the occupied data block, and check whether the timestamp of the next occupied data block is the latest through the next address pointer of the linked list.
6. The asset information management method according to claim 5, characterized in that The garbage collection mechanism for triggering the controller storage unit to store the asset information space further includes: In response to traversing all asset information data blocks and deleting expired data, perform a hot reorganization on the current linked list database to form an address sorting after deletion, form a new compactly arranged address, and place the released free data blocks at the end of the linked list database.
7. The asset information management method according to claim 4, wherein The asset information management method further includes: When executing the garbage collection mechanism, determine in real time whether the free space in the controller storage unit after clearing non-latest data can store the asset information; In response to the free space in the controller storage unit after clearing non-latest data being able to store the asset information, exit the garbage collection mechanism; In response to the free space in the controller storage unit after clearing non-latest data not being able to store the asset information, do not store the asset information in the free space and execute an exception display mechanism.
8. The asset information management method according to claim 7, characterized in that, The asset information management method further includes: In response to displaying asset information through the controller page, obtain the stored asset information in the controller storage unit and determine whether there is un-stored asset information; Display on the controller page according to the display priority order of the asset information, where the stored asset information is directly displayed, and the un-stored asset information executes an exception display mechanism to generate a display details button.
9. The asset information management method according to claim 8, wherein, The asset information management method further includes: In response to the display details button being clicked, call the interaction interface between the basic input / output system and the controller to obtain asset information from the source and display it on the controller page; Judge whether the asset information corresponding to the display details button is successfully displayed. If so, exit the exception display mechanism. If not, delete the non-important asset information in the asset information corresponding to the display details button and perform defragmentation to release the storage space of the controller storage unit.
10. The asset information management method according to claim 9, characterized in that, The asset information management method further includes: In response to there being non-important asset information deleted in the asset information corresponding to the display details button, control to store the important asset information in the released space during the next interaction between the basic input / output system and the controller.
11. The asset information management method according to claim 8, wherein, The asset information management method further includes: In response to the free space in the controller storage unit after clearing non-latest data not being able to store the asset information, determine whether there are non-high-priority display items with no space for storage; In response to the existence of non-high-priority display items with no space for storage, a pop-up window, log, or serial port method is used to record the non-high-priority display items on the controller page, and the recorded non-high-priority display items can be manually obtained through IPMI commands.
12. The asset information management method according to claim 7, wherein The asset information management method further includes: In response to the fact that the free space in the controller storage unit cannot store the asset information after clearing non-latest data, the number of data blocks required to store the smallest asset information data is obtained, and it is controlled to search for free space in the controller storage unit again when the basic input / output system interacts with the controller next time. It is judged whether the free space is larger than the space required to store the asset information. If so, the asset information is stored in the free space in a distributed storage manner.
13. An electronic device, characterized in that, It includes: A memory for storing computer programs; A processor for implementing the steps of the asset information management method according to any one of claims 1 to 12 when executing the computer programs.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the asset information management method according to any one of claims 1 to 12 when executed by a processor.
15. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the asset information management method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Patent Citations
Feature processing method for block-level data in hierarchical storage system
CN103605483A
Non-fixed-length record data recognition method
CN1936864A
Method, device, and system for storing data
JP2020038623A
Backup and restoration for a deduplicated file system
US20140188805A1
Data processing method and apparatus, device, and readable storage medium
US20240143188A1