Hardware information inspection method and device, equipment and medium

By copying the tool catalog on each node in the distributed storage cluster and issuing inspection commands using multiple threads, the problem of cumbersome, time-consuming and easy to miss hardware information inspection in the prior art is solved, and fast and accurate hardware information inspection is achieved, improving efficiency and accuracy.

CN119718839APending Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202412000350.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art when checking distributed storage cluster hardware information, the methods are cumbersome, time-consuming and easy to miss inspection items, resulting in potential risks.

Method used

Through the preset inspection tool, copy the tool directory on each node in the distributed storage cluster, and use multiple threads to issue hardware information inspection commands at the same time. Each node conducts hardware information inspection based on the local tool directory and target inspection files, generates inspection reports and filters out hardware information that does not meet the expected results.

Benefits of technology

It realizes rapid, accurate and effective inspection of all hardware information of each device in the distributed storage cluster, shortens inspection time, improves efficiency and accuracy, and reduces the omission of inspection items.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718839A_ABST
    Figure CN119718839A_ABST
Patent Text Reader

Abstract

The invention discloses a hardware information checking method and device, equipment and a medium, and relates to the technical field of computers, the hardware information checking method and device are applied to a preset checking tool, the preset checking tool is located at any node in a distributed storage cluster, and the hardware information checking method comprises the steps that after a tool is started, a local tool directory is copied to a target directory of other nodes in the cluster; the tool directory is used for storing file information required when the preset detection tool executes hardware information checking operation; after copying is completed, a corresponding number of threads are started according to the number of the nodes in the cluster, and hardware information checking commands are issued to all the nodes at the same time through different threads, so that all the nodes check local hardware information according to a tool directory under a local target directory and a pre-configured target checking file; and obtaining the inspection report generated by each node after the inspection is completed, screening out the target hardware information which does not meet the expected inspection result, and sending the target hardware information to the target client for confirmation, thereby improving the inspection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a hardware information checking method, device, equipment and medium. Background Art

[0002] Before deploying and installing a distributed storage cluster, you need to check whether all the hardware information of the cluster devices meets the requirements and whether there are any potential problems with the hardware, such as incorrect models and versions, or the presence of slow disks or optical attenuation on network ports.

[0003] Currently, cluster hardware information is generally checked by logging into each device and executing the relevant view commands to check and collect information. However, it is troublesome and time-consuming to manually execute different commands to check all hardware information one by one. At the same time, there will be omissions in the inspection items, leaving unknown risks for subsequent testing or business launch. Moreover, operators who are not familiar with commands need to obtain many inspection commands and execute them one by one, which is more time-consuming and cumbersome.

[0004] In summary, how to quickly, accurately and effectively check all hardware information of each device in a distributed storage cluster is a problem that needs to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a hardware information checking method, device, equipment and medium, which can quickly, accurately and effectively check all hardware information of each device in a distributed storage cluster. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a hardware information inspection method, which is applied to a preset inspection tool, and the preset inspection tool is located at any node in a distributed storage cluster. The method includes:

[0007] After the preset inspection tool is started, a directory copy operation is performed to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation;

[0008] After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so as to simultaneously send hardware information check commands to each node through different threads, so that each node can check the local hardware information according to the tool directory and the pre-configured target check file under the local target directory;

[0009] The inspection report generated by each node after the inspection of the local hardware information is completed is obtained, and the target hardware information that does not meet the expected inspection result is filtered out from the inspection report, so as to send the target hardware information to the target client for confirmation.

[0010] Optionally, the hardware information checking method of the present application further includes:

[0011] Pre-configure different target inspection files according to different device models of each node in the distributed storage cluster, and copy the target inspection files to the target directory of the corresponding node; wherein the target inspection files include each hardware inspection item to be inspected, and the inspection method and expected inspection result corresponding to each hardware inspection item;

[0012] Accordingly, each node checks the local hardware information according to the tool directory and pre-configured target check files in the local target directory, including:

[0013] Each node checks each hardware inspection item in turn according to the inspection method recorded in the tool directory and the target inspection file under the local target directory to obtain the actual inspection result;

[0014] The actual inspection result is compared with the corresponding expected inspection result through each node. If the actual inspection result is consistent with the expected inspection result, the result flag bit of the corresponding hardware inspection item in the inspection report is set to the first value; if the actual inspection result is inconsistent with the expected inspection result, the result flag bit of the corresponding hardware inspection item in the inspection report is set to the second value;

[0015] Accordingly, the target hardware information that does not meet the expected inspection results is screened out from the inspection report, including:

[0016] Hardware detection items whose result flag bits are the second value are screened out from the inspection report as target hardware information that does not meet the expected inspection result.

[0017] Optionally, hardware information check commands are sent to each node simultaneously through different threads, including:

[0018] Determine the target information of the corresponding target inspection file according to the device model of each node;

[0019] A hardware information inspection command is constructed based on the target information, the first file name of the inspection report to be generated, and the second file name of the log file to be generated, so as to simultaneously send the corresponding hardware information inspection command to each node through different threads.

[0020] Optionally, the hardware inspection items include a first inspection item corresponding to the mainboard, a second inspection item corresponding to the basic input / output system, a third inspection item corresponding to the baseboard management controller, a fourth inspection item corresponding to the central processing unit, and a fifth inspection item corresponding to the memory; wherein, the first inspection item includes the firmware version of the complex programmable logic device, the second inspection item includes the firmware version and firmware release date of the basic input / output system, the third inspection item includes the firmware version of the baseboard management controller, the fourth inspection item includes the manufacturer information, maximum frequency value, current frequency value, number of cores and model of the central processing unit, and the fifth inspection item includes the manufacturer information, capacity, model, maximum main frequency and current main frequency of the memory.

[0021] Optionally, before copying the local tool directory to the target directories of other nodes in the distributed storage cluster, the following steps are also required:

[0022] Obtain node configuration files of all nodes in the distributed storage cluster, and generate a node information list based on all node configuration files; wherein the node information list records the network address, user name and login password of each node;

[0023] Accordingly, copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster, including:

[0024] Based on the network addresses of the remaining nodes in the distributed storage cluster recorded in the node information list, the target copy command is used to copy the local tool directory to the target directory of the remaining nodes.

[0025] Optionally, hardware information check commands are sent to each node simultaneously through different threads, including:

[0026] For each target node in the distributed storage cluster, determine the target network address, target user name and target login password of the target node from the node information list;

[0027] The target network address, target user name, target login password and hardware information check command are passed as target parameters to the thread function corresponding to the target node, so that the corresponding target parameters are simultaneously passed to each node through each thread function.

[0028] Optionally, use the target copy command to copy the local tool directory to the target directories of other nodes, including:

[0029] Determine a first path where the tool directory is located on the current node, and determine a second path where the target directory is located in each of the remaining nodes, so as to construct a target copy command based on the first path, the second path, and the network addresses of each of the remaining nodes;

[0030] Based on the target copy command, the local tool directory is copied to the target directory of the remaining nodes, and the success of the copy is determined according to the command return value. If the command return value is zero, the copy is determined to be successful, and if the command return value is not zero, the copy is determined to have failed.

[0031] If the copy is determined to be successful based on the command return value, the process jumps to the step of starting a corresponding number of threads according to the number of nodes in the distributed storage cluster.

[0032] In a second aspect, the present application discloses a hardware information inspection device, which is applied to a preset inspection tool, and the preset inspection tool is located at any node in a distributed storage cluster. The device includes:

[0033] A directory copy module, used to perform a directory copy operation after the preset inspection tool is started, so as to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; wherein the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation;

[0034] A command issuing module is used to start a corresponding number of threads according to the number of nodes in the distributed storage cluster after the directory copy operation is completed, so as to simultaneously issue hardware information check commands to each node through different threads, so that each node can check the local hardware information according to the tool directory and the pre-configured target check file under the local target directory;

[0035] The result acquisition module is used to obtain the inspection report generated by each node after the local hardware information is inspected, and filter out the target hardware information that does not meet the expected inspection result from the inspection report, so as to send the target hardware information to the target client for confirmation.

[0036] In a third aspect, the present application discloses an electronic device, comprising:

[0037] Memory, used to store computer programs;

[0038] The processor is used to execute a computer program to implement the steps of the aforementioned disclosed hardware information checking method.

[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed hardware information checking method are implemented.

[0040] It can be seen that the present application discloses a hardware information inspection method applied to a preset inspection tool, wherein the preset inspection tool is located at any node in a distributed storage cluster, and the preset inspection tool performs a directory copy operation after its own startup is completed, so as to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; wherein the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation; after the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so as to simultaneously issue hardware information inspection commands to each node through different threads, so that each node can inspect the local hardware information according to the tool directory and the pre-configured target inspection file under the local target directory; obtain the inspection report generated by each node after the inspection of the local hardware information is completed, and filter out the target hardware information that does not meet the expected inspection results from the inspection report, so as to send the target hardware information to the target client for confirmation.

[0041] Beneficial effect: The present application discloses a preset inspection tool, which can be located at any node in a distributed storage cluster. First, after the preset inspection tool itself is started, it is necessary to perform a target copy operation to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster. The tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation, thereby ensuring that each node can obtain the tool directory to have an environment for performing hardware information inspection. After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster to simultaneously issue hardware information inspection commands to each node through different threads, so that all nodes execute the hardware information inspection command at the same time, that is, all nodes check the local hardware information according to the tool directory and the pre-configured target inspection file under the local target directory, thereby effectively reducing the total time consumed by all nodes to complete the inspection of all hardware in series. Finally, the inspection report generated by each node after the inspection of the local hardware information is completed is obtained, and the target hardware information that does not meet the expected inspection results is filtered out from the inspection report, so that the target hardware information is sent to the target client for confirmation. In this way, the preset inspection tool of this application can quickly, accurately and effectively check all hardware information of all devices in the cluster. Especially when the number of devices is large, the time spent can be shortened to the time spent on checking only one device, which effectively improves the inspection efficiency. At the same time, it also improves the accuracy compared to manual inspection and reduces the omission of inspection items. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A flowchart of a hardware information checking method disclosed in this application;

[0044] Figure 2 A schematic diagram of a code for issuing multi-threaded commands disclosed in this application;

[0045] Figure 3 A flowchart of a specific hardware information checking method disclosed in this application;

[0046] Figure 4 A schematic diagram of a hardware information checking process disclosed in this application;

[0047] Figure 5 This is a schematic diagram of some inspection items in a CSV file disclosed in this application;

[0048] Figure 6 A schematic diagram of the structure of a hardware information checking device disclosed in this application;

[0049] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 making creative work are within the scope of protection of the present invention.

[0051] Currently, cluster hardware information is generally checked by logging into each device and executing the relevant view commands to check and collect information. However, it is troublesome and time-consuming to manually execute different commands to check all hardware information one by one. At the same time, there will be omissions in the inspection items, leaving unknown risks for subsequent testing or business launch. Moreover, operators who are not familiar with commands need to obtain many inspection commands and execute them one by one, which is more time-consuming and cumbersome.

[0052] To this end, the embodiments of the present application disclose a hardware information checking method, apparatus, device and medium, which can quickly, accurately and effectively check all hardware information of each device in a distributed storage cluster.

[0053] See also Figure 1 As shown, an embodiment of the present application discloses a hardware information inspection method, which is applied to a preset inspection tool, and the preset inspection tool is located at any node in a distributed storage cluster. The method includes:

[0054] Step S11: After the preset inspection tool is started, a directory copy operation is performed to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation.

[0055] This embodiment discloses a preset inspection tool, which can be located at any node in a distributed storage cluster. First, after the preset inspection tool itself is started, it is necessary to perform a target copy operation to automatically copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster. The tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation, thereby ensuring that each node can obtain the tool directory to have an environment for performing hardware information inspection. It should be pointed out that when each node subsequently performs the hardware information inspection operation, it is performed in the corresponding target directory.

[0056] In a specific implementation, before copying the local tool directory to the target directory of the remaining nodes in the distributed storage cluster, it also includes: obtaining the node configuration files of all nodes in the distributed storage cluster, and generating a node information list based on all node configuration files; wherein the node information list records the network address, user name and login password of each node. It can be understood that the present application needs to first generate a node information list (recorded as host_list) according to the node configuration files of all nodes in the distributed storage cluster, and the node information list records the network address (IP address), user name and login password of each node. Among them, the IP address is used to identify each node in the cluster, and the tool finds the corresponding node through these IP addresses and establishes a connection with it, so as to execute the hardware information check command on the node; the user name represents the user name required to log in to the node, ensuring that the tool has the authority to access the node in order to obtain hardware information; the password refers to the password corresponding to the user name, which is used to verify the tool's operating authority on the node to ensure the safe acquisition of hardware information.

[0057] Therefore, in actual situations, the preset inspection tool may be located at a specific node in the distributed storage cluster, and the specific node may be selected from the distributed storage cluster in advance according to preset node selection requirements. Among them, the preset node selection requirements may include the following conditions: 1. Access to configuration file permissions: Ability to access configuration files of all nodes in the cluster in order to generate host_list; 2. Ability to execute tools: Possess the environment and permissions to execute the tool, including but not limited to the operating system and software dependencies required for operation, so as to ensure that the tool can be started normally on the node and perform various operations according to the predetermined process; 3. Network connectivity: Have a good network connection and be able to communicate with other nodes in the cluster to copy the tool directory and send inspection commands to other nodes; 4. Load requirements: Since the inspection tool needs to be run additionally on the node, sufficient computer resources are required, including CPU usage, remaining memory space, and remaining disk space, etc. For example, if there are some nodes in the cluster that simultaneously undertake a large amount of data storage and processing tasks, and their CPU usage is high for a long time, then such nodes may not be suitable as nodes for executing tools, so as to avoid slow operation or even errors of the tool due to insufficient resources; and sufficient memory is also required to store temporary data during the operation of the tool, cache inspection results, and load related programs and library files. If the node memory is close to saturation, it may affect the normal operation of the tool, such as memory overflow errors when processing a large amount of hardware information data. In addition, there must be enough disk space to store the tool directory and the log files and test reports it may generate. Especially when the tool is used for a long time to perform multiple hardware inspections, these files may take up a certain amount of disk space. If the node storage resources are tight, it may cause file storage failure or affect system performance.

[0058] Furthermore, when copying the local tool directory to the target directory of the remaining nodes in the distributed storage cluster, it can specifically include: based on the network addresses of the remaining nodes in the distributed storage cluster recorded in the node information list, using the target copy command to copy the local tool directory to the target directory of the remaining nodes. That is, in the process of copying the tool directory to other nodes in the cluster, the application needs to copy the tool directory from the current node to the specified directory of other nodes based on the node IP address in the host_list, and use the target copy command, that is, the scp-r command, to ensure that each node has the tools and environment required to perform hardware information checks. For example, by traversing the host_list and performing a copy operation on each node.

[0059] In a specific implementation, a target copy command is used to copy a local tool directory to a target directory of each of the remaining nodes, including: determining a first path where the tool directory is located on the current node, and determining a second path where the target directory is located in each of the remaining nodes, so as to construct a target copy command based on the first path, the second path, and the network addresses of the remaining nodes; based on the target copy command, the local tool directory is copied to the target directory of each of the remaining nodes, and whether the copy is successful is determined based on the command return value; wherein, if the command return value is zero, the copy is determined to be successful, and if the command return value is not zero, the copy is determined to have failed; if the copy is determined to be successful based on the command return value, then jump to the step of starting a corresponding number of threads based on the number of nodes in the distributed storage cluster.

[0060] That is, this application needs to determine the source path where the tool directory on the current node is located, also known as the first path "currentpath", and determine the target path where the target directory in each of the remaining nodes is located, also known as the second path "remotepath", so as to construct the copy command os.system("scp -r %s %s:\%s " % (currentpath,ip,remotepath)). After executing the command, the system will return a command return value. If the command return value is 0, it means that the copy is successful, and print("scp -r %s %s:\%s successed. " % (currentpath,ip,remotepath)) will be executed to print out the copy success information, which includes detailed information such as the source path, the IP address of the target node, and the target path. If the returned result is not 0, it indicates that an error occurred during the copy process, which may be caused by network connection problems, insufficient target node permissions, or non-existence of the target path. In this case, print("scp -r %s %s:\%sfailed. " % (currentpath, ip, remotepath)) will be executed to print out the copy failure information, which also includes relevant path information to facilitate troubleshooting.

[0061] Step S12: After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so as to simultaneously send hardware information check commands to each node through different threads, so that each node can check the local hardware information according to the tool directory under the local target directory and the pre-configured target check file.

[0062] In this embodiment, after the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so that hardware information check commands are simultaneously issued to each node through different threads, so that all nodes execute the hardware information check command at the same time, that is, the node where the preset inspection tool is located and all other nodes simultaneously check the local hardware information according to the tool directory under the local target directory and the pre-configured target inspection file, thereby effectively reducing the total time taken for all nodes to complete the serial inspection of all hardware.

[0063] In a specific implementation, hardware information check commands are sent to each node simultaneously through different threads, including: for each target node in the distributed storage cluster, the target network address, target user name and target login password of the target node are determined from the node information list; the target network address, target user name, target login password and hardware information check command are passed as target parameters to the thread function corresponding to the target node, so that the corresponding target parameters are passed to each node simultaneously through each thread function. Figure 2 As shown in the figure, the preset inspection tool needs to use multi-threading technology to send hardware information inspection commands to multiple nodes at the same time based on the node information in host_list. Among them, each thread corresponds to a node, and threads are created through threading.Thread, and the target IP address, target user name, target login password and command to be executed of each target node are passed as parameters to the thread function (such as getConnection), so that all nodes can execute hardware information inspection commands at the same time, effectively reducing the total time consumed by all nodes to complete the serial inspection of all hardware.

[0064] Step S13: obtaining the inspection report generated by each node after completing the inspection of the local hardware information, and filtering out the target hardware information that does not meet the expected inspection result from the inspection report, so as to send the target hardware information to the target client for confirmation.

[0065] In this embodiment, the inspection report generated by each node after the local hardware information is checked is obtained, and the target hardware information that does not meet the expected inspection results is screened out from the inspection report, so that the target hardware information is sent to the target client for confirmation. In this way, the preset inspection tool of this application can quickly, accurately and effectively check all the hardware information of all devices in the cluster. Especially when the number of devices is large, the time spent can be shortened to the time spent on checking only one device, which effectively improves the inspection efficiency. At the same time, it also improves the accuracy compared to manual inspection and reduces the omission of inspection items.

[0066] It can be seen that the present application discloses a preset inspection tool, which can be located at any node in a distributed storage cluster. First, after the preset inspection tool is started, a target copy operation needs to be performed to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster. The tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation, thereby ensuring that each node can obtain the tool directory to have an environment for performing hardware information inspection. When the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster to simultaneously issue hardware information inspection commands to each node through different threads, so that all nodes execute the hardware information inspection command at the same time, that is, all nodes check the local hardware information according to the tool directory under the local target directory and the pre-configured target inspection file, thereby effectively reducing the total time consumed by all nodes to complete the inspection of all hardware in series. Finally, the inspection report generated by each node after the inspection of the local hardware information is completed, and the target hardware information that does not meet the expected inspection results is screened out from the inspection report, so that the target hardware information is sent to the target client for confirmation. In this way, the preset inspection tool of this application can quickly, accurately and effectively check all hardware information of all devices in the cluster. Especially when the number of devices is large, the time spent can be shortened to the time spent on checking only one device, which effectively improves the inspection efficiency. At the same time, it also improves the accuracy compared to manual inspection and reduces the omission of inspection items.

[0067] See also Figure 3 and Figure 4 As shown, the embodiment of the present application discloses a specific method for checking hardware information. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0068] Step S21: After the preset inspection tool is started, a directory copy operation is performed to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation.

[0069] Step S22: After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so as to simultaneously send hardware information check commands to each node through different threads.

[0070] In this embodiment, when sending hardware information inspection commands to each node at the same time through different threads, it specifically includes: determining the target information of the corresponding target inspection file according to the device model of each node; constructing a hardware information inspection command based on the target information, the first file name of the inspection report to be generated, and the second file name of the log file to be generated, so as to send the corresponding hardware information inspection command to each node at the same time through different threads. In this embodiment, the target inspection file is specifically a file in CSV (Comma-Separated Values, comma separated value file) format. It can be understood that when sending the hardware information inspection command, since the target inspection files used by different models are different, it is also necessary to specify the use of the CSV file of the corresponding model, so that the tool performs the inspection operation according to the CSV file matching the model, ensuring the accuracy and pertinence of the inspection, and specifying the directory and file name of the inspection report and log file to be generated. That is, the Command parameter should contain this information, such as sh CM2020file_FW.sh cfg_model_HS12-kuai_dp2.csv log / 1.csv log / 1.log. cfg_model_HS12 - kuai_dp2.csv is the specified model CSV file, log / 1.csv and log / 1.log are the directories and file names of the specified inspection report and log files respectively.

[0071] Step S23: Each node checks each hardware inspection item in turn according to the inspection method recorded in the tool directory and the target inspection file under the local target directory to obtain the actual inspection result.

[0072] It should be pointed out that the hardware information inspection method of the present application also includes: pre-configuring different target inspection files according to the different device models of each node in the distributed storage cluster, and copying the target inspection files to the target directory of the corresponding node; wherein the target inspection file includes each hardware inspection item to be inspected, and the inspection method and expected inspection result corresponding to each hardware inspection item. That is, the present application needs to prepare in advance the hardware inspection items corresponding to the different models of devices in the distributed storage cluster, as well as the inspection method and expected inspection result corresponding to each hardware inspection item, and input them into the CSV file of the corresponding device, and copy them to the target directory. It is understandable that different models of devices need to list all hardware inspection items, as well as the corresponding inspection methods and expected inspection results in different CSV files in a specified format. For example, the method to check the optical attenuation of the optical module on each device is:

[0073] cat . / log / ethernet.log | grep "Receiver signal average optical power"| grep -oP '(-?\d+\.\d+)\s*dBm' | awk '{if ($1 > -3) print "Light Attenuation>-3dBm:" $1;else print "Light Attenuation<-3dBm:" $1}'|grep "Light Attenuation>-3dBm"|wc -l_;

[0074] The expected result is: 4_.

[0075] Figure 5 Some of the inspection items in the CSV file of a certain device model disclosed in this application. Figure 5 As shown in , the hardware inspection items may specifically include a first inspection item corresponding to the motherboard, a second inspection item corresponding to the Basic Input Output System (BIOS), a third inspection item corresponding to the Baseboard Management Controller (BMC), a fourth inspection item corresponding to the Central Processing Unit (CPU), and a fifth inspection item corresponding to the Memory; wherein the first inspection item includes but is not limited to the firmware version of the complex programmable logic device, the second inspection item includes but is not limited to the firmware version and firmware release date of the basic input output system, the third inspection item includes but is not limited to the firmware version of the baseboard management controller, the fourth inspection item includes but is not limited to the manufacturer information, maximum frequency value, current frequency value, number of cores and model of the central processing unit, and the fifth inspection item includes but is not limited to the manufacturer information, capacity, model, maximum main frequency and current main frequency of the memory.

[0076] It should be pointed out that other models of equipment can add corresponding CSV files to add the hardware information methods and expected inspection results that need to be checked. It can be compatible with and add various devices and inspection items, and there are no specification restrictions on device models and inspection item types.

[0077] Therefore, in this embodiment, the corresponding hardware information check script is executed on each node, and each hardware check item is checked one by one according to the tool directory under the local target directory and the check method of each hardware information in the corresponding model CSV file, and the actual check result is obtained. Specifically, the hardware information obtained from the actual check result can be recorded in detail in the log file, which is convenient for subsequent viewing and identification and modification of items that do not meet the expected results.

[0078] Step S24: Compare the actual inspection result with the corresponding expected inspection result through each node. If the actual inspection result is consistent with the expected inspection result, the result flag of the corresponding hardware inspection item in the inspection report is set to the first value. If the actual inspection result is inconsistent with the expected inspection result, the result flag of the corresponding hardware inspection item in the inspection report is set to the second value.

[0079] In this embodiment, each node compares the actual inspection result with the corresponding expected inspection result. If the actual inspection result is consistent with the expected inspection result, the result flag of the corresponding hardware inspection item in the output inspection report is set to the first value OK. If the actual inspection result is inconsistent with the expected inspection result, the result flag of the corresponding hardware inspection item in the output inspection report is set to the second value ERR.

[0080] In addition, the non-system built-in tools required for the execution of different inspection items will also be placed in the specified target directory in advance, and the tool version can be added or updated according to the needs of the inspection items. Different versions of tools are used for different models of equipment, so pay attention to name partitioning, otherwise the query may fail.

[0081] Step S25: Obtain the inspection report generated by each node after completing the inspection of the local hardware information, and filter out the hardware detection items whose result flag is the second value from the inspection report as the target hardware information that does not meet the expected inspection result, so as to send the target hardware information to the target client for confirmation.

[0082] In this embodiment, a full inspection report is generated after each node is inspected, and the executed logs are analyzed to list the hardware information that does not meet expectations, that is, the hardware detection with the result flag bit ERR is screened out, and the corresponding inspection method and the currently queried hardware information are listed to facilitate subsequent version updates and re-inspection and confirmation.

[0083] For more specific processing procedures of the above steps S21 and S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0084] It can be seen that the present application discloses a tool that can automatically and quickly log in to all nodes of the cluster through multi-threading to obtain all hardware information and check whether it meets expectations. The tool is compatible with the inspection methods and expected results of different hardware of various models, and can continuously increase or update the items that need to be inspected in the models and new models according to the increase or update of product models in the future. After the inspection is completed, the inspection report can be output, and the items whose hardware information does not meet expectations are listed separately, and the inspection method and query results are displayed for subsequent confirmation inspection and refresh. Through the above scheme, all hardware information of all devices in the cluster can be checked quickly, accurately and effectively. Especially when the number of devices is large, the time consumed can be shortened to the time consumed by querying only one device, which effectively improves the inspection efficiency. At the same time, it also improves the accuracy compared with manual inspection, reduces the omission of inspection items, avoids the problem of incorrect hardware models or incorrect version information left behind, and ensures the correctness of hardware equipment and versions for subsequent testing or project delivery.

[0085] See also Figure 6 As shown, the embodiment of the present application discloses a hardware information inspection device, which is applied to a preset inspection tool, and the preset inspection tool is located at any node in a distributed storage cluster. The device includes:

[0086] The directory copy module 11 is used to perform a directory copy operation after the preset inspection tool is started, so as to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; wherein the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation;

[0087] The command issuing module 12 is used to start a corresponding number of threads according to the number of nodes in the distributed storage cluster after the directory copy operation is completed, so as to simultaneously issue hardware information check commands to each node through different threads, so that each node can check the local hardware information according to the tool directory and the pre-configured target check file under the local target directory;

[0088] The result acquisition module 13 is used to obtain the inspection report generated by each node after completing the inspection of the local hardware information, and filter out the target hardware information that does not meet the expected inspection result from the inspection report, so as to send the target hardware information to the target client for confirmation.

[0089] It can be seen that the present application discloses a preset inspection tool, which can be located at any node in a distributed storage cluster. First, after the preset inspection tool itself is started, it is necessary to perform a target copy operation to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster. The tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation, thereby ensuring that each node can obtain the tool directory to have an environment for performing hardware information inspection. After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster to simultaneously issue hardware information inspection commands to each node through different threads, so that all nodes execute the hardware information inspection command at the same time, that is, all nodes check the local hardware information according to the tool directory and the pre-configured target inspection file under the local target directory, thereby effectively reducing the total time consumed by all nodes to complete the inspection of all hardware in series. Finally, the inspection report generated by each node after the inspection of the local hardware information is completed, and the target hardware information that does not meet the expected inspection results is screened out from the inspection report, so that the target hardware information is sent to the target client for confirmation. In this way, the preset inspection tool of this application can quickly, accurately and effectively check all hardware information of all devices in the cluster. Especially when the number of devices is large, the time spent can be shortened to the time spent on checking only one device, which effectively improves the inspection efficiency. At the same time, it also improves the accuracy compared to manual inspection and reduces the omission of inspection items.

[0090] Since the embodiments of the device part and the embodiments of the method part correspond to each other, the embodiments of the device part refer to the description of the embodiments of the method part, which will not be described here. And, it has the same beneficial effects as the hardware information checking method mentioned above.

[0091] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the hardware information checking method performed by the electronic device disclosed in any of the aforementioned embodiments.

[0092] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0093] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0094] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0095] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the hardware information inspection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0096] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the hardware information checking method disclosed in any of the aforementioned embodiments are implemented.

[0097] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the hardware information checking method disclosed in any of the aforementioned embodiments.

[0098] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0099] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0100] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0101] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0102] The above is a detailed introduction to a hardware information checking method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for checking hardware information, characterized in that: Applied to a preset inspection tool, the preset inspection tool is located at any node in a distributed storage cluster, the method includes: After the preset inspection tool is started, a directory copy operation is performed to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; wherein the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation; After the directory copy operation is completed, a corresponding number of threads are started according to the number of nodes in the distributed storage cluster, so as to simultaneously send hardware information check commands to each node through different threads, so that each node can check the local hardware information according to the tool directory and the pre-configured target check file under the local target directory; The inspection report generated by each node after the inspection of the local hardware information is completed is obtained, and the target hardware information that does not meet the expected inspection result is screened out from the inspection report, so as to send the target hardware information to the target client for confirmation.

2. The method for checking hardware information according to claim 1, characterized in that: Also includes: Pre-configure different target inspection files according to different device models of each node in the distributed storage cluster, and copy the target inspection files to the target directory of the corresponding node; wherein the target inspection files include each hardware inspection item to be inspected, and the inspection method and expected inspection result corresponding to each hardware inspection item; Accordingly, the checking of the local hardware information by each node according to the tool directory and the pre-configured target check file under the local target directory includes: Each node checks each of the hardware inspection items in turn according to the inspection method recorded in the tool directory and the target inspection file under the local target directory to obtain an actual inspection result; By comparing the actual inspection result with the corresponding expected inspection result through each node, if the actual inspection result is consistent with the expected inspection result, the result flag bit of the corresponding hardware inspection item in the inspection report is set to the first value; if the actual inspection result is inconsistent with the expected inspection result, the result flag bit of the corresponding hardware inspection item in the inspection report is set to the second value; Accordingly, the step of filtering out target hardware information that does not meet the expected inspection result from the inspection report includes: The hardware detection items whose result flag is the second value are filtered out from the inspection report as target hardware information that does not meet the expected inspection result.

3. The method for checking hardware information according to claim 2, characterized in that: The sending of hardware information check commands to each node simultaneously through different threads includes: Determine the target information of the corresponding target inspection file according to the device model of each node; A hardware information inspection command is constructed based on the target information, a first file name of the inspection report to be generated, and a second file name of the log file to be generated, so as to simultaneously send the corresponding hardware information inspection command to each node through different threads.

4. The method for checking hardware information according to claim 2, characterized in that: The hardware inspection items include a first inspection item corresponding to the mainboard, a second inspection item corresponding to the basic input / output system, a third inspection item corresponding to the baseboard management controller, a fourth inspection item corresponding to the central processing unit, and a fifth inspection item corresponding to the memory; wherein, the first inspection item includes the firmware version of the complex programmable logic device, the second inspection item includes the firmware version and the firmware release date of the basic input / output system, the third inspection item includes the firmware version of the baseboard management controller, the fourth inspection item includes the manufacturer information, maximum frequency value, current frequency value, number of cores and model of the central processing unit, and the fifth inspection item includes the manufacturer information, capacity, model, maximum main frequency and current main frequency of the memory.

5. The hardware information checking method according to any one of claims 1 to 4, characterized in that: Before copying the local tool directory to the target directories of the remaining nodes in the distributed storage cluster, the method further includes: Obtaining node configuration files of all nodes in the distributed storage cluster, and generating a node information list based on all the node configuration files; wherein the node information list records the network address, user name and login password of each node; Accordingly, copying the local tool directory to the target directory of the remaining nodes in the distributed storage cluster includes: Based on the network addresses of the remaining nodes in the distributed storage cluster recorded in the node information list, the local tool directory is copied to the target directory of the remaining nodes using the target copy command.

6. The method for checking hardware information according to claim 5, characterized in that: The sending of hardware information check commands to each node simultaneously through different threads includes: For each target node in the distributed storage cluster, determine the target network address, target user name and target login password of the target node from the node information list; The target network address, the target user name, the target login password and the hardware information check command are passed as target parameters to the thread function corresponding to the target node, so that the corresponding target parameters are simultaneously passed to each node through each thread function.

7. The method for checking hardware information according to claim 5, characterized in that: The target copy command is used to copy the local tool directory to the target directory of other nodes, including: Determine a first path where the tool directory is located on the current node, and determine a second path where the target directory is located in each of the remaining nodes, so as to construct a target copy command based on the first path, the second path, and the network addresses of the remaining nodes; Based on the target copy command, the local tool directory is copied to the target directories of the remaining nodes, and whether the copy is successful is determined according to the command return value; if the command return value is zero, the copy is determined to be successful, and if the command return value is not zero, the copy is determined to be unsuccessful; If the copy is determined to be successful based on the command return value, the process jumps to the step of starting a corresponding number of threads according to the number of nodes in the distributed storage cluster.

8. A hardware information checking device, characterized in that: Applied to a preset inspection tool, the preset inspection tool is located at any node in a distributed storage cluster, and the device includes: A directory copy module, used to perform a directory copy operation after the preset inspection tool is started, so as to copy the local tool directory to the target directory of the remaining nodes in the distributed storage cluster; wherein the tool directory is used to store the file information required by the preset detection tool when performing the hardware information inspection operation; A command issuing module, configured to start a corresponding number of threads according to the number of nodes in the distributed storage cluster after the directory copy operation is completed, so as to simultaneously issue hardware information checking commands to each node through different threads, so that each node can check the local hardware information according to the tool directory and the pre-configured target checking file under the local target directory; The result acquisition module is used to obtain the inspection report generated by each node after completing the inspection of the local hardware information, and filter out the target hardware information that does not meet the expected inspection result from the inspection report, so as to send the target hardware information to the target client for confirmation.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the hardware information checking method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the hardware information checking method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Hard disk detection method, device and equipment based on linux system

    CN109213650A

  • Inspection and processing device and method based on distributed storage cluster, equipment and medium

    CN115328730A

  • Cluster security check method, apparatus and device, and storage medium

    CN116962260A

  • Operation environment inspection method and device of distributed storage system, equipment and medium

    CN117667598A