[go: up one dir, main page]

CN119988133A - Method and device for displaying power value, storage medium, and electronic device - Google Patents

Method and device for displaying power value, storage medium, and electronic device Download PDF

Info

Publication number
CN119988133A
CN119988133A CN202510031045.3A CN202510031045A CN119988133A CN 119988133 A CN119988133 A CN 119988133A CN 202510031045 A CN202510031045 A CN 202510031045A CN 119988133 A CN119988133 A CN 119988133A
Authority
CN
China
Prior art keywords
server
determining
health
health degree
component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202510031045.3A
Other languages
Chinese (zh)
Inventor
郭亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202510031045.3A priority Critical patent/CN119988133A/en
Publication of CN119988133A publication Critical patent/CN119988133A/en
Pending legal-status Critical Current

Links

Landscapes

  • Power Sources (AREA)

Abstract

本申请实施例提供了一种电量值的显示方法及装置、存储介质、电子设备,其中,该方法包括:获取所述服务器的多个部件的运行数据,并根据每个部件的运行数据确定所述每个部件的健康度;根据所述每个部件的健康度确定所述服务器的健康度;控制所述USBGadget驱动根据所述健康度确定电池设备的电量值,并将所述电量值通过所述USB接口发送至所述服务器,以使所述服务器通过目标图标显示所述电量值,其中,所述电量值用于指示所述健康度,所述USB Gadget驱动用于模拟所述电池设备。

An embodiment of the present application provides a method and device for displaying a power value, a storage medium, and an electronic device, wherein the method includes: obtaining operating data of multiple components of the server, and determining the health of each component based on the operating data of each component; determining the health of the server based on the health of each component; controlling the USB Gadget driver to determine the power value of a battery device based on the health, and sending the power value to the server through the USB interface, so that the server displays the power value through a target icon, wherein the power value is used to indicate the health, and the USB Gadget driver is used to simulate the battery device.

Description

Method and device for displaying electric quantity value, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a method and a device for displaying an electric quantity value, a storage medium and electronic equipment.
Background
With the rapid development of internet services, the demands of various industries for servers are gradually increased, so that the wide application of the servers is imperative. The server is generally operated for a long time, and various devices such as a CPU, a memory, a hard disk and the like on the server are also operated for a long time in a power-on mode, so that monitoring of the devices and detection and evaluation of the health degree of the whole server are significant.
The monitoring server is typically undertaken by a baseboard management controller (Baseboard Management Controller, abbreviated as BMC) system, which typically provides WebUI client software for users to actively query to see the running status of the server and the health of the various components by actively reporting alarm logs. The method for judging the health degree of the server by collecting the active report alarm logs is generally used in an application scene with a large number of servers, webUI is also a method for requiring active inquiry of users and cannot know the state of the server in real time.
Aiming at the problems of the related technology that a user is required to actively log in WebUI and other client software to inquire the server state, a real-time, visual and server health prompting method without additional software environment is lacking, and no effective solution is proposed at present.
Accordingly, there is a need for improvements in the related art to overcome the drawbacks of the related art.
Disclosure of Invention
The embodiment of the application provides a method and a device for displaying an electricity value, a storage medium and electronic equipment, which at least solve the problem that a server health degree prompting method which is real-time, visual and does not need an additional software environment is lacking in the related technology.
According to one embodiment of the application, a display method of an electric quantity value is provided, wherein the electric quantity value is applied to a base plate management controller of a server, the base plate management controller is connected with a host of the server through a USB interface, the base plate management controller comprises a USB Gadget driver, the USB Gadget driver is used for indicating the health degree, the health degree of each component is determined according to the operation data of the plurality of components of the server, the health degree of the server is determined according to the health degree of each component, the USB Gadget driver is controlled to determine the electric quantity value of a battery device according to the health degree, and the electric quantity value is sent to the server through the USB interface so that the server can display the electric quantity value through a target icon.
In an exemplary embodiment, controlling the USB Gadget driver to determine an electric quantity value of the battery device according to the health degree includes determining a mapping relation between the health degree and the electric quantity value, and controlling the USB Gadget driver to map the health degree to the electric quantity value according to the mapping relation.
In an exemplary embodiment, before acquiring the operation data of the multiple components of the server, the method further comprises configuring a device descriptor of the battery device in the framework driven by the USB Gadget, wherein the device descriptor of the battery device comprises a description of a battery function, and sending the device descriptor of the battery device to the server through a USB interface when the baseboard management controller is connected with a host of the server through the USB interface, so that the server loads a target icon corresponding to the battery device according to the device descriptor.
In one exemplary embodiment, determining the health of the server based on the health of each of the components includes determining a weight value for each of the components and determining the health of the server based on the weight value and the health of each of the components.
In an exemplary embodiment, determining the weight value of each component includes at least one of determining the weight value of each component according to a hardware configuration of the server, determining the weight value of each component according to an application scenario of the server, and determining the weight value of each component according to an operation state of each component.
In one exemplary embodiment, where the plurality of components includes a central processor, a hard disk, and a memory, determining the health of each component from the operational data of the each component includes determining a first duration that the temperature of the central processor is greater than a first temperature threshold, and determining a first duty cycle of the first duration to the operational time of the central processor, determining a second duration that the load utilization of the central processor is greater than a load utilization threshold, and determining a second duty cycle of the second duration to the operational time of the central processor, determining a first level of the number of alert data of the central processor, and determining a second level of the operational time, determining the health of the central processor from the first duty cycle, the second duty cycle, the first level, and the second level;
Acquiring monitoring data of the hard disk, and determining the matching degree of the monitoring data and standard monitoring data; determining a third level of the read-write speed of the hard disk, a fourth level of the use time of the hard disk and a fifth level of the number of alarm data of the hard disk;
The method comprises the steps of determining a third duration time when the temperature of the memory is larger than a second temperature threshold value, determining a third duty ratio of the third duration time to the running time of the memory, determining an error rate and a use frequency of the memory, and determining the health degree of the memory according to the third duty ratio, the error rate and the use frequency.
In an exemplary embodiment, the method for acquiring the operation data of the multiple components of the server at least comprises the steps of acquiring the operation data of a central processing unit of the server through a PECI interface, acquiring the operation data of a hard disk and a memory of the server through an I2C interface, analyzing an ISPMI command through a KCS interface to acquire alarm data reported by the server, and determining the operation data of the multiple components of the server according to the alarm data.
According to another embodiment of the application, a display device of an electric quantity value is provided, and the display device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for acquiring operation data of a plurality of components of a server and determining the health degree of each component according to the operation data of each component, the second determining module is used for determining the health degree of the server according to the health degree of each component, the control module is used for controlling the USB Gadget driver to determine the electric quantity value of a battery device according to the health degree and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery device.
According to a further embodiment of the application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to a further embodiment of the application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
The method comprises the steps of obtaining operation data of a plurality of components of a server, determining the health degree of each component according to the operation data of each component, determining the health degree of the server according to the health degree of each component, controlling a USB Gadget driver to determine an electric quantity value of battery equipment according to the health degree, and sending the electric quantity value to the server through a USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment. In the embodiment of the application, the health degree of each component is calculated according to the data of each component of the server, and the total health degree of the server is calculated to enumerate the battery function through USB Gadget driving, so that the server can intuitively display the electric quantity value through the target icon, thereby reflecting the health condition of the server. Therefore, the problem of lack of a real-time, intuitive server health prompting method without additional software environment can be solved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a server device of a method for displaying an electric quantity value according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of displaying an electrical quantity value according to an embodiment of the present application;
FIG. 3 is a system block diagram of a BMC and a HOST (HOST) in the related art;
FIG. 4 is an actual physical block diagram of a BMC using a USB Gadget battery function hint server health system application according to an embodiment of the present application;
FIG. 5 is a software flow diagram of a BMC data acquisition module according to an embodiment of the application;
FIG. 6 is a software flow diagram of a BMC data analysis module according to an embodiment of the application;
Fig. 7 is a block diagram of a display device of an electric quantity value according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a server apparatus or similar computing device. Taking the operation on the server device as an example, fig. 1 is a block diagram of a hardware structure of the server device of a method for displaying a power value according to an embodiment of the present application. As shown in fig. 1, the server apparatus may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like, and a memory 104 for storing data, wherein the server apparatus may further include a transmission apparatus 106 for communication functions and an input-output apparatus 1 08. It will be appreciated by those of ordinary skill in the art that the architecture shown in fig. 1 is merely illustrative and is not intended to limit the architecture of the server apparatus described above. For example, the server device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method of displaying an electric quantity value in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-described method. The memory 104 may include high speed random access memory, but may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the server device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for displaying an electric quantity value is provided, which is applied to a baseboard management controller of a server, where the baseboard management controller is connected with a host of the server through a USB interface, where the baseboard management controller includes a USB Gadget driver, and fig. 2 is a flowchart of the method for displaying an electric quantity value according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
Step S202, acquiring operation data of a plurality of components of the server, and determining the health degree of each component according to the operation data of each component;
Step S204, determining the health degree of the server according to the health degree of each component;
Step S206, controlling the USB Gadget driver to determine an electrical quantity value of the battery device according to the health degree, and sending the electrical quantity value to the server through the USB interface, so that the server displays the electrical quantity value through a target icon, where the electrical quantity value is used to indicate the health degree, and the USB Gadget driver is used to simulate the battery device.
The method comprises the steps of obtaining operation data of a plurality of components of a server, determining the health degree of each component according to the operation data of each component, determining the health degree of the server according to the health degree of each component, controlling a USB Gadget driver to determine an electric quantity value of battery equipment according to the health degree, and sending the electric quantity value to the server through a USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment. In the embodiment of the application, the health degree of each component is calculated according to the data of each component of the server, and the total health degree of the server is calculated to enumerate the battery function through USB Gadget driving, so that the server can intuitively display the electric quantity value through the target icon, thereby reflecting the health condition of the server. Therefore, the problem of lack of a real-time, intuitive server health prompting method without additional software environment can be solved.
Alternatively, in order to better understand the above step S206, the above step S206 may be implemented by:
And controlling the USB Gadget driver to map the health degree to the electric quantity value according to the mapping relation.
The embodiment of the application converts abstract server health into visual electric quantity display, and specifically comprises the following steps:
first, it is necessary to define an evaluation range of the server health, for example, the health may be a value from 0 to 100, where 0 means that the server is totally unhealthy and 100 means that the server is very healthy.
A range of charge values for the battery device is defined, for example, the charge value is also typically from 0% to 100%, where 0% represents battery charge depletion and 100% represents battery charge full.
The mapping relationship between the health and the electrical quantity value is generally a linear or nonlinear functional relationship or a more complex nonlinear relationship. The mapping relation ensures that the reduction of the health degree is in direct proportion to the reduction of the electric quantity display, so that a user can intuitively understand the health condition of the server.
And transferring the calculated health value to a driver by calling an interface (such as an ioctl interface) of the USB Gadget driver, and driving logic for realizing the mapping relation inside the driver.
Through the embodiment, the server health degree real-time monitoring and visual display are realized, a convenient maintenance and management means is provided for users, and especially under the use scene of a small number of servers, no additional software environment or active query operation is needed, so that the user experience and the server management efficiency are greatly improved.
Optionally, before the operation data of the multiple components of the server are acquired, the method further comprises configuring a device descriptor of the battery device in the framework driven by the USB Gadget, wherein the device descriptor of the battery device comprises a description of a battery function, and when the baseboard management controller is connected with a host of the server through a USB interface, the device descriptor of the battery device is sent to the server through the USB interface, so that the server loads a target icon corresponding to the battery device according to the device descriptor.
It should be noted that, the device descriptor configuration device descriptor in the USB Gadget driver framework is important information for identifying the type, function and configuration of the device when the USB device communicates with the host. In the present application, the configured battery device descriptor contains not only basic USB device information but also a description of the battery function in particular. By setting these descriptors in the USB Gadget driver, it can be ensured that the device is correctly recognized by the host operating system as a generic USB device with battery functionality.
When the BMC is connected with the host of the server through the USB interface, the BMC can actively send the device descriptor to the host. This is the first step in establishing communication between the USB device and the host, and by means of the correct device descriptor, the host can recognize that this is a battery-enabled device and prepare to receive subsequent power information.
After receiving the device descriptor, the host operating system of the server loads the corresponding battery icon according to the information in the descriptor, which is usually displayed in the user interface of the operating system. Regardless of the operating system (e.g., windows, linux, etc.) used by the user, the battery icon can be seen as long as the system supports identification and display of the USB device, thereby providing an intuitive way for the user to understand the health of the server.
The embodiment of the application realizes the convenience of no active inquiry of the user and improves the management efficiency and user experience of the server.
Optionally, determining the health of the server according to the health of each component comprises determining a weight value of each component, and determining the health of the server according to the weight value and the health of each component.
According to the embodiment of the application, the influence degree of the components on the overall running state of the server is reflected by distributing different weight values to the components based on the health degree of the key components of the server. The method comprises the following steps:
The contribution or impact of different components in the server on overall health is identified and quantified. For example, in a server, components such as a CPU, a memory, a hard disk, and a fan have different degrees of influence on stability and performance of the server. Thus, these components may be given different weight values when evaluating server health. Weight values are allocated to each component, and the weight values are combined with the health degrees of the components to calculate the overall health degree of the server.
The calculation may be by multiplying the health of each component by its corresponding weight, adding all the products, and normalizing the sum to obtain a health score within a specified range (e.g., 0 to 100).
For example,' total health= (CPU health CPU weight value + hard disk health hard disk weight value + memory health memory weight value +.) total weight value ".
The embodiment of the application provides a more comprehensive and more refined server health evaluation scheme, which not only considers the health states of all the components, but also considers the relative importance of the components in the server, thereby being capable of reflecting the actual running condition of the server more accurately. The method can help operation staff to quickly locate the problem part in practical application, and maintain and upgrade in time so as to keep high availability and performance of the server.
In the embodiment of the application, a plurality of ways for determining the weight value of each component are provided, and at least one of the following ways is included:
1) Determining a weight value of each component according to the hardware configuration of the server;
Different hardware may affect the overall performance of the server to different extents. For example, for a server configured with a high performance CPU and a large amount of memory, the health of the CPU and memory may have a greater impact on overall health, while the health of the hard disk is relatively low weighted. Conversely, if the server is primarily used for storage, the health weight of the hard disk should be higher. Evaluation mechanism the importance of a hardware configuration can be automatically evaluated by defining a set of rules. For example, if the number of C PU cores of the server exceeds a certain threshold, the C PU health weight can be increased, if the total amount of memory reaches a certain level, the memory health weight is increased, and if the number or capacity of the hard disk reaches a certain level for the storage server, the hard disk health weight is increased.
2) Determining a weight value of each component according to the application scene of the server;
The requirements of different application scenarios on server hardware are also different. For example, CPU performance and health are particularly important for computationally intensive applications, while hard disk and network stability may be more critical for data intensive applications. Scene recognition algorithm an algorithm is developed to recognize the main application scene of the server. This can be achieved by analyzing the indexes of the software application type, the utilization rate of the CPU and the hard disk, the network traffic and the like on the server. Once the application scenario is identified, the health weights of the components may be adjusted accordingly.
3) Determining a weight value of each component according to the running state of each component;
During the operation of the server, the usage of the hardware may change over time. Thus, a dynamic weight adjustment policy should include monitoring hardware usage in real time and dynamically adjusting weights based on current hardware loads. The BMC can monitor the load and performance of each part of the server in real time, such as CPU utilization rate, hard disk read-write speed, memory occupancy rate and the like. If an abnormality in the usage or performance index of a component is detected, the health weight of the component may be temporarily increased to more accurately reflect the current server health status.
For example, assuming that the server is configured with a high-performance CPU, a large-capacity memory, and a plurality of hard disks, the main application scenario is data analysis. Initially, a CPU weight of 0.3, a memory weight of 0.4, and a hard disk weight of 0.3 may be set. During operation, if the CPU usage continues to exceed 80%, the CPU weight may be temporarily adjusted to 0.4 to more accurately reflect the health of the server under high computational load.
The health degree weight of the components such as the CPU, the hard disk, the memory and the like is dynamically adjusted, and the hardware configuration, the application scene, the real-time monitoring and the user feedback based on the server are needed. Through reasonable design and realization of the strategy, the accuracy and the practicability of server health evaluation can be improved, and more accurate server state information is provided for users.
In one exemplary embodiment, where the plurality of components includes a central processor, a hard disk, and a memory, determining the health of each component from the operational data of the each component includes determining a first duration that the temperature of the central processor is greater than a first temperature threshold, and determining a first duty cycle of the first duration to the operational time of the central processor, determining a second duration that the load utilization of the central processor is greater than a load utilization threshold, and determining a second duty cycle of the second duration to the operational time of the central processor, determining a first level of the number of alert data of the central processor, and determining a second level of the operational time, determining the health of the central processor from the first duty cycle, the second duty cycle, the first level, and the second level;
that is, the CPU health degree calculation method is:
1) Temperature monitoring-the normal operating temperature of the CPU is between 50-80 ℃, which may indicate overheating. A temperature threshold, such as over 80 ℃, may be set as a warning condition and the percentage of time the duration of the exceeding threshold is calculated to assess health.
2) Load monitoring-the load of a CPU is typically measured by utilization, and long periods of high load may affect the life of the CPU. A load threshold may be set, such as over 80% high load, again calculating the percentage of the duration of high load to the total time.
3) And the alarm data, namely CPU error report, such as check error, clock error and the like, can set an error quantity threshold value, and the health degree is reduced when the error quantity threshold value exceeds the threshold value.
4) Run time C PU running for a long time may be subject to more wear and the degree of aging may be calculated by the total run time.
The above indicators are weighted by their importance and then combined to calculate a health score of 0 to 100.
Acquiring monitoring data of the hard disk, and determining the matching degree of the monitoring data and standard monitoring data; determining a third level of the read-write speed of the hard disk, a fourth level of the use time of the hard disk and a fifth level of the number of alarm data of the hard disk;
the monitoring data may be S MART data, where the S MART data of the hard disk includes various health information of the hard disk, such as an error rate, a number of remapped sectors, a rotation time, and the like.
That is, the index affecting the health of the hard disk is:
1) Monitoring data, setting threshold values of various indexes, and reducing health degree when the threshold values are exceeded;
2) The read-write speed is that the read-write speed of the hard disk is monitored and compared with the standard speed, and a speed drop threshold is set;
3) The service time of the hard disk can influence the health degree, and a service life threshold value is set, and the health degree is influenced if the service life threshold value exceeds the service life threshold value;
4) Alarm data, namely error records of the hard disk, such as the number of bad tracks, can be set as a threshold value, and if the threshold value exceeds the threshold value, the health degree is reduced.
The method comprises the steps of determining a third duration time when the temperature of the memory is larger than a second temperature threshold value, determining a third duty ratio of the third duration time to the running time of the memory, determining an error rate and a use frequency of the memory, and determining the health degree of the memory according to the third duty ratio, the error rate and the use frequency.
That is, the memory health degree calculation method is as follows:
1) Error rate, namely monitoring the error rate of the memory, including ECC check errors and the like, and setting an error rate threshold.
2) Temperature monitoring is that the memory also has a temperature threshold, and too high a temperature may cause data loss or performance degradation.
3) The use frequency is that the high frequency has certain abrasion to the internal memory, the use frequency in a period of time can be calculated, and a threshold value is set.
Optionally, the operation data of the multiple components of the server are acquired, wherein the operation data at least comprises one of acquiring the operation data of a central processing unit of the server through a PECI interface, acquiring the operation data of a hard disk and a memory of the server through an I2C interface, analyzing an ISPM I command through a KCS interface to acquire alarm data reported by the server, and determining the operation data of the multiple components of the server according to the alarm data.
Note that PECI (Platform Environment Control Interface) is an efficient, low-latency communication protocol, which is mainly used for the BMC to communicate with the CPU on the server. Through the PECI interface, the BMC can acquire key indexes such as temperature, voltage, frequency, power use condition and the like of the CPU in real time, and the data are critical to the evaluation of the running state and health degree of the CPU.
I2C (Inter-INTEGRATED CIRCUIT) is a bi-directional two-wire serial bus protocol for communication between a microcontroller and peripheral devices. In a server environment, I2C may be used to monitor and manage various hardware devices, such as hard disks, memory, power management modules, and the like. Through the I2C interface, the BMC can collect data such as the temperature, the rotating speed and the SMART state of the hard disk, and information such as the temperature, the use rate and the error count of the memory. These data are critical to determining the health of the hard disk and memory and can help identify potential hardware failures.
KCS (Keyboard Controller Style) is one of the communication modes defined in the IPMI (INTELLIGENT PLATFORM MANAGEMENT INTERFACE) specification for simple polling communication between the BMC and the IPMI host. IPMI commands are typically used for remote monitoring and management of servers, and by parsing these commands through a KCS interface, the BMC may obtain alarm data actively reported by the server, including but not limited to system failures, resource exhaustion, excessive temperature, power anomalies, etc. These alert data can provide immediate feedback on the overall health of the server, helping to quickly identify and locate problems, another important source of data for server health assessment.
In the embodiment of the application, the BMC forms the basis for comprehensively evaluating the health condition of the server through the running data of the central processor, the hard disk, the memory and the alarm data of the server, which are acquired by the PECI, the I2C and the KCS interfaces. The collection and analysis of the data can help the user to know the state of the server in real time and take measures to prevent or solve potential problems in time.
In order to better understand the process of the method for displaying the electric quantity value, the following description is given with reference to the implementation method flow of the display of the electric quantity value in the alternative embodiment, but the implementation method flow is not limited to the technical scheme of the embodiment of the application.
In the related art, active log reporting of the BMC system, such as SNMP, SMTP, syslog, or each component developed by the BMC system developer is used to monitor the system software, and the client can actively query the server health through WebUI or other client software. A block diagram of a scheme system in the related art is shown in fig. 3.
Based on the scheme in the related art, the client UI software needs to be actively logged in to query the health status of the server, so that a real-time, visual and no additional software environment is lacking in the server health prompting method, in this embodiment, a method for displaying an electric quantity value is provided, and the method is applied to a system as shown in fig. 4, and fig. 4 is an actual physical block diagram of the application of the BMC prompting the health status of the server by using the USB Gadget battery function according to the embodiment of the present application, specifically as follows:
the system in the embodiment of the application has 3 main implementation modules, including:
USB Gadget driving battery function enumeration and battery power setting module:
The BMC realizes the function of Battery by using a USB Gadget driver through a USB interface with the Host, so that a Battery device can be enumerated under the OS of the Host. The USB Gadget driver enumerates devices according to a standard protocol specified by the USB, so that the battery devices enumerated under the Host can be normally displayed under any operating system.
The function of setting the battery power in the USB Gadget drive is realized, so that the battery power can be correspondingly displayed under the OS of the Host.
Realizing the ioctl interface, providing an interface for setting the functional electric quantity of the USB Gadget battery by the application layer data analysis module.
BMC gathers Host part data module in real time:
the detailed flow chart of the data acquisition module software is shown in fig. 5, and is specifically as follows:
And step 1, the BMC acquires various data of the CPU of the server in real time through the PECI interface.
And 2, the BMC acquires data such as a fan, a hard disk and the like of the server in real time through the I2C interface.
And 3, the BMC analyzes the IPMI command through the KCS interface to obtain alarm data actively reported by the server.
And 4, storing the collected data in a BMC cache in a classified manner for the data analysis module to use.
A host component data analysis module:
The detailed flow chart of the data analysis module software is shown in fig. 6, and is specifically as follows:
and step 1, the data analysis module acquires the data of various server components from the acquired data cache in real time.
And 2, respectively using the data of each component (CPU, hard disk, memory and IPMI), and calculating the health degree of each component by utilizing a corresponding special algorithm.
And 3, calculating the health degree of the server by using a comprehensive algorithm according to the health degree calculated by the data of each part in a period of time. Such as the following (each different component health algorithm may be different, and the overall health ratio is also different):
Total health= ((CPU health 0.2+hard disk health 0.5+memory health 0.3) 100);
And 4, setting the functional electric quantity of the battery according to the calculated total health degree by using an interface provided by the USB Gadget driver.
The embodiment of the application provides a method for prompting server health by using a USB Gadget drive to enumerate a Battery (Battery) function by BMC. In general, in the hardware connection between a BMC System and a Host, a hardware interface of a USB Device is provided, the USB interface is generally used when the BMC uses a keyboard, a video or mouse (Keyboard Video Mouse, abbreviated as KVM) port and a virtual media function, and the embodiment of the application uses the USB interface to enumerate a Battery (Battery) function by using a USB Gadget driver, so that when the Host detects the USB connection, a Battery Device can be enumerated and displayed under an Operating System of the Host through the USB interface, the Operating System (OS) can see a Battery icon under the UI of the Host, meanwhile, the BMC synchronously monitors and analyzes data of each part of the Host, calculates the health of the server under a corresponding algorithm, and then sets the Battery power enumerated by the USB Gadget driver to represent the health of the server, and thus a user can judge the health of the server through the Battery power under a human-computer interaction interface (UI) of the OS, and can alarm the user through a low power alarm prompt of the OS to alarm the user so that the user can deal with the corresponding problem in time.
According to the embodiment of the application, the general battery equipment can be enumerated under any operating system without depending on the operating system of the Host side, the problem that a user installs other software environments is solved, the prompt can be actively displayed on an operating system interface used by the user, an alarm function is provided, and the user is prevented from logging in the client software to inquire.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
In this embodiment, a device for displaying an electric quantity is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 7 is a block diagram of a display device of electric quantity values according to an embodiment of the present application, as shown in fig. 7, the device including:
A first determining module 72, configured to obtain operation data of a plurality of components of the server, and determine health of each component according to the operation data of each component;
a second determining module 74 for determining the health of the server based on the health of each of the components;
The control module 76 is configured to control the USB Gadget driver to determine an electrical quantity value of the battery device according to the health degree, and send the electrical quantity value to the server through the USB interface, so that the server displays the electrical quantity value through a target icon, where the electrical quantity value is used to indicate the health degree, and the USB Gadget driver is used to simulate the battery device.
The device comprises a server, a USB Gadget driver, a target icon, a USB interface, a device and a device, wherein the server is used for acquiring operation data of a plurality of components of the server, determining the health degree of each component according to the operation data of each component, determining the health degree of the server according to the health degree of each component, controlling the USB Gadget driver to determine an electric quantity value of battery equipment according to the health degree, and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through the target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment. In the embodiment of the application, the health degree of each component is calculated according to the data of each component of the server, and the total health degree of the server is calculated to enumerate the battery function through USB Gadget driving, so that the server can intuitively display the electric quantity value through the target icon, thereby reflecting the health condition of the server. Therefore, the problem of lack of a real-time, intuitive server health prompting method without additional software environment can be solved.
In an exemplary embodiment, a control module 76 is configured to determine a mapping relationship between the health and the power value, and control the USB Gadget driver to map the health to the power value according to the mapping relationship.
In an exemplary embodiment, the device further comprises a configuration module, wherein the configuration module is used for configuring the device descriptor of the battery device in the framework driven by the USB Gadget, the device descriptor of the battery device comprises a description of a battery function, and when the baseboard management controller is connected with a host of a server through a USB interface, the device descriptor of the battery device is sent to the server through the USB interface, so that the server loads a target icon corresponding to the battery device according to the device descriptor.
In an exemplary embodiment, a second determining module 74 is configured to determine a weight value for each component and determine the health of the server based on the weight value and the health of each component.
In an exemplary embodiment, the second determining module 74 is configured to at least one of determine the weight value of each component according to a hardware configuration of the server, determine the weight value of each component according to an application scenario of the server, and determine the weight value of each component according to an operation state of each component.
In one exemplary embodiment, where the plurality of components includes a central processor, a hard disk, and a memory, a first determination module 72 to determine a first duration of time that the temperature of the central processor is greater than a first temperature threshold and to determine a first duty cycle of the first duration to the running time of the central processor, to determine a second duration of time that the load utilization of the central processor is greater than a load utilization threshold and to determine a second duty cycle of the second duration to the running time of the central processor, to determine a first level of the number of alert data of the central processor and to determine a second level of the running time, to determine the health of the central processor based on the first duty cycle, the second duty cycle, the first level, and the second level;
Acquiring monitoring data of the hard disk, and determining the matching degree of the monitoring data and standard monitoring data; determining a third level of the read-write speed of the hard disk, a fourth level of the use time of the hard disk and a fifth level of the number of alarm data of the hard disk;
The method comprises the steps of determining a third duration time when the temperature of the memory is larger than a second temperature threshold value, determining a third duty ratio of the third duration time to the running time of the memory, determining an error rate and a use frequency of the memory, and determining the health degree of the memory according to the third duty ratio, the error rate and the use frequency.
In an exemplary embodiment, the first determining module 72 is at least configured to obtain, through a PECI interface, operation data of a central processing unit of the server, obtain, through an I2C interface, operation data of a hard disk and a memory of the server, parse, through a KCS interface, an I PM I command to obtain alarm data reported by the server, and determine, according to the alarm data, operation data of a plurality of components of the server.
It should be noted that each of the above modules may be implemented by software or hardware, and the latter may be implemented by, but not limited to, the above modules all being located in the same processor, or each of the above modules being located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, acquiring operation data of a plurality of components of the server, and determining the health degree of each component according to the operation data of each component;
S2, determining the health degree of the server according to the health degree of each component;
And S3, controlling the USB Gadget driver to determine an electric quantity value of the battery equipment according to the health degree, and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment.
In an exemplary embodiment, the computer readable storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, etc. various media in which a computer program may be stored.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring operation data of a plurality of components of the server, and determining the health degree of each component according to the operation data of each component;
S2, determining the health degree of the server according to the health degree of each component;
And S3, controlling the USB Gadget driver to determine an electric quantity value of the battery equipment according to the health degree, and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment.
Embodiments of the application also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
Embodiments of the present application also provide a computer program comprising computer instructions stored on a computer readable storage medium, a processor of a computer device reading the computer instructions from the computer readable storage medium, the processor executing the computer instructions to cause the computer device to perform the steps of any of the method embodiments described above.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring operation data of a plurality of components of the server, and determining the health degree of each component according to the operation data of each component;
S2, determining the health degree of the server according to the health degree of each component;
And S3, controlling the USB Gadget driver to determine an electric quantity value of the battery equipment according to the health degree, and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A display method of electric quantity value is characterized by being applied to a baseboard management controller of a server, wherein the baseboard management controller is connected with a host of the server through a USB interface, and the baseboard management controller comprises USB
Gadget drive, comprising:
acquiring operation data of a plurality of components of the server, and determining the health degree of each component according to the operation data of each component;
Determining the health degree of the server according to the health degree of each component;
And controlling the USB Ga d g et drive to determine an electric quantity value of the battery equipment according to the health degree, and sending the electric quantity value to the server through the USB interface so that the server displays the electric quantity value through a target icon, wherein the electric quantity value is used for indicating the health degree, and the USB Gadget drive is used for simulating the battery equipment.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Controlling the USB Gadget driver to determine an electrical value of the battery device according to the health degree, including:
determining a mapping relation between the health degree and the electric quantity value;
and controlling the USB Ga dg et drive to map the health degree to the electric quantity value according to the mapping relation.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Before acquiring the operation data of the plurality of components of the server, the method further includes:
configuring a device descriptor of the battery device in the USB Gadget driven framework, wherein the device descriptor of the battery device comprises a description of a battery function;
and under the condition that the baseboard management controller is connected with a host of the server through a USB interface, sending the device descriptor of the battery device to the server through the USB interface, so that the server loads the target icon corresponding to the battery device according to the device descriptor.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Determining the health of the server according to the health of each component, including:
determining a weight value of each component;
and determining the health degree of the server according to the weight value and the health degree of each component.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
Determining a weight value of each component, wherein the weight value at least comprises one of the following components:
Determining a weight value of each component according to the hardware configuration of the server;
determining a weight value of each component according to the application scene of the server;
And determining the weight value of each component according to the running state of each component.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
In the case that the plurality of components include a central processing unit, a hard disk, and a memory, determining the health degree of each component according to the operation data of each component includes:
determining a first duration of time that the temperature of the central processor is greater than a first temperature threshold, and determining a first duty cycle of the first duration of time to the run time of the central processor;
Determining a second duration for which the load utilization of the central processor is greater than a load utilization threshold, and determining a second duty cycle of the second duration to the run time of the central processor;
Determining a first level of the number of alert data for the central processor and determining a second level of the run time, determining a health of the central processor based on the first duty cycle, the second duty cycle, the first level, and the second level;
Acquiring monitoring data of the hard disk, and determining the matching degree of the monitoring data and standard monitoring data;
Determining a third level of the read-write speed of the hard disk, a fourth level of the use time of the hard disk, and a fifth level of the number of alarm data of the hard disk;
Determining the health degree of the hard disk according to the matching degree, the third grade, the fourth grade and the fifth grade;
determining a third duration of time that the temperature of the memory is greater than a second temperature threshold, and determining a third duty cycle of the third duration of time and the run time of the memory;
determining the error rate and the use frequency of the memory;
and determining the health degree of the memory according to the third duty ratio, the error rate and the use frequency.
7. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Acquiring operation data of a plurality of components of the server, wherein the operation data comprises at least one of the following components:
Acquiring operation data of a central processing unit of the server through a PECI interface;
Acquiring operation data of a hard disk and a memory of the server through an I2C interface;
Analyzing the IPMI command through the KCS interface to acquire the alarm data reported by the server, and determining the operation data of a plurality of components of the server according to the alarm data.
8. A display device for electric quantity value is characterized in that,
Comprising the following steps:
The first determining module is used for acquiring the operation data of a plurality of components of the server and determining the health degree of each component according to the operation data of each component;
The device comprises a server, a first determining module, a second determining module and a control module, wherein the first determining module is used for determining the health degree of the server according to the health degree of each component, the control module is used for controlling a USB Gadget driver to determine an electric quantity value of battery equipment according to the health degree and sending the electric quantity value to the server through a USB interface so that the server displays the electric quantity value through a target icon, the electric quantity value is used for indicating the health degree, and the USB Gadget driver is used for simulating the battery equipment.
9. A computer-readable storage medium comprising,
The computer readable storage medium has stored therein a computer program, wherein the computer program when executed by a processor realizes the steps of the method as claimed in any of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
The processor, when executing the computer program, implements the steps of the method as claimed in any one of claims 1 to 7.
CN202510031045.3A 2025-01-08 2025-01-08 Method and device for displaying power value, storage medium, and electronic device Pending CN119988133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510031045.3A CN119988133A (en) 2025-01-08 2025-01-08 Method and device for displaying power value, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510031045.3A CN119988133A (en) 2025-01-08 2025-01-08 Method and device for displaying power value, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN119988133A true CN119988133A (en) 2025-05-13

Family

ID=95645747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510031045.3A Pending CN119988133A (en) 2025-01-08 2025-01-08 Method and device for displaying power value, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN119988133A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120448223A (en) * 2025-07-08 2025-08-08 苏州元脑智能科技有限公司 Health monitoring method and device of server storage system, server and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120448223A (en) * 2025-07-08 2025-08-08 苏州元脑智能科技有限公司 Health monitoring method and device of server storage system, server and medium
CN120448223B (en) * 2025-07-08 2025-09-12 苏州元脑智能科技有限公司 Health monitoring method and device of server storage system, server and medium

Similar Documents

Publication Publication Date Title
CN112882796B (en) Abnormal root cause analysis method and device and storage medium
CN110568838B (en) A vehicle static current acquisition method, system, electronic device and storage medium
US8886985B2 (en) Automatic discovery of physical connectivity between power outlets and IT equipment
US9600394B2 (en) Stateful detection of anomalous events in virtual machines
US20130179631A1 (en) Solid-state disk (ssd) management
US20130198370A1 (en) Method for visualizing server reliability, computer system, and management server
US8429455B2 (en) Computer system management method and management system
US8527238B2 (en) Storage input/output utilization associated with a software application
CN119988133A (en) Method and device for displaying power value, storage medium, and electronic device
US8554906B2 (en) System management method in computer system and management system
US20200218633A1 (en) Technologies for monitoring health of a process on a compute device
CN114550800A (en) Hard disk fault diagnosis method, system, terminal and storage medium
CN101771565A (en) Analogy method for realizing multitudinous or different baseboard management controllers by single server
CN113168398A (en) Upgrade determination for telemetry data based devices
CN113590405A (en) Hard disk error detection method and device, storage medium and electronic device
CN117312094A (en) Server hardware monitoring and collecting method based on time sequence analysis algorithm
CN117061335A (en) Cloud platform equipment health management and control method and device, storage medium and electronic equipment
CN111158982B (en) Electronic device, first operating system, data processing method, and storage medium
CN118708442B (en) Backboard monitoring method, storage medium, electronic device and computer program product
CN119865845A (en) Network element state monitoring method, device and system, electronic equipment and storage medium
CN109460194A (en) A kind of storage array monitoring system and method
US9329923B2 (en) Diagnostic testing based on information handling system variables
CN117421177A (en) Method and device for monitoring running state of server
CN106933718B (en) Method for monitoring performance and device
CN102822806B (en) Detect the state that gets nowhere of application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination