Asset information management method, device, electronic equipment and storage medium
By verifying and analyzing the asset information and storing it into the inter-process communication system and file system, the problem of inefficient asset information management in the existing technology is solved, and rapid and accurate acquisition and functional expansion are achieved.
Patent Information
- Application Number
- CN202211466566.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-11-22
AI Technical Summary
The existing asset information management methods cannot obtain asset information in a timely and accurate manner, and are not conducive to the expansion of functions, especially in terms of screening and displaying when the data is large.
By obtaining the asset information to be managed for verification and analysis, it is stored in the inter-process communication system, and the asset information file is determined based on the analysis results and stored in the file system to achieve management and rapid acquisition of asset information, and at the same time, it supports asset information management functions. extension.
It realizes rapid and accurate acquisition of asset information, improves the efficiency and accuracy of asset information management, and facilitates the expansion of functions, especially in the case of large and complex data.
Smart Images

Figure CN115757275B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to an asset information management method, device, electronic device, and storage medium. Background Art
[0002] Managing the server's asset information enables server administrators to understand the overall configuration and operating status of the server. The server's asset information management function is an important function of the BMC (Baseboard Management Controller), which can help server administrators remotely obtain server asset information.
[0003] However, the existing asset information management method is that the BIOS (Basic Input Output System) sends the asset information to the BMC through the IPMI (Intelligent Platform Management Interface) command in accordance with the agreed data format and transmission specifications. After receiving the data, the BMC parses and saves it in the memory or non-volatile device. At the same time, the BMC will provide corresponding IPMI commands for viewing the asset information.
[0004] However, if you want to expand the asset information management function, for example, display the asset information on the BMC web (World Wide Web) page through the redfish (a management standard based on HTTPs service) interface, or other processes need to obtain asset information data, you have to obtain all the asset information data in the memory or non-volatile device, and need to perform secondary analysis on the asset information data. When the amount of data is large, the screening is also more complicated, resulting in the inability to obtain asset information in a timely manner. In addition, the existing asset information management method is not conducive to the expansion of functions. Summary of the invention
[0005] The embodiments of the present invention provide an asset information management method, device, electronic device and storage medium, which can quickly and accurately obtain asset information and facilitate the expansion of asset information management functions.
[0006] According to one aspect of the present invention, there is provided an asset information management method, which is applied to a baseboard management controller, comprising:
[0007] Acquire the asset information to be managed, and verify and parse the asset information to be managed to obtain the parsed asset information corresponding to the asset information to be managed;
[0008] storing the parsed asset information in an inter-process communication system, and determining an asset information file based on the parsed asset information;
[0009] The asset information file is stored in a file system to manage the asset information to be managed.
[0010] In addition, the asset information management method according to the above embodiment of the present invention may also have the following additional technical features:
[0011] Optionally, the parsed asset information includes the server device identifier and the split asset information corresponding to the server device identifier; accordingly, storing the parsed asset information in the inter-process communication system includes:
[0012] Determine, according to the server device identifier, a target storage path interface in the inter-process communication system corresponding to the asset information to be managed;
[0013] Determine the target asset information storage space according to the target storage path interface, and store the split asset information in the target asset information storage space.
[0014] An embodiment of the above invention has the following advantages or beneficial effects: the specific content of the parsed asset information is proposed, so that the storage space of the split asset information in the inter-process communication system is determined according to the server device identification obtained by parsing, and the required asset information can be obtained more quickly and accurately.
[0015] Optionally, the split asset information is stored in the target asset information storage space, including:
[0016] According to the split asset information, determine the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information;
[0017] The asset information parameter variable name and the asset information parameter variable value are stored in the target asset information storage space.
[0018] An embodiment of the above invention has the following advantages or beneficial effects: by determining the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information, and storing the asset information parameter variable name and the asset information parameter variable value in the target asset information storage space, the split asset information can be stored in the form of parameter variables, thereby improving the accuracy of obtaining asset information.
[0019] Optionally, before storing the parsed asset information in the inter-process communication system, the method further includes:
[0020] Determine the historical asset information stored in the inter-process communication system and the historical asset information file stored in the file system;
[0021] Delete historical asset information and historical asset information files.
[0022] An embodiment of the above invention has the following advantages or beneficial effects: by deleting the asset information left in the inter-process communication system and the file system before storing the parsed asset information, the reliability of the asset information can be guaranteed.
[0023] Optionally, after storing the asset information file in the file system, the following steps are further included:
[0024] When the baseboard management controller is restarted, obtaining a first storage asset information file stored in the file system;
[0025] The storage management asset information is determined according to the first storage asset information file, and the storage management asset information is stored in the inter-process communication system.
[0026] An embodiment of the above invention has the following advantages or beneficial effects: an application scenario of restarting the baseboard management controller is proposed to realize storing the asset information stored in the file system to the inter-process communication system after restarting the baseboard management controller, thereby further improving the acquisition rate of the asset information after restarting the baseboard management controller.
[0027] Optionally, after storing the asset information file in the file system, the following steps are further included:
[0028] In case of updating the baseboard management controller, determining the asset information file to be deleted in the file system;
[0029] Determine the retained asset information files in the file system according to the asset information files to be deleted;
[0030] When it is determined that the retained asset information file is empty, returning to execute the operation of obtaining the asset information to be managed;
[0031] When it is determined that the retained asset information file is not empty, the retained management asset information is determined based on the retained asset information file, and the retained management asset information is stored in the inter-process communication system.
[0032] An embodiment of the above invention has the following advantages or beneficial effects: an application scenario of updating the baseboard management controller is proposed to determine the retained asset information file in the file system after the baseboard management controller is updated, so that when the retained asset information file is not empty, the retained asset information file is stored in the inter-process communication system, thereby further improving the asset information acquisition rate after the baseboard management controller is updated.
[0033] Optionally, determining the asset information file to be deleted in the file system includes:
[0034] Acquire the second storage asset information file stored in the file system, and determine whether to retain the second storage asset information file;
[0035] If so, determining the asset information file to be deleted in the second storage asset information file according to the asset information deletion instruction;
[0036] If not, all second storage asset information files in the file system are determined as asset information files to be deleted.
[0037] An embodiment of the above invention has the following advantages or beneficial effects: a specific implementation method for determining the asset information files to be deleted in the file system is proposed, so that the asset information files to be deleted can be determined more accurately.
[0038] According to another aspect of the present invention, there is provided an asset information management device, which is configured in a baseboard management controller and includes:
[0039] The asset information acquisition module is used to acquire the asset information to be managed, and verify and analyze the asset information to be managed to obtain the analyzed asset information corresponding to the asset information to be managed;
[0040] An asset information storage module, used to store the parsed asset information in an inter-process communication system, and determine an asset information file based on the parsed asset information;
[0041] The asset information management module is used to store the asset information file in the file system so as to manage the asset information to be managed.
[0042] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0043] at least one processor; and
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the asset information management method described in any embodiment of the present invention.
[0046] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the asset information management method described in any embodiment of the present invention when executed.
[0047] The technical solution of the embodiment of the present invention obtains the asset information to be managed, verifies and analyzes the asset information to be managed to obtain the analyzed asset information corresponding to the asset information to be managed, and stores the analyzed asset information in the inter-process communication system, and determines the asset information file according to the analyzed asset information, and stores the asset information file in the file system, thereby realizing the management of the asset information to be managed, solving the problem that the existing asset information management method cannot obtain asset information in a timely and accurate manner, and can quickly and accurately obtain asset information, while facilitating the expansion of the asset information management function.
[0048] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 is a flow chart of an asset information management method provided by Embodiment 1 of the present invention;
[0051] Figure 2 is a flow chart of an asset information management method provided by Embodiment 2 of the present invention;
[0052] Figure 3 is an example flow chart of an asset information management method provided by Embodiment 3 of the present invention;
[0053] Figure 4 is another example flow chart of an asset information management method provided by Embodiment 3 of the present invention;
[0054] Figure 5 is another example flow chart of an asset information management method provided by Embodiment 3 of the present invention;
[0055] Figure 6 is a schematic diagram of an asset information management device provided by a fourth embodiment of the present invention;
[0056] Figure 7 It is a structural schematic diagram of an electronic device for implementing the asset information management method of an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] Embodiment 1
[0060] Figure 1 is a flowchart of an asset information management method provided by the first embodiment of the present invention. This embodiment is applicable to the case of quickly and accurately obtaining asset information. The method can be executed by an asset information management device, which can be implemented by software and / or hardware, and can generally be directly integrated into an electronic device that executes the method, such as a baseboard management controller. Specifically, Figure 1 As shown, the asset information management method is applied to a baseboard management controller (BMC), and may specifically include the following steps:
[0061] S110: Acquire the asset information to be managed, and verify and parse the asset information to be managed to obtain the parsed asset information corresponding to the asset information to be managed.
[0062] The asset information to be managed may be any asset information related to the server that needs to be managed. For example, the asset information to be managed may be CPU information, memory information, or PCIE information of the server, etc., which is not limited in the embodiment of the present invention. The parsed asset information may be the asset information obtained after verifying and parsing the asset information to be managed.
[0063] In the embodiment of the present invention, the asset information to be managed is obtained to verify and analyze the asset information to be managed, thereby obtaining the analyzed asset information corresponding to the asset information to be managed.
[0064] Optionally, obtaining the asset information to be managed may be obtaining the asset information to be managed in an IPMI command. Specifically, after the server is powered on, the BIOS may scan the server and collect the asset information of the server (i.e., the asset information to be managed), and the BIOS generates an IPMI command according to the asset information of the server, and sends the generated IPMI command to the BMC through the BIOS, so that the asset information to be managed in the IPMI command may be obtained through the IPMI command processing process in the BMC.
[0065] Optionally, verifying and parsing the asset information to be managed may be performed by verifying and parsing the asset information to be managed in the IPMI command through an IPMI command processing process in the BMC.
[0066] S120: Store the parsed asset information in an inter-process communication system, and determine an asset information file according to the parsed asset information.
[0067] Among them, the inter-process communication system can be used for communication between two or more processes. In the process of communicating through the inter-process communication system, one process can store communication data in the inter-process communication system, and another process can obtain the communication data in the inter-process communication system, thereby realizing communication between the two processes. It is understandable that any process can store communication data in the inter-process communication system, and correspondingly any process can obtain communication data in the process communication system. It is understandable that the inter-process communication systems in baseboard management controllers of different architectures can also be different. Exemplarily, in the baseboard management controller of the OpenBMC architecture, the inter-process communication system can be D-Bus (a message bus system). It is understandable that D-Bus can be used for inter-process communication or communication between a process and a kernel, and D-Bus is accepted by more and more platforms as a lightweight IPC (Inter-Process Communication). The asset information file can be asset information in the form of a file generated based on parsing asset information.
[0068] In the embodiment of the present invention, after verifying and parsing the asset information to be managed to obtain the parsed asset information corresponding to the asset information to be managed, the parsed asset information can be further stored in the inter-process communication system, and the asset information file can also be determined according to the parsed asset information to store the asset information file in the file system. It can be understood that after the parsed asset information is stored in the inter-process communication system, any process can directly connect to the inter-process communication system to obtain the parsed asset information.
[0069] Optionally, after the IPMI command processing process in the BMC verifies and parses the asset information to be managed in the IPMI command to obtain the parsed asset information, the parsed asset information can be sent to the asset information management process in the BMC by calling the inter-process communication system, so that the parsed asset information can be stored in the inter-process communication system through the asset information management process, and the asset information file can be determined based on the parsed asset information.
[0070] S130: Store the asset information file in a file system to manage the asset information to be managed.
[0071] In an embodiment of the present invention, after determining the asset information file based on the parsed asset information, the asset information file can be further stored in the file system to manage the asset information to be managed. Optionally, storing the asset information file in the file system can be storing the asset information file in a pre-set storage path in the file system. Exemplarily, the asset information file can be stored in / var / lib of the file system. Optionally, the asset information file can be stored in the file system through the asset information management process.
[0072] The technical solution of this embodiment obtains the asset information to be managed, verifies and analyzes the asset information to be managed to obtain the analyzed asset information corresponding to the asset information to be managed, and stores the analyzed asset information in the inter-process communication system, and determines the asset information file based on the analyzed asset information, and stores the asset information file in the file system, thereby realizing the management of the asset information to be managed, solving the problem that the existing asset information management method cannot obtain asset information in a timely and accurate manner, and can quickly and accurately obtain asset information, while facilitating the expansion of the asset information management function.
[0073] Embodiment 2
[0074] Figure 2 This is a flowchart of an asset information management method provided by Embodiment 2 of the present invention. This embodiment is a further refinement of the above-mentioned technical solutions, and provides multiple specific optional implementation methods for parsing asset information including server device identification and split asset information corresponding to the server identification. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above-mentioned embodiments. Figure 2 As shown, the method may include the following steps:
[0075] S210: Acquire the asset information to be managed, and verify and analyze the asset information to be managed to obtain the server device identifier corresponding to the asset information to be managed and the split asset information corresponding to the server identifier.
[0076] Among them, the server device identifier can be the identifier of the device in the server corresponding to the asset information to be managed, for example, it can be the name corresponding to the server device, or it can be the serial number corresponding to the server device, etc., and the embodiment of the present invention does not limit this. It can be understood that the server can include multiple devices, and the multiple devices in the server can be the same or different. Exemplarily, assuming that the server includes 2 CPU devices, the server device identifiers corresponding to the 2 CPU devices can be CPU-1 and CPU-2. Assuming that the server includes 1 memory device and 1 CPU device, the server device identifier corresponding to the memory device can be the memory, and the server device identifier corresponding to the CPU device can be the CPU.
[0077] The split asset information may be the asset information corresponding to the server device obtained after splitting the asset information to be managed. It is understandable that the asset information corresponding to different server devices may be different, and the asset information corresponding to the same server device may be the same or different.
[0078] In the embodiment of the present invention, the asset information to be managed is obtained to verify and analyze the asset information to be managed, thereby obtaining the server device identification corresponding to the asset information to be managed and the split asset information corresponding to the server device identification. It can be understood that the asset information to be managed can correspond to one or more server device identifications, and one server device identification can correspond to one or more split asset information.
[0079] S220. Determine, according to the server device identifier, a target storage path interface in the inter-process communication system corresponding to the asset information to be managed.
[0080] The target storage path interface may be an interface corresponding to a storage path in an inter-process communication system. It is understandable that the server device identifier corresponds to the target storage path interface one-to-one. Different server device identifiers correspond to different target storage path interfaces. That is, asset information corresponding to different server devices may be stored in different interface paths.
[0081] In an embodiment of the present invention, after verifying and parsing the asset information to be managed to obtain the server device identifier corresponding to the asset information to be managed and the split asset information corresponding to the server device identifier, the target storage path interface in the inter-process communication system corresponding to the asset information to be managed can be further determined based on the server device identifier.
[0082] Optionally, before determining the target storage path interface in the inter-process communication system corresponding to the asset information to be managed based on the server device identifier, it may also include: determining the historical asset information stored in the inter-process communication system and the historical asset information files stored in the file system; deleting the historical asset information and the historical asset information files.
[0083] The historical asset information may be the asset information stored in the inter-process communication system before the parsed asset information is stored in the inter-process communication system. The historical asset information file may be the asset information file stored in the file system before the asset information file is stored in the file system.
[0084] Specifically, before determining the target storage path interface in the inter-process communication system corresponding to the asset information to be managed according to the server device identifier, the historical asset information stored in the inter-process communication system and the historical asset information files stored in the file system can be determined to delete the historical asset information and the historical asset information files.
[0085] The above technical solution can ensure the reliability of asset information by deleting the asset information left in the inter-process communication system and the file system before storing and parsing the asset information.
[0086] S230. Determine a target asset information storage space according to the target storage path interface, and store the split asset information into the target asset information storage space.
[0087] The target asset information storage space may be a storage space determined according to the target storage path interface. That is, the target asset information storage space may be a space where the asset information corresponding to the server device is stored. It is understandable that the target asset information storage space may be a storage space in the inter-process communication system.
[0088] In an embodiment of the present invention, after determining the target storage path interface in the inter-process communication system corresponding to the asset information to be managed according to the server device identifier, the target asset information storage space can be further determined according to the target storage path interface to store the split asset information in the target asset information storage space.
[0089] The above technical solution can obtain the required asset information more quickly and accurately by determining the specific content of the parsed asset information and determining the storage space of the split asset information in the inter-process communication system according to the server device identifier obtained by the parsing.
[0090] Optionally, when storing the split asset information in the target asset information storage space, the split asset information may be stored in the target asset information storage space in the form of parameter variables.
[0091] Optionally, storing the split asset information in the target asset information storage space may include: determining the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information based on the split asset information; and storing the asset information parameter variable name and the asset information parameter variable value in the target asset information storage space.
[0092] The asset information parameter variable name may be the name of the parameter variable corresponding to the split asset information, and the asset information parameter variable value may be the value of the parameter variable corresponding to the split asset information.
[0093] Specifically, after determining the target storage path interface in the inter-process communication system corresponding to the asset information to be managed according to the server device identifier, the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information can be further determined according to the split asset information, so as to store the asset information parameter variable name and the asset information parameter variable value in the target asset information storage space. It can be understood that different split asset information can correspond to different asset information parameter variable names.
[0094] For example, if the split asset information is information that the CPU device is in place, then the asset information parameter variable name can be determined to be abc, and the asset information parameter variable value can be true. If the split asset information is information that the CPU device is not in place, then the asset information parameter variable name can be determined to be abc, and the asset information parameter variable value can be false. That is, the value of the parameter variable abc can represent information on whether the CPU device is in place.
[0095] The above technical solution determines the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information, and stores the asset information parameter variable name and the asset information parameter variable value in the target asset information storage space, so that the split asset information can be stored in the form of parameter variables, thereby improving the accuracy of obtaining asset information.
[0096] S240. Determine an asset information file according to the server device identifier and the split asset information corresponding to the server device identifier, and store the asset information file in a file system to manage the asset information to be managed.
[0097] In an embodiment of the present invention, an asset information file is determined based on a server device identifier and the split asset information corresponding to the server device identifier, so that the asset information file is stored in a file system, thereby managing the asset information to be managed. Optionally, an asset information file may correspond to multiple split asset information of a server device, that is, an asset information file is determined based on all split asset information corresponding to the server device identifier; or it may correspond to one split asset information of a server device, that is, one asset information file is determined based on one split asset information corresponding to the server device identifier, etc., and the embodiment of the present invention does not limit this.
[0098] Optionally, after storing the asset information file in the file system, it may also include: when restarting the baseboard management controller, obtaining the first storage asset information file stored in the file system; determining the storage management asset information based on the first storage asset information file, and storing the storage management asset information in the inter-process communication system.
[0099] The first storage asset information file may be an asset information file stored in the file system before the baseboard management controller is restarted. The storage management asset information may be asset information obtained according to the first storage asset information file.
[0100] Specifically, in the application scenario of restarting the baseboard management controller, the first storage asset information file stored in the file system can be obtained to determine the storage management asset information according to the first storage asset information file, thereby storing the storage management asset information in the inter-process communication system.
[0101] The above technical solution proposes an application scenario of restarting the baseboard management controller to store the asset information stored in the file system to the inter-process communication system after restarting the baseboard management controller, thereby further improving the acquisition rate of the asset information after restarting the baseboard management controller.
[0102] Optionally, after storing the asset information file in the file system, it may also include: when updating the baseboard management controller, determining the asset information file to be deleted in the file system; determining the retained asset information file in the file system based on the asset information file to be deleted; when determining that the retained asset information file is empty, returning to execute the operation of obtaining the asset information to be managed; when determining that the retained asset information file is not empty, determining the retained management asset information based on the retained asset information file, and storing the retained management asset information in the inter-process communication system.
[0103] The asset information file to be deleted may be an asset information file that needs to be deleted in the file system. The retained asset information file may be an asset information file that needs to be retained in the file system. It can be understood that the asset information file to be deleted and the retained asset information file constitute all asset information files in the file system. The retained management asset information may be asset information obtained according to the retained asset information file.
[0104] Specifically, in the application scenario of updating the baseboard management controller, the asset information files to be deleted in the file system can be determined, and the retained asset information files in the file system can be determined based on the asset information files to be deleted, so as to determine whether the retained asset information files are empty. If the retained asset information files are empty, it means that all asset information files in the file system have been deleted, and then the operation of obtaining the asset information to be managed can be returned to re-acquire the asset information to be managed. If the retained asset information files are not empty, it means that some asset information files in the file system have been deleted, and then the retained management asset information can be determined based on the retained asset information files, so as to store the retained management asset information in the inter-process communication system.
[0105] The above technical solution proposes an application scenario of updating the baseboard management controller to realize determining the retained asset information file in the file system after updating the baseboard management controller, so that when the retained asset information file is not empty, the retained asset information file is stored in the inter-process communication system, thereby further improving the asset information acquisition rate after updating the baseboard management controller.
[0106] Optionally, determining the asset information files to be deleted in the file system may include: obtaining a second storage asset information file stored in the file system, and determining whether to retain the second storage asset information file; if so, determining the asset information files to be deleted in the second storage asset information file according to the asset information deletion instruction; if not, determining all second storage asset information files in the file system as asset information files to be deleted.
[0107] The second stored asset information file may be an asset information file stored in the file system before the baseboard management controller is updated. The asset information deletion instruction may be an instruction to delete the asset information in the file system.
[0108] Specifically, in the application scenario of updating the baseboard management controller, the second storage asset information file stored in the file system can be obtained, and it is determined whether to retain the second storage asset information file. If the second storage asset information file is retained, the asset information file to be deleted in the second storage asset information file can be determined according to the asset information deletion instruction. If the second storage asset information file is not retained, all the second storage asset information files in the file system can be determined as asset information files to be deleted.
[0109] The above technical solution proposes a specific implementation method for determining the asset information files to be deleted in the file system, so as to more accurately determine the asset information files to be deleted.
[0110] The technical solution of this embodiment obtains the asset information to be managed, and verifies and analyzes the asset information to be managed to obtain the server device identification corresponding to the asset information to be managed and the split asset information corresponding to the server identification, so as to determine the target storage path interface in the inter-process communication system corresponding to the asset information to be managed according to the server device identification, and determine the target asset information storage space according to the target storage path interface, so as to store the split asset information in the target asset information storage space, and then determine the asset information file according to the server device identification and the split asset information corresponding to the server device identification, so as to store the asset information file in the file system, so as to manage the asset information to be managed, solves the problem that the existing asset information management method cannot obtain asset information in a timely and accurate manner, can quickly and accurately obtain asset information, and is convenient for the expansion of asset information management functions.
[0111] Embodiment 3
[0112] In order to enable those skilled in the art to better understand the asset information management method of this embodiment, the application scenario of the baseboard management controller of the OpenBMC architecture is used as an example for specific description. OpenBMC is an open source project of BMC. With the development of technology, OpenBMC has become more mature and stable, and gradually becomes the development direction of BMC in the future. However, there is no universal asset information management solution for OpenBMC in the prior art, and the existing asset information management solution cannot fully utilize the framework advantages of OpenBMC if it is directly used for OpenBMC. Therefore, the asset information management method of the baseboard management controller based on the OpenBMC architecture is of great significance.
[0113] Figure 3 is an example flow chart of an asset information management method provided by Embodiment 3 of the present invention, such as Figure 3 As shown, the method may specifically include:
[0114] (1) After the server is powered on, the BIOS can be used to scan the server device to collect the asset information of the server device (i.e., the asset information to be managed), and the BIOS can generate an IPMI command based on the collected asset information and send it to the BMC.
[0115] (2) After receiving the IPMI command, the BMC can verify and parse the asset information through the IPMI command processing process in the BMC to obtain the parsed asset information.
[0116] (3) Call the D-Bus bus to send the parsed asset information to the asset information management process in the BMC.
[0117] (4) After receiving the parsed asset information, the asset information management process clears the remaining asset information (ie, historical asset information and historical asset information files) on the D-Bus bus and in the file system through the asset information management process.
[0118] (5) The parsed asset information is added to the D-Bus bus through the asset information management process, and the parsed asset information is stored in the form of a file under / var / lib of the file system. Specifically, the asset information of different server devices can be added to different path interfaces in the D-Bus bus, and different asset information corresponding to the same server device can be stored in the form of parameter variables under the interface path corresponding to the server device. In other words, different server devices can be distinguished by the name of the path interface on the D-Bus bus, and different asset information can be distinguished by the name of the parameter variable.
[0119] (6) When other processes need to obtain asset information, they can directly obtain asset information on the D-Bus bus. Specifically, if other processes need to obtain asset information, for example, the BMC backend process needs to obtain asset information and pass it to the front end through the redfish interface, and finally display the asset information on the BMC web page, or the monitoring process of the relevant device needs to obtain the asset information of the corresponding device in order to identify the device, etc., then the D-Bus bus can be connected to obtain the asset information through the path interface corresponding to the server device.
[0120] The above technical solution does not require secondary analysis when other processes need to obtain asset information. The required asset information can be quickly and accurately obtained through the path interface and the name of the parameter variable.
[0121] Figure 4 is another example flow chart of an asset information management method provided by Embodiment 3 of the present invention. Figure 4 As shown, in the application scenario of restarting the BMC, the method may include the following contents:
[0122] (1) The asset information stored in the file system (ie, the first storage asset information file) is obtained through the asset information management process.
[0123] (2) The asset information stored in the file system is added to the D-Bus bus through the asset information management process.
[0124] The above technical solution, in the application scenario of restarting the BMC, obtains the asset information stored in the file system and stores it on the D-Bus bus, so that other processes can directly obtain the asset information on the D-Bus bus when they need to obtain it. It is understandable that after restarting the BMC, the asset information stored on the D-Bus bus will be lost.
[0125] Figure 5 is another example flow chart of an asset information management method provided by Embodiment 3 of the present invention. Figure 5 As shown, in the application scenario of updating the BMC, the method may include the following contents:
[0126] (1) Determine whether to retain the asset information in the file system (ie, the second storage asset information file).
[0127] (2) If yes, determine the asset information file to be deleted and delete the asset information file to be deleted. After the BMC is started, the asset information is obtained in the file system through the asset information management process (that is, the asset information file is retained), and the retained asset information file is added to the D-Bus bus through the asset information management process.
[0128] (3) If not, delete all asset information in the file system. After the BMC is started, wait for the BIOS to send an IPMI command to push the asset information. It is understandable that if the asset information in the file system is not retained, there is no asset information in the file system after the BMC is updated, and the asset information can be obtained again through the BIOS.
[0129] The above technical solution allows other processes to obtain the asset information through the D-Bus bus by retaining the asset information in the file system.
[0130] The technical solution of this embodiment makes full use of the D-Bus bus in OpenBMC, making the interaction between different processes faster and more convenient, which is conducive to the expansion of asset information management functions. The asset information can be displayed on a visual web interface, while meeting the data requirements of other processes. By saving the asset information in the file system, not only can the asset information be retained after restarting the BMC, but also when updating the BMC, it can be flexibly configured not to retain, retain all or retain part of the asset information, thereby making development or management work more convenient.
[0131] Embodiment 4
[0132] Figure 6 is a schematic diagram of an asset information management device provided by Embodiment 4 of the present invention, such as Figure 6As shown, the device is configured in a baseboard management controller, and specifically includes: an asset information acquisition module 610, an asset information storage module 620 and an asset information management module 630, wherein:
[0133] The asset information acquisition module 610 is used to acquire the asset information to be managed, and verify and parse the asset information to be managed to obtain the parsed asset information corresponding to the asset information to be managed;
[0134] The asset information storage module 620 is used to store the parsed asset information in the inter-process communication system and determine the asset information file according to the parsed asset information;
[0135] The asset information management module 630 is used to store the asset information file in the file system to manage the asset information to be managed.
[0136] The technical solution of this embodiment obtains the asset information to be managed, verifies and analyzes the asset information to be managed to obtain the analyzed asset information corresponding to the asset information to be managed, and stores the analyzed asset information in the inter-process communication system, and determines the asset information file based on the analyzed asset information, and stores the asset information file in the file system, thereby realizing the management of the asset information to be managed, solving the problem that the existing asset information management method cannot obtain asset information in a timely and accurate manner, and can quickly and accurately obtain asset information, while facilitating the expansion of the asset information management function.
[0137] Optionally, the parsed asset information may include a server device identifier and split asset information corresponding to the server device identifier; accordingly, the asset information storage module 620 may be specifically used to: determine, based on the server device identifier, a target storage path interface in the inter-process communication system corresponding to the asset information to be managed; determine a target asset information storage space based on the target storage path interface, and store the split asset information in the target asset information storage space.
[0138] Optionally, the asset information storage module 620 may be further used to: determine the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information according to the split asset information; and store the asset information parameter variable name and the asset information parameter variable value in the target asset information storage space.
[0139] Optionally, the asset information storage module 620 may also be specifically used to: determine the historical asset information stored in the inter-process communication system and the historical asset information files stored in the file system; and delete the historical asset information and the historical asset information files.
[0140] Optionally, the asset information management module 630 can be specifically used to: obtain a first storage asset information file stored in the file system when restarting the baseboard management controller; determine storage management asset information based on the first storage asset information file, and store the storage management asset information in the inter-process communication system.
[0141] Optionally, the asset information management module 630 can also be specifically used to: determine the asset information files to be deleted in the file system when updating the baseboard management controller; determine the retained asset information files in the file system based on the asset information files to be deleted; when it is determined that the retained asset information files are empty, return to execute the operation of obtaining the asset information to be managed; when it is determined that the retained asset information files are not empty, determine the retained management asset information based on the retained asset information files, and store the retained management asset information in the inter-process communication system.
[0142] Optionally, the asset information management module 630 can be further used to: obtain the second storage asset information file stored in the file system, and determine whether to retain the second storage asset information file; if so, determine the asset information file to be deleted in the second storage asset information file according to the asset information deletion instruction; if not, determine all the second storage asset information files in the file system as asset information files to be deleted.
[0143] The asset information management device provided in the embodiment of the present invention can execute the asset information management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0144] Embodiment 5
[0145] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0146] like Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0147] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0148] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the asset information management method.
[0149] In some embodiments, the asset information management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the asset information management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the asset information management method in any other suitable manner (e.g., by means of firmware).
[0150] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0152] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0153] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0154] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0155] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0157] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An asset information management method, characterized in that: Applicable to baseboard management controllers, including: Acquire the asset information to be managed, and verify and parse the asset information to be managed to obtain parsed asset information corresponding to the asset information to be managed, wherein the parsed asset information includes a server device identifier; According to the server device identifier, determine the interface path in the D-Bus bus corresponding to the asset information to be managed, store different parsed asset information corresponding to the same server device in the form of parameter variables under the interface path corresponding to the server device in the D-Bus bus, and determine the asset information file according to the parsed asset information, wherein the parameter variable includes the asset information parameter variable name; The asset information file is stored in a file system, and when the baseboard management controller is updated, the asset information file to be deleted in the file system is determined; according to the asset information file to be deleted, a reserved asset information file in the file system is determined; when it is determined that the reserved asset information file is not empty, the reserved management asset information is determined according to the reserved asset information file, and the reserved management asset information is stored in the D-Bus bus; When other processes need to obtain asset information, the asset information is obtained through the path interface and the asset information parameter variable name, wherein the path interface represents the target storage path interface corresponding to the interface path.
2. The method according to claim 1, characterized in that: The parsed asset information also includes split asset information corresponding to the server device identifier; The storing of different parsed asset information corresponding to the same server device in the form of parameter variables under the interface path corresponding to the server device in the D-Bus bus includes: Determine the target asset information storage space according to the target storage path interface; According to the split asset information, determine the asset information parameter variable name and the asset information parameter variable value corresponding to the split asset information; The asset information parameter variable name and the asset information parameter variable value are stored in the target asset information storage space.
3. The method according to claim 1, characterized in that Before storing the different parsed asset information corresponding to the same server device in the form of parameter variables in the interface path corresponding to the server device in the D-Bus bus, the method further includes: Determining the historical asset information stored in the D-Bus bus and the historical asset information file stored in the file system; The historical asset information and the historical asset information file are deleted.
4. The method according to claim 1, characterized in that: After storing the asset information file in the file system, the method further includes: In case of restarting the baseboard management controller, obtaining a first storage asset information file stored in the file system; Storage management asset information is determined according to the first storage asset information file, and the storage management asset information is stored in the D-Bus bus.
5. The method according to claim 1, characterized in that After storing the asset information file in the file system, the method further includes: When it is determined that the retained asset information file is empty, the operation of obtaining the asset information to be managed is returned to be executed.
6. The method according to claim 1, characterized in that The determining of the asset information files to be deleted in the file system includes: Acquire a second storage asset information file stored in the file system, and determine whether to retain the second storage asset information file; If yes, determine the asset information file to be deleted in the second stored asset information file according to the asset information deletion instruction; If not, all second storage asset information files in the file system are determined as the asset information files to be deleted.
7. An asset information management device, characterized in that: Configured in the baseboard management controller, including: An asset information acquisition module, used to acquire the asset information to be managed, and verify and parse the asset information to be managed to obtain parsed asset information corresponding to the asset information to be managed, wherein the parsed asset information includes a server device identifier; The asset information storage module is used to determine the interface path in the D-Bus bus corresponding to the asset information to be managed according to the server device identifier, store different parsed asset information corresponding to the same server device in the form of parameter variables under the interface path corresponding to the server device in the D-Bus bus, and determine the asset information file according to the parsed asset information, wherein the parameter variable includes the asset information parameter variable name; The asset information management module is used to store the asset information file in the file system, determine the asset information file to be deleted in the file system when the baseboard management controller is updated; determine the retained asset information file in the file system based on the asset information file to be deleted; when it is determined that the retained asset information file is not empty, determine the retained management asset information based on the retained asset information file, and store the retained management asset information in the D-Bus bus; when other processes need to obtain asset information, obtain the asset information through the path interface and the asset information parameter variable name, wherein the path interface represents the target storage path interface corresponding to the interface path.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the asset information management method described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the asset information management method described in any one of claims 1 to 6 when executed.
