An information collection method, device, equipment and readable storage medium
By identifying the sensor version and querying the database for acquisition instructions and matching rules, the problem of frequent hardware information acquisition and matching was solved, achieving efficient acquisition and easy maintenance of hardware information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-07-29
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies require frequent hardware information acquisition, resulting in high manpower investment and failing to effectively solve the problem of hardware information acquisition.
By identifying the sensor version corresponding to the hardware specifications, the system queries the database for acquisition instructions and matching rules, executes the acquisition commands, and uses the matching rules to filter target hardware information. The acquisition instructions and matching rules are maintained in the database, which facilitates expansion and maintenance.
It reduces the need to rewrite the hardware information collection logic; only the database needs to be updated to adapt to hardware upgrades or new equipment, reducing manpower investment and making it easy to expand and maintain.
Smart Images

Figure CN115202699B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer application technology, and in particular to an information acquisition method, apparatus, device, and readable storage medium. Background Technology
[0002] Collecting hardware information is crucial for managing and maintaining hardware devices, and for understanding and deploying services on those devices.
[0003] Currently, hardware information collection starts with the product name, with each type of device paired with a corresponding sensor. The system retrieves hardware information by calling the appropriate sensor commands based on the known sensor information. This means that every time a new product type is added, even when using existing sensors, re-adaptation is required; similarly, re-adaptation is needed when the corresponding hardware sensor is upgraded.
[0004] Since adaptation means rewriting the entire hardware information collection logic, a lot of manpower is needed every time software products are upgraded and various devices are updated.
[0005] In conclusion, how to effectively solve problems such as hardware information collection is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this application is to provide an information acquisition method, apparatus, device, and readable storage medium, and to provide a new hardware information acquisition mode. In this mode, hardware information can be effectively acquired, and when there are software or hardware upgrades or new devices, only the database needs to be maintained, without the need to rewrite the overall hardware information acquisition logic.
[0007] To solve the above-mentioned technical problems, this application provides the following technical solution:
[0008] An information acquisition method, comprising:
[0009] After receiving the data collection request, determine the hardware metrics to be collected and identify the sensor version corresponding to the hardware metrics;
[0010] Using the hardware specifications and the sensor version, the corresponding acquisition instructions and matching rules are retrieved from the database;
[0011] Execute the acquisition command to obtain hardware information;
[0012] Using the matching rules, target hardware information is filtered out from the hardware information.
[0013] Preferably, identifying the sensor version corresponding to the hardware specifications includes:
[0014] Using the aforementioned hardware specifications, the target sensor to be used is determined;
[0015] Obtain the sensor version of the target sensor from the baseboard management controller.
[0016] Preferably, executing the acquisition command to obtain hardware information includes:
[0017] Send the acquisition command to the target sensor;
[0018] Receive the hardware information fed back by the target sensor.
[0019] Preferably, the target hardware information is filtered from the hardware information using the matching rules, including:
[0020] Based on the matching rules, regular expression matching is performed on the hardware information to filter out the target hardware information.
[0021] Preferably, it further includes:
[0022] The target hardware information is periodically sent to the management node.
[0023] Preferably, it further includes:
[0024] The target hardware information is displayed in the visual interface of the management software.
[0025] Preferably, it further includes:
[0026] Get new collection instructions and / or new matching rules;
[0027] The database is updated using the new acquisition instructions and / or the new matching rules.
[0028] An information collection device, comprising:
[0029] The identification module is used to receive a collection request, determine the hardware indicators to be collected, and identify the sensor version corresponding to the hardware indicators.
[0030] The search module is used to query the database for the corresponding acquisition instructions and matching rules using the hardware specifications and the sensor version.
[0031] The acquisition module is used to execute the acquisition command and obtain hardware information;
[0032] The filtering module is used to filter out target hardware information from the hardware information using the matching rules.
[0033] An electronic device, comprising:
[0034] Memory, used to store computer programs;
[0035] A processor is used to implement the steps of the above-described information acquisition method when executing the computer program.
[0036] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described information acquisition method.
[0037] By applying the method provided in the embodiments of this application, after receiving a data acquisition request, the hardware indicators to be acquired are determined, and the sensor version corresponding to the hardware indicators is identified; using the hardware indicators and sensor version, the corresponding acquisition instructions and matching rules are retrieved from the database; the acquisition command is executed to obtain hardware information; and the target hardware information is filtered out from the hardware information using the matching rules.
[0038] In this application, upon receiving a data acquisition request, the hardware specifications to be acquired are first determined, and then the sensor version corresponding to those specifications is identified. Then, the acquisition command and matching rules matching the hardware specifications and sensor version are directly queried from the database. By executing the acquisition command, the hardware information can be obtained. Since the output of the acquisition command contains a large amount of data, it needs to be filtered. Specifically, the target hardware information can be filtered from the hardware information based on the matching rules. That is, this application can effectively acquire the target hardware information corresponding to the hardware specifications. The acquisition commands and matching rules are maintained in the database; therefore, if new sensors are introduced, other device information is added, or software and hardware are upgraded subsequently, only the new information needs to be maintained in the database, making it easy to expand and maintain.
[0039] Accordingly, embodiments of this application also provide information collection devices, equipment, and readable storage media corresponding to the above-described information collection methods, which have the aforementioned technical effects, and will not be elaborated further here. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating the implementation of an information collection method in this application.
[0042] Figure 2 This is a schematic diagram illustrating a specific implementation of an information collection method in this application.
[0043] Figure 3 This is a schematic diagram of the structure of an information acquisition device according to an embodiment of this application;
[0044] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of the specific structure of an electronic device in an embodiment of this application. Detailed Implementation
[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] Please refer to Figure 1 , Figure 1 This is a flowchart of an information acquisition method according to an embodiment of this application. This method can be applied to any device that needs to acquire hardware information or to the management device of that device. The method includes the following steps:
[0048] S101. After receiving the data acquisition request, determine the hardware specifications to be acquired and identify the sensor version corresponding to the hardware specifications.
[0049] Specifically, it can receive collection requests sent by external devices or software, or it can be considered to have received a collection request when a local upper-layer application initiates a hardware information collection command. The collection request can carry hardware indicators or identification information that can specify the hardware indicators.
[0050] Upon receiving a data collection request, the hardware metrics to be collected can be determined by parsing the request. Hardware metrics specify which hardware information needs to be collected. Specifically, hardware metrics could include collecting the temperature information of the CPU on the local machine / node.
[0051] Sensors can collect hardware information, and different hardware can be collected using different sensors. Furthermore, different types of hardware information can also be collected using different sensors. Considering that different sensor versions may have different acquisition commands and data output formats, once the hardware specifications to be collected are determined, the corresponding sensor version can be identified.
[0052] Specifically, the sensor version corresponding to the hardware specifications can be obtained by interacting with the baseboard management controller. That is, step S101, identifying the sensor version corresponding to the hardware specifications, includes:
[0053] Step 1: Use hardware specifications to determine the target sensor to be used;
[0054] Step 2: Obtain the sensor version of the target sensor from the baseboard management controller.
[0055] For ease of description, the two steps above will be explained together below.
[0056] This hardware specification indicates which hardware is being used to collect which type of information. Different hardware corresponds to different sensors, and different information collection requires different sensors. Therefore, the target sensor to be used can be clearly identified directly based on this hardware specification. In this paper, for ease of distinction from other sensors, the sensor to be used is referred to as the target sensor. This target sensor can be a single sensor or multiple sensors, with the number and type of sensors corresponding to the hardware specification. For example, if only CPU temperature data needs to be collected, the target sensor is based on a sensor capable of collecting CPU temperature data.
[0057] Since the Baseboard Management Controller (BMC) can manage devices such as sensors, and the BMC can obtain information such as the sensor version number, after determining the target sensor, the sensor version of the target sensor can be obtained by interacting with the Baseboard Management Controller (BMC). In this embodiment, the specific interaction method can be found in relevant interaction implementation schemes, and will not be elaborated further here.
[0058] S102. Using hardware specifications and sensor version, retrieve the corresponding acquisition instructions and matching rules from the database.
[0059] In this embodiment, a database can be constructed, either locally or remotely. This database stores acquisition commands for different types and versions of sensors, along with corresponding matching rules. Specifically, the database maintains information such as the device parameters to be acquired, the corresponding sensor version, the acquisition commands for different versions, and the matching rules.
[0060] Among them, the acquisition command is the command that needs to be executed so that the sensor can acquire hardware information.
[0061] Matching rules refer to how to identify the specific meaning of each piece of information from a large amount of collected hardware information, so as to filter out the information corresponding to the hardware indicators from the large amount of collected hardware information.
[0062] Since the hardware information collected by the sensor corresponds to a large amount of data, it is necessary to use matching rules corresponding to the hardware indicators to filter the large amount of hardware information in order to obtain the target hardware information corresponding to the hardware indicators.
[0063] Based on hardware specifications and sensor version, the corresponding acquisition instructions and matching rules can be retrieved from the database.
[0064] The following example will be used to explain the data collection instructions and matching rules stored in the database.
[0065] Example 1: Different commands for obtaining CPU version on different CPU platforms: Command for identifying different CPU platforms: cat / proc / cpuinfo; For Intel, the corresponding command: dmidecode -s processor-version; For Power, the corresponding command: ipmitool fru.
[0066] Among them, the Intel processor (Intel CPU) is a central processing unit (CPU) developed by Intel Corporation. It has three series: mobile, desktop, and server. It is the most important part of a computer, consisting of an arithmetic logic unit (ALU) and a control unit.
[0067] Power (Performance Optimization With Enhanced RISC) is one of the most common CPU architectures.
[0068] Example 2: The same command on the same platform has different matching rules in different versions.
[0069] Older version 8.3.0 New version 8.15.0 CPU_TEMP_01 CPU0_Temp CPU_TEMP_02 CPU1_Temp
[0070] As shown in the table above: For version 8.3.0, the hardware information names of the output results for obtaining CPU temperature are CPU_TEMP_01 and CPU_TEMP_02; while for version 8.15.0, the hardware information names of the output results for obtaining CPU temperature are CPU0_Temp and CPU1_Temp. That is to say, even for the same CPU, the output format differs depending on the version. For example, version 8.3.0 outputs CPU_TEMP_01 56; while version 8.15.0 outputs CPU0_Temp 56. In order to effectively identify the temperature information, i.e., 56 in the output result, a matching rule is needed to extract the desired temperature data. The matching rule for temperature filtering retrieved from the database is as follows: Old version 8.3.0 matching rule: CPU_TEMP_([0-9]+); New version 8.15.0 matching rule: CPU([0-9]+)_Temp.
[0071] Additionally, to identify the BMC version: use `ipmitool bmc info`;
[0072] Recognition command: ipmitool sensor.
[0073] Example 3: Different commands for obtaining fan information on different platforms: Command for identifying different CPU platforms: cat / proc / cpuinfo; Intel platform: ipmitool sensor; FT platform: ipmitool raw 0x3a 0x31.
[0074] Example 4: The same command on the same platform, but different versions, uses different matching rules. The specific output format for fan speed can be found in the table below:
[0075]
[0076]
[0077] Identify the BMC version: ipmitool bmc info;
[0078] Recognition command: ipmitool sensor;
[0079] Old version matching rule: FAN_SPEED_([0-9]+);
[0080] New version matching rule: SYS_Fan([0-9]+)_Speed.
[0081] S103. Execute the acquisition command to obtain hardware information.
[0082] Once the acquisition command is received, it can be executed to obtain hardware information.
[0083] In one specific embodiment of this application, step S103 executes a data acquisition command to obtain hardware information, including:
[0084] Step 1: Send the acquisition command to the target sensor;
[0085] Step 2: Receive hardware information fed back from the target sensor.
[0086] For ease of description, the two steps above will be explained together below.
[0087] The BMC can send acquisition commands to the target sensor. Upon receiving the acquisition command, the target sensor can then acquire hardware information. Once the sensor has acquired the hardware information, it can also provide feedback through the BMC. Alternatively, communication with the sensor can also be conducted directly without relying on the BMC.
[0088] S104. Using matching rules, filter out the target hardware information from the hardware information.
[0089] Since the hardware information obtained from the acquisition commands is a large amount of data, rather than the target hardware information corresponding to the hardware specifications, after obtaining the hardware information, the target hardware information can be filtered out based on matching rules. This target hardware information is the hardware information corresponding to the hardware specifications.
[0090] The matching rules can clearly define the output format of the target hardware information. Therefore, based on these matching rules, the collected hardware information can be matched and queried one by one to finally filter out the target hardware information.
[0091] In one specific embodiment of this application, the hardware information can be filtered out by performing regular expression matching based on matching rules. Regular expression matching is a commonly used character search method. For details on how to implement regular expression matching, please refer to the specific principles and implementation schemes of regular expression matching, which will not be elaborated upon here.
[0092] In one specific embodiment of this application, after obtaining the target hardware information, the target hardware information can also be displayed on the visual interface of the management software. In this way, the user can understand the specific hardware situation through the visual interface.
[0093] By applying the method provided in the embodiments of this application, after receiving a data acquisition request, the hardware indicators to be acquired are determined, and the sensor version corresponding to the hardware indicators is identified; using the hardware indicators and sensor version, the corresponding acquisition instructions and matching rules are retrieved from the database; the acquisition command is executed to obtain hardware information; and the target hardware information is filtered out from the hardware information using the matching rules.
[0094] In this application, upon receiving a data acquisition request, the hardware specifications to be acquired are first determined, and then the sensor version corresponding to those specifications is identified. Then, the acquisition command and matching rules matching the hardware specifications and sensor version are directly queried from the database. By executing the acquisition command, the hardware information can be obtained. Since the output of the acquisition command contains a large amount of data, it needs to be filtered. Specifically, the target hardware information can be filtered from the hardware information based on the matching rules. That is, this application can effectively acquire the target hardware information corresponding to the hardware specifications. The acquisition commands and matching rules are maintained in the database; therefore, if new sensors are introduced, other device information is added, or software and hardware are upgraded subsequently, only the new information needs to be maintained in the database, making it easy to expand and maintain.
[0095] It should be noted that, based on the above embodiments, the embodiments of this application also provide corresponding improvement schemes. In the preferred / improved embodiments, the same or corresponding steps as in the above embodiments can be referred to each other, and the corresponding beneficial effects can also be referred to each other; however, these will not be elaborated upon in the preferred / improved embodiments herein.
[0096] In one specific embodiment of this application, after obtaining the target hardware information, the target hardware information can also be periodically sent to the management node.
[0097] Specifically, when the information collection method provided in the above embodiments is applied to storage product management software, the steps of the above information collection method can be implemented on each storage node. Upon obtaining the target hardware information, information reporting occurs in the distributed storage system. Each node aggregates the information it has collected and uploads it to the master node's database periodically. The master node then aggregates the collected hardware information and displays it on the storage system management software interface. When displaying the target hardware information, a corresponding trend chart can be generated for the target hardware information collected multiple times, allowing users to understand the trend in a timely manner. Furthermore, alarm thresholds can be set to provide early warning / alarm processing based on the target hardware information. For example, if the CPU temperature reaches a high-temperature threshold, an alarm email is sent to the relevant administrator, and the information is highlighted on the display interface (e.g., highlighted, magnified values).
[0098] In other words, in a distributed storage system, the application of information acquisition methods enables storage product management software to adapt to different hardware and acquire device information. This technology consists of two aspects: information acquisition and information reporting. Information acquisition first identifies different hardware information sensors, then acquires relevant hardware information according to the corresponding sensor instructions. After obtaining the hardware information, it uses regular expression matching based on the standard output format of different hardware devices to obtain the final target hardware information. Information reporting occurs in the distributed storage system where each node aggregates the target hardware information it has collected and periodically uploads it to the master node's database. The master node then aggregates the collected hardware information and displays it on the storage system management software interface.
[0099] In one specific embodiment of this application, the following steps may also be performed to complete the hardware information acquisition and adaptation:
[0100] Step 1: Obtain new collection instructions and / or new matching rules;
[0101] Step 2: Update the database using the new collection instructions and / or new matching rules.
[0102] For ease of description, the two steps above will be explained together below.
[0103] As discussed above, different CPU platforms use different commands to obtain CPU versions; even on the same platform, different versions of the same command use different matching rules; different platforms use different commands to obtain fan information; and even on the same platform, different versions of the same command use different matching rules. Therefore, each time a new product type is added, or when the corresponding hardware sensor is upgraded, or when the software product is upgraded, corresponding new acquisition commands, or corresponding new matching rules, or both, can be obtained, and this new content can be updated in the database. Specifically, the content in the original database can be replaced with the new content, or the new content can be directly added to the database. Thus, when hardware information needs to be collected, by executing the methods and steps provided in the above embodiments, it is possible to adapt to new product types, upgraded hardware sensors, and upgraded software products. Using this method to complete the adaptation can reduce a significant amount of manpower and enable rapid completion of the adaptation work.
[0104] To facilitate those skilled in the art to better understand and implement the information acquisition method provided in the embodiments of this application, the following uses the framework technology for acquiring device information by management software under different sensors in a distributed storage system that applies the information acquisition method as an example to describe the information acquisition method in detail.
[0105] The framework technology is divided into two aspects: hardware information collection and hardware information reporting.
[0106] Hardware information acquisition mainly involves maintaining the data required to acquire device information in a local database, including the device's specifications, sensor version, acquisition commands, and matching rules.
[0107] When hardware information needs to be collected, the sensor version is first identified, and then the corresponding collection command is obtained based on the specifications of the device to be collected. Since the output of the collection command will contain a large amount of data, the required device information is finally filtered out through matching rules. If new sensors are introduced or other device information collection is added later, the new information only needs to be maintained in the database on the basis of the existing framework, which is easy to expand and maintain.
[0108] The information reporting module is where each node in the distributed cluster first stores the hardware device information it collects in its own database, and then periodically summarizes the device information of its own node and sends it to the master node. After receiving the reported information from the slave nodes, the master node stores this device information in its database and finally displays it on the interface of the management software.
[0109] By addressing these two aspects, an adaptation framework can be built for management software to acquire device information across different sensors in a distributed storage system. For details, please refer to [link / reference needed]. Figure 2 , Figure 2 This is a schematic diagram illustrating a specific implementation of an information collection method in this application.
[0110] When collecting a certain hardware metric from a node, the sensor version is first identified. Then, based on the sensor version and hardware metric, the database is queried to obtain the corresponding acquisition command and matching rules. After obtaining the acquisition command, the corresponding acquisition command is called to obtain hardware device information. Since the hardware information output by the acquisition command is too much, the final result is obtained by filtering according to the matching rules and then recorded in the local node database.
[0111] Each node in the cluster starts a task to periodically transmit device information. When the task starts, it aggregates any unuploaded data and sends it to the master node. The master node, upon receiving the uploaded device information, stores it in its database. The management software's device information display interface then reads the latest device information from the database and displays it on the screen.
[0112] The core hardware components of storage products include power supplies, CPUs, memory, and fans. Obtaining information about this hardware is crucial for managing storage products. Therefore, the data collection solution provided in this application can effectively collect hardware information from storage products, enabling rapid adaptation for upgrades and other improvements, thus significantly enhancing the performance of storage products.
[0113] By applying the information acquisition method provided in the above embodiments, a framework for adapting management software to acquire device information under different sensors in a distributed storage system can be established. If new sensors are subsequently introduced or other device information acquisition is added, it is only necessary to maintain the commands and rules related to the new device information in the database based on the existing framework, making it easy to expand and maintain.
[0114] Corresponding to the above method embodiments, this application also provides an information collection device. The information collection device described below can be referred to in correspondence with the information collection method described above.
[0115] See Figure 3 As shown, the device includes the following modules:
[0116] The identification module 101 is used to receive a data acquisition request, determine the hardware indicators to be acquired, and identify the sensor version corresponding to the hardware indicators.
[0117] The lookup module 102 is used to retrieve the corresponding acquisition instructions and matching rules from the database using hardware specifications and sensor versions.
[0118] The acquisition module 103 is used to execute acquisition commands and obtain hardware information;
[0119] The filtering module 104 is used to filter out target hardware information from hardware information using matching rules.
[0120] Using the apparatus provided in the embodiments of this application, after receiving a data acquisition request, the apparatus determines the hardware specifications to be acquired and identifies the sensor version corresponding to the hardware specifications; using the hardware specifications and sensor version, the apparatus queries the database for the corresponding acquisition instructions and matching rules; the apparatus executes the acquisition command to obtain hardware information; and using the matching rules, the apparatus filters out the target hardware information from the hardware information.
[0121] In this application, upon receiving a data acquisition request, the hardware specifications to be acquired are first determined, and then the sensor version corresponding to those specifications is identified. Then, the acquisition command and matching rules matching the hardware specifications and sensor version are directly queried from the database. By executing the acquisition command, the hardware information can be obtained. Since the output of the acquisition command contains a large amount of data, it needs to be filtered. Specifically, the target hardware information can be filtered from the hardware information based on the matching rules. That is, this application can effectively acquire the target hardware information corresponding to the hardware specifications. The acquisition commands and matching rules are maintained in the database; therefore, if new sensors are introduced, other device information is added, or software and hardware are upgraded subsequently, only the new information needs to be maintained in the database, making it easy to expand and maintain.
[0122] In one specific embodiment of this application, the identification module 101 is specifically used to determine the target sensor to be used using hardware indicators.
[0123] Obtain the sensor version of the target sensor from the baseboard management controller.
[0124] In one specific embodiment of this application, the acquisition module 103 is specifically used to send acquisition commands to the target sensor;
[0125] Receive hardware information fed back from the target sensor.
[0126] In one specific embodiment of this application, the filtering module 104 is specifically used to perform regular expression matching on the hardware information based on matching rules to filter out the target hardware information.
[0127] In one specific embodiment of this application, it further includes:
[0128] The sending module is used to periodically send target hardware information to the management node.
[0129] In one specific embodiment of this application, it further includes:
[0130] The display module is used to show target hardware information in the visual interface of the management software.
[0131] In one specific embodiment of this application, it further includes:
[0132] The adaptation module is used to obtain new collection instructions and / or new matching rules;
[0133] Update the database using new collection instructions and / or new matching rules.
[0134] Corresponding to the above method embodiments, this application also provides an electronic device. The electronic device described below and the information collection method described above can be referred to each other.
[0135] See Figure 4 As shown, the electronic device includes:
[0136] Memory 332 is used to store computer programs;
[0137] The processor 322 is used to implement the steps of the information acquisition method in the above method embodiment when executing a computer program.
[0138] For details, please refer to Figure 5 , Figure 5This is a schematic diagram of a specific structure of an electronic device provided in this embodiment. The electronic device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer application programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the central processing unit 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the electronic device 301.
[0139] Electronic device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0140] The steps in the information acquisition method described above can be implemented by the structure of an electronic device.
[0141] Corresponding to the above method embodiments, this application also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the information acquisition method described above.
[0142] A readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the information acquisition method described in the above method embodiments.
[0143] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0144] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
Claims
1. An information collection method, characterized in that, include: After receiving the data collection request, determine the hardware metrics to be collected and identify the sensor version corresponding to the hardware metrics; Using the hardware specifications and the sensor version, the corresponding acquisition instructions and matching rules are retrieved from the database; Execute the acquisition command to obtain hardware information; Using the matching rules, target hardware information is filtered out from the hardware information; The acquisition command is the instruction that needs to be executed to enable the sensor to acquire hardware information; the matching rule corresponds to how to identify the specific meaning of each piece of information from a large amount of acquired hardware information, and complete the screening of information that corresponds to the hardware indicators from a large amount of acquired hardware information. The target hardware information corresponds to the hardware specifications; The identification of the sensor version corresponding to the hardware specifications includes: Using the aforementioned hardware specifications, the target sensor to be used is determined; Obtain the sensor version of the target sensor from the baseboard management controller; The step of filtering target hardware information from the hardware information using the matching rules includes: performing regular expression matching on the hardware information based on the matching rules to filter out the target hardware information.
2. The information collection method according to claim 1, characterized in that, The execution of the acquisition command to obtain hardware information includes: Send the acquisition command to the target sensor; Receive the hardware information fed back by the target sensor.
3. The information collection method according to claim 1, characterized in that, Also includes: The target hardware information is periodically sent to the management node.
4. The information collection method according to claim 1, characterized in that, Also includes: The target hardware information is displayed in the visual interface of the management software.
5. The information collection method according to any one of claims 1 to 4, characterized in that, Also includes: Get new collection instructions and / or new matching rules; The database is updated using the new acquisition instructions and / or the new matching rules.
6. An information acquisition device, characterized in that, include: The identification module is used to receive a collection request, determine the hardware indicators to be collected, and identify the sensor version corresponding to the hardware indicators. The search module is used to query the database for the corresponding acquisition instructions and matching rules using the hardware specifications and the sensor version. The acquisition module is used to execute the acquisition instructions to obtain hardware information; The filtering module is used to filter out target hardware information from the hardware information using the matching rules; The acquisition command is the instruction that needs to be executed to enable the sensor to acquire hardware information; the matching rule corresponds to how to identify the specific meaning of each piece of information from a large amount of acquired hardware information, and to complete the screening of information that corresponds to the hardware indicators from a large amount of acquired hardware information; the target hardware information corresponds to the hardware indicators. Specifically, the identification module is used to determine the target sensor to be used using the hardware indicators; and to obtain the sensor version of the target sensor from the baseboard management controller. The filtering module is specifically used to perform regular expression matching on the hardware information based on the matching rules to filter out the target hardware information.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the information acquisition method as described in any one of claims 1 to 5 when executing the computer program.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the information acquisition method as described in any one of claims 1 to 5.