Server hardware information acquisition method and system
By calling the server API interface to obtain hardware information regularly, calculate health index and abnormality, it realizes automatic acquisition of server hardware status, solves the problem of cumbersome information acquisition in the existing technology, and improves efficiency and acquisition speed.
Patent Information
- Application Number
- CN202510093573.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art requires logging into an off-tape page when obtaining server hardware information, and manual integration is required. The steps are cumbersome and inefficient when encountering a large number of servers.
The hardware information is obtained regularly by calling the server's API interface, the hardware health index is calculated, and the abnormality is calculated based on historical data, and an alarm is issued when the abnormality exceeds the threshold.
It realizes automatic acquisition of server hardware status, reduces manpower investment, improves work efficiency, fast acquisition speed, and supports batch operations, which is easy to store and debug.
Smart Images

Figure CN119961098A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet, and in particular to a method and system for collecting server hardware information. Background Art
[0002] Currently, to obtain information from a server, you need to log in to its out-of-band page and check it through a web page. Common tools use call interfaces to obtain information, but the CPU model, frequency, and brand need to be checked on a specified page. The number and size of memory sticks also need to be counted in detail before they can be obtained, and the health status of the hardware also needs to be viewed on the HDM page. Common methods include pages, software, and commands.
[0003] To check the status of server hardware in the form of an out-of-band page, you need to log in and find the location of the corresponding hardware to obtain information. It also needs to be manually integrated, and the steps are cumbersome when encountering a large number of servers. Summary of the invention
[0004] To achieve the above purpose and other related purposes, the present invention discloses a method for collecting server hardware information, comprising: Call the server's API interface to periodically obtain the server's hardware information; Get the health index of hardware information according to the hardware information; The degree of abnormality is calculated based on historical data, and an alarm is issued when the degree of abnormality exceeds the set threshold.
[0005] Furthermore, the periodic acquisition of hardware information of the server hardware includes: Set the collection cycle based on the reference cycle and current time, including: Tf=Tb×e^(-k×U)×(1+ω×sin(πt / 24)); Among them: Tf is the final collection cycle; Tb is the benchmark cycle; k is the urgency adjustment factor; U is the equipment utilization rate; ω is the daily cycle fluctuation range; t is the current hour.
[0006] Furthermore, the health index of the hardware information obtained according to the hardware information includes: H = Σ(Wi × Si) / n; Among them: H is the comprehensive health of the hardware; Wi is the weight coefficient of each indicator; Si is the score of a single indicator; n is the total number of indicators.
[0007] Furthermore, the calling of the server API interface to periodically obtain the hardware information of the server hardware includes: Enter the server's out-of-band IP address in the txt text box that requires input information; Use the open module in Python to open and read files, and then call them in batches after splicing API interfaces; Convert the data into a dictionary in json text format, and obtain the location of the server hardware and the corresponding hardware information through the key value of the dictionary.
[0008] Furthermore, the abnormality degree calculated according to the historical data includes: A=(1-e^(-γ×∑Vi))×(1+μ×M); Among them: A is the comprehensive anomaly; γ is the sensitivity adjustment coefficient; Vi is the variability of each dimension; μ is the historical anomaly impact factor; M is the historical anomaly cumulative value.
[0009] On the other hand, the present invention also provides a server hardware information collection system, comprising: The hardware information acquisition module is used to call the server's API interface to periodically obtain the hardware information of the server hardware; A health index calculation module is used to obtain the health index of hardware information according to the hardware information; The abnormality alarm module is used to calculate the abnormality degree based on historical data and issue an alarm when the abnormality degree exceeds the set threshold.
[0010] By adopting the above technical solutions, work efficiency is improved, manpower input is reduced, and server hardware status is automatically obtained without on-duty supervision. Server status can be obtained in batches according to out-of-band IP addresses without logging into the HDM out-of-band page or logging in. At the same time, the acquisition speed is fast, and operations such as output and packaging can be performed, which is convenient for storage and simple debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0012] Figure 1 Flowchart of this application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0014] Reference Figure 1The embodiment of the present invention provides a method for collecting server hardware information, comprising the following steps: S1: Call the server's API interface to periodically obtain the hardware information of the server hardware.
[0015] Specifically include: Enter the server's out-of-band IP address in the txt text box that requires input information; Use the open module in Python to open and read files, and then call them in batches after splicing API interfaces; Convert the data into a dictionary in json text format, and obtain the location of the server hardware and the corresponding hardware information through the key value of the dictionary.
[0016] Among them, regularly obtaining the hardware information of the server hardware includes: Set the collection cycle based on the reference cycle and current time, including: Tf=Tb×e^(-k×U)×(1+ω×sin(πt / 24)); Among them: Tf is the final collection cycle; Tb is the benchmark cycle; k is the urgency adjustment factor; U is the equipment utilization rate; ω is the daily cycle fluctuation range; t is the current hour.
[0017] As mentioned above, by establishing an intelligent dynamic collection mechanism, the efficiency and reliability of data collection have been significantly improved. The dynamic period adjustment algorithm adopted by it fully considers the periodic characteristics and load conditions of server operation, effectively avoiding the waste of system resources caused by frequent collection while ensuring the real-time nature of data. By introducing exponential decay and sinusoidal periodic terms, the collection frequency can be adaptively adjusted according to the actual usage of the server, automatically increasing the collection frequency during business peaks to ensure the timeliness of monitoring, and appropriately reducing the collection frequency during off-peak periods to save system resources. At the same time, the batch data acquisition mechanism significantly reduces network overhead, improves the concurrent efficiency of data collection, and provides efficient and reliable technical support for the monitoring and management of large-scale server clusters.
[0018] S2: Obtain the health index of the hardware information according to the hardware information.
[0019] Specifically include: H = Σ(Wi × Si) / n; Among them: H is the comprehensive health of the hardware; Wi is the weight coefficient of each indicator; Si is the score of a single indicator; n is the total number of indicators.
[0020] Among them, the specific indicators of each indicator and the scores of individual indicators are set by technical personnel in this field and will not be repeated here.
[0021] As mentioned above, a scientific and complete hardware health assessment system has been constructed. Through the weighted processing of multi-dimensional indicators, an accurate quantitative assessment of the server hardware status has been achieved. The assessment model fully considers the differences in the importance of different hardware components. Through the reasonable allocation of weight coefficients, it not only highlights the importance of monitoring core components, but also takes into account the impact of auxiliary components, forming a comprehensive and objective health scoring mechanism. This evaluation method based on weighted average not only provides an intuitive reference indicator of health status, but also provides reliable data support for predictive maintenance. By tracking the changing trend of the hardware health index in real time, operation and maintenance personnel can promptly discover potential hardware risks and realize the transformation of the operation and maintenance mode from passive response to active prevention, which significantly improves the scientificity and foresight of server management.
[0022] S3: Calculate the degree of abnormality based on historical data, and issue an alarm when the degree of abnormality exceeds the set threshold.
[0023] The abnormality calculated based on historical data includes: A=(1-e^(-γ×∑Vi))×(1+μ×M); Among them: A is the comprehensive anomaly; γ is the sensitivity adjustment coefficient; Vi is the variability of each dimension; μ is the historical anomaly impact factor; M is the historical anomaly cumulative value.
[0024] The above parameters are set by those skilled in the art and are not specifically limited or elaborated herein.
[0025] As mentioned above, the cumulative effect of historical anomalies is combined with real-time monitoring to establish a comprehensive anomaly detection and early warning system. By introducing nonlinear exponential function relationships and historical anomaly influencing factors, the model can accurately characterize the evolution of abnormal states, not only focusing on instantaneous abnormal fluctuations, but more importantly, it can identify and warn of major failure risks that may be caused by the long-term accumulation of small anomalies. The sensitivity adjustment coefficient in the model enables the system to have adaptive capabilities, and can adjust the sensitivity of the alarm according to the needs of different scenarios, effectively reducing the false alarm rate. At the same time, multi-dimensional variability analysis ensures the comprehensiveness and accuracy of anomaly detection, providing a reliable decision-making basis for operation and maintenance personnel. This intelligent early warning mechanism based on cumulative effects has achieved a leap from simple fault detection to intelligent prediction and early warning, greatly improving the initiative and predictability of server operation and maintenance, and providing strong technical support for ensuring the stable operation of server clusters.
[0026] An embodiment of the present invention further provides a system, comprising: The hardware information acquisition module is used to call the server's API interface to periodically obtain the hardware information of the server hardware; A health index calculation module is used to obtain the health index of hardware information according to the hardware information; The abnormality alarm module is used to calculate the abnormality degree based on historical data and issue an alarm when the abnormality degree exceeds the set threshold.
[0027] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined.
[0028] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0029] It can be known from the description of the above implementation modes that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute the methods described in the various implementation modes of the present application or certain parts of the implementation modes.
[0030] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A server hardware information collection method, characterized in that: include: Call the server's API interface to periodically obtain the server's hardware information; Get the health index of hardware information according to the hardware information; The degree of abnormality is calculated based on historical data, and an alarm is issued when the degree of abnormality exceeds the set threshold.
2. The method according to claim 1, characterized in that The periodic acquisition of server hardware information includes: Set the collection cycle based on the reference cycle and current time, including: Tf=Tb×e^(-k×U)×(1+ω×sin(πt / 24)); Among them: Tf is the final collection cycle; Tb is the benchmark cycle; k is the urgency adjustment factor; U is the equipment utilization rate; ω is the daily cycle fluctuation range; t is the current hour.
3. The method according to claim 1, characterized in that The health index of the hardware information obtained according to the hardware information includes: H = Σ(Wi × Si) / n; Among them: H is the comprehensive health of the hardware; Wi is the weight coefficient of each indicator; Si is the score of a single indicator; n is the total number of indicators.
4. The method according to claim 1, characterized in that The calling of the server API interface to periodically obtain the hardware information of the server hardware includes: Enter the server's out-of-band IP address in the txt text box that requires input information; Use the open module in Python to open and read files, and then call them in batches after splicing API interfaces; Convert the data into a dictionary in json text format, and obtain the location of the server hardware and the corresponding hardware information through the key value of the dictionary.
5. The method according to claim 1, characterized in that The abnormality degree calculated according to the historical data includes: A=(1-e^(-γ×∑Vi))×(1+μ×M); Among them: A is the comprehensive anomaly; γ is the sensitivity adjustment coefficient; Vi is the variability of each dimension; μ is the historical anomaly impact factor; M is the historical anomaly cumulative value.
6. A server hardware information collection system, characterized in that: include: The hardware information acquisition module is used to call the server's API interface to periodically obtain the hardware information of the server hardware; A health index calculation module is used to obtain the health index of hardware information according to the hardware information; The abnormality alarm module is used to calculate the abnormality degree based on historical data and issue an alarm when the abnormality degree exceeds the set threshold.