Method and device for sending alarm content, storage medium and electronic device
By obtaining the key alarm information of the hard disk during the current time period and determining the degree of alarm backlog, the problem of BMC frequently reading the alarm content is solved, and the system performance is improved.
Patent Information
- Application Number
- CN202510126680.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-27
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-27
AI Technical Summary
In the storage system, BMC needs to read alarm information from BMC AGENT through interval query, resulting in frequent reading of alarm content in a short time, which consumes time and affects system performance.
By obtaining the key information of the alarm generated by the hard disk in the current time period, determining the degree of alarm backlog, and obtaining and transmitting the alarm content based on the read command sent by the BMC, avoiding frequent reading.
It effectively avoids the situation where BMC frequently reads alarm content, reduces time consumption and performance impact, and improves system performance.
Smart Images

Figure CN119576636B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and more specifically, to a method and device for sending alarm content, a storage medium, and an electronic device. Background Art
[0002] In the field of storage systems, the development of RAID (Redundant Array of Independent Disks) technology has promoted the development of the entire industry. Users can achieve larger storage capacity, higher performance and sufficient safety and fault tolerance by combining multiple hard disks into a RAID array. Among them, the management of the RAID card for the entire RAID system is extremely important, which includes two components: in-band management and out-of-band management.
[0003] Among them, the out-of-band management part is composed of the BMC (Baseboard Management Controller) and the BMCAGENT (a service module on the RAID card that is directly connected to the BMC) module on the RAID card, which are jointly responsible for the management of the hardware status, health status, performance, power consumption, etc. of the RAID card. This can be done through alarm reporting, status monitoring, configuration distribution, upgrade management, etc.
[0004] In the related technology, the communication between BMC and RAID card is realized through I2C (Inter-Integrated Circuit) bus connection. In the management process, the system has a scenario where a large number of alarms are reported in a short period of time. BMC AGENT (a service module on the RAID card that directly connects to BMC) stores these alarms, which consumes a lot of memory. Therefore, BMC usually needs to read alarm information from BMC AGENT regularly. This regular interval query will result in frequent alarm reports in a short period of time, which not only wastes time but also affects system performance.
[0005] In the related technology, the BMC needs to read the alarm information from the BMC AGENT by means of interval query, which is time-consuming and affects the system performance. Currently, no effective solution has been proposed. Summary of the invention
[0006] The embodiments of the present application provide a method and device for sending alarm content, a storage medium and an electronic device, so as to at least solve the problem that alarms are frequently reported in a short period of time, which not only wastes time but also affects system performance.
[0007] According to an embodiment of the present application, a method for sending alarm content is provided, including: obtaining key information of an alarm generated by a hard disk in a current time period, wherein the BMC agent service is set in the hard disk; transmitting the alarm backlog level in the current time period determined according to the key information to the BMC; obtaining the alarm content of the alarm according to a read instruction sent by the BMC, and transmitting the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it is determined that the received alarm backlog level meets the alarm trigger condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
[0008] In an exemplary embodiment, the transmitting the alarm backlog level within the current time period determined based on the key information to the BMC includes: storing the alarm backlog level in a preset storage structure, and the BMC acquiring it from the storage structure when an acquisition condition is met; or, directly sending the alarm backlog level to the BMC when a sending condition is met.
[0009] In an exemplary embodiment, before the alarm backlog level within the current time period determined based on the key information is transmitted to the BMC, the method further includes: obtaining a first alarm linked list determined within a first time period before the current time period; writing the key information into the first alarm linked list to update the first alarm linked list to obtain a second alarm linked list within the current time period; and determining the alarm backlog level within the current time period based on the second alarm linked list.
[0010] In an exemplary embodiment, determining the degree of alarm backlog in the current time period based on the second alarm linked list includes: determining the number of alarms in the second alarm linked list and the linked list capacity; and determining the quotient of the number of alarms and the linked list capacity as the degree of alarm backlog in the current time period.
[0011] In an exemplary embodiment, the writing of the key information into the first alarm linked list to update the first alarm linked list to obtain the second alarm linked list within the current time period also includes: determining the real-time storage capacity of the first alarm linked list; when it is determined that the real-time storage capacity meets the list cleaning condition, determining the target alarm node to be cleared from the first alarm linked list; and clearing the target alarm node from the first alarm linked list.
[0012] In an exemplary embodiment, when it is determined that the real-time storage capacity satisfies the linked list cleaning conditions, the target alarm nodes to be cleared are determined from the first alarm linked list, including: when the real-time storage capacity reaches a set capacity threshold, obtaining the alarm backlog level in the current time period and the alarm backlog level in a first time period before the current time period; determining the number of target alarm nodes to be cleared based on the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period; and determining the number of target alarm nodes to be cleared from the first alarm linked list.
[0013] In an exemplary embodiment, obtaining the alarm content of the alarm according to the read instruction sent by the BMC includes: determining whether the remaining cache of the BMC proxy service meets the capacity condition; the capacity condition refers to the condition used to determine whether the remaining cache of the BMC proxy service meets the storage standard; when it is determined that the remaining cache meets the capacity condition, calling the alarm interface provided by the alarm module in the hard disk according to the read instruction sent by the BMC; obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information.
[0014] In an exemplary embodiment, the method further includes: when it is determined that the remaining cache does not meet the capacity condition, directly extracting the alarm content of the alarm from the cache of the BMC agent service.
[0015] In an exemplary embodiment, the key information includes the alarm identifier of the alarm; obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information includes: when the alarm module has been connected to the alarm module through the alarm interface, searching the alarm module for a target alarm identifier that matches the alarm identifier; and obtaining the alarm content associated with the target alarm identifier from the alarm module.
[0016] In an exemplary embodiment, transmitting the alarm content to the BMC includes: subpackaging the alarm content to obtain a subpackaging result, storing the subpackaging result in a cache of the BMC agent service, and having the BMC read the subpackaging result from the cache; or, subpackaging the alarm content to obtain a subpackaging result, and directly sending the subpackaging result to the BMC.
[0017] In an exemplary embodiment, the BMC proxy service is connected to an alarm module set in the hard disk; the acquisition of key information of alarms generated by the hard disk in the current time period includes: acquiring the recorded alarm pass rate of the alarm module in the current time period; the alarm pass rate is determined based on the key information of alarms sent by the alarm module to the BMC proxy service in the current time period; when it is determined that the alarm pass rate reaches a first pass rate threshold, sending a first prompt instruction to the alarm module; the first prompt instruction is used to instruct the alarm module to send key information of key alarms to the BMC proxy service; and obtaining key information of key alarms generated by the hard disk in the current time period.
[0018] In an exemplary embodiment, the BMC proxy service is connected to an alarm module set in the hard disk; the method further includes: obtaining the recorded alarm pass rate of the alarm module in the current time period, and the alarm pass rate of the alarm module in the historical time period before the current time period; the historical time period includes at least a first time period and a second time period; the alarm pass rate of the current time period is determined according to the key information of the alarm sent by the alarm module to the BMC proxy service in the current time period; when it is determined that the alarm pass rate of the current time period, the alarm pass rate of the first time period, and the alarm pass rate of the second time period all reach a second pass rate threshold, sending a second prompt instruction to the alarm module to instruct the alarm module to suspend sending the key information of the alarm generated in the current time period; wherein the second pass rate threshold is obtained by increasing the first pass rate threshold when the alarm pass rates of the alarm module obtained N times in succession all reach the first pass rate threshold, wherein N is a positive integer.
[0019] According to another embodiment of the embodiment of the present application, a device for sending alarm content is also provided, including: an information acquisition module, used to obtain key information of alarms generated by a hard disk in a current time period, wherein the BMC agent service is set in the hard disk; a transmission module, used to transmit the alarm backlog level in the current time period determined according to the key information to the BMC; the transmission module is also used to obtain the alarm content of the alarm according to a read instruction sent by the BMC, and transmit the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it is determined that the received alarm backlog level meets the alarm trigger condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
[0020] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0021] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0022] According to another embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0023] Through this application, the key information of the alarm generated by the hard disk in the current time period is obtained, and then the alarm backlog level in the current time period determined by the key information is transmitted to the BMC, and then the alarm content of the alarm is obtained and sent to the BMC according to the read instruction sent by the BMC when it determines that the received alarm backlog level meets the alarm triggering condition. Because the BMC proxy service can determine the alarm backlog level, the BMC can determine whether to send a read instruction based on the obtained alarm backlog level, thereby avoiding the situation where the BMC needs to frequently read the alarm content, and solves the problem of frequent reading of alarm content in a short period of time, which wastes time and affects system performance.
[0024] According to another embodiment of the embodiment of the present application, a method for obtaining alarm content is also provided, which is applied to a baseboard management controller BMC, and includes: obtaining an alarm backlog degree; wherein the alarm backlog degree is determined by a BMC agent service based on obtaining key information of alarms generated by the hard disk in a current time period; when an alarm trigger condition is met based on the alarm backlog degree, a read instruction is sent to the BMC agent service, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the baseboard management controller BMC; and obtaining the alarm content transmitted by the BMC agent service.
[0025] According to another embodiment of the embodiment of the present application, a device for obtaining alarm content is also provided, including a degree acquisition module, used to obtain the alarm backlog degree; wherein the alarm backlog degree is determined by a BMC agent service based on key information of alarms generated by the hard disk in a current time period; an indication module, used to send a read instruction to the BMC agent service when an alarm trigger condition is met based on the alarm backlog degree, the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC; a content acquisition module, used to obtain the alarm content transmitted by the BMC agent service.
[0026] Through the present application, the alarm backlog degree is obtained through the BMC; wherein, the alarm backlog degree is determined by the BMC proxy service based on key information of the alarm generated by the hard disk in the current time period, and then when the alarm triggering condition is met based on the alarm backlog degree, a read instruction is sent to the BMC proxy service, and the read instruction is used to instruct the BMC proxy service to obtain the alarm content of the alarm and obtain the alarm content transmitted by the BMC proxy service, thereby avoiding the frequent acquisition of alarm content in a short time and solving the problem of time consumption and system performance impact caused by frequent reading of alarm content in a short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0028] Figure 1 It is a hardware structure block diagram of a computer terminal according to a method for sending alarm content in an embodiment of the present application;
[0029] Figure 2 is a flow chart of a method for sending alarm content according to an embodiment of the present application;
[0030] Figure 3 is a structural block diagram of an optional alarm system according to an embodiment of the present application;
[0031] Figure 4 is a schematic diagram of the structure of an alarm chain table according to an embodiment of the present application;
[0032] Figure 5 It is a schematic diagram of a process for determining the degree of alarm backlog according to an embodiment of the present application;
[0033] Figure 6 It is a schematic diagram of a process of obtaining alarm content according to an embodiment of the present application;
[0034] Figure 7It is a schematic diagram of a process of cleaning an alarm chain list according to an embodiment of the present application;
[0035] Figure 8 This is a flowchart of processing an alarm according to an embodiment of the present application;
[0036] Fig. 9 It is a structural block diagram of a device for sending alarm content according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0039] The method for sending the alarm content provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal of a method for sending alarm content according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0040] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending alarm content in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0041] In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0042] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] Before explaining this application in detail, some of the terms involved are explained first:
[0044] RAID: (Redundant Array of Independent Disks). RAID is a technology that combines multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance than a single hard disk and providing data backup technology. To the user, the hard disk group looks like a hard disk, and the user can partition and format it.
[0045] BMC: (Baseboard Management Controller). It is an independent system that does not rely on other hardware on the system, nor does it rely on the BIOS (Basic Input / Output System) and operating system. It is used to manage the hardware on the server. It can provide remote out-of-band management.
[0046] BMC AGENT: It is a service module on the RAID card that directly connects to the BMC. There can be multiple communication buses with the BMC. This application is mainly based on the I2C bus. The main functions of BMC AGENT include receiving instructions from the BMC, collecting hardware data, issuing configuration commands, reporting alarms, etc.
[0047] I2C: (Inter-Integrated Circuit). A simple, bidirectional, two-wire synchronous serial bus. It only requires two wires to transmit information between devices connected to the bus. The serial data line SDA (serial data) is used to transmit data, and the serial clock line SCL (SCL data line) is used to control the timing of data transmission and reception.
[0048] RPC: (Remote Procedure Call), remote actually means the need for network communication, which can be understood as calling methods on remote machines. Here it refers to communication between different cores. Through RPC, inter-core communication can be achieved.
[0049] This embodiment provides a method for sending alarm content, and its execution subject includes but is not limited to the baseboard management controller BMC proxy service. The baseboard management controller BMC proxy service is set in the hard disk, and the hard disk can be the internal structure of the computer terminal. The baseboard management controller BMC proxy service (i.e., BMC proxy service) and the baseboard management controller BMC (i.e., BMC) are connected in communication. The baseboard management controller BMC can be independent of the hard disk or can be the internal structure of the hard disk. This embodiment of the application does not limit this. Figure 2 As shown, the process includes the following steps S202-S206:
[0050] Step S202: Acquire key information of alarms generated by the hard disk in the current time period, wherein the BMC agent service is set in the hard disk;
[0051] It should be noted that the current time period is used to represent the time range, which can be a set time interval, which can be 10 minutes, 1 hour, or 60 seconds. The time interval can be set according to the actual computing resources, alarm urgency, and alarm analysis requirements in the alarm processing process. The time interval can include a start time and an end time. The start time can be the time point when the alarm backlog is determined the most recently, and the end time can be the time when the set time interval is reached from the start time. For example, if 10:05 is the start time and the time interval is set to 10 minutes, 10:15 is the end time, and the BMC agent service can obtain the key information of the alarms generated by the hard disk from 10:05 to 10:15. The time interval can be set according to the actual computing resources, alarm urgency, and alarm analysis requirements in the alarm processing process.
[0052] In some embodiments, the key information may include various types of information such as the alarm identifier, alarm type, and alarm level of the alarm.
[0053] Step S204: transmitting the alarm backlog level in the current time period determined according to the key information to the BMC;
[0054] It should be noted that the alarm backlog level determined by the BMC proxy service can be actively sent to the BMC, or stored in a set storage structure and obtained by the BMC. The alarm backlog level is used to characterize the situation of the alarms that have not been processed. The alarm backlog level can be identified by a numerical value, such as a percentage, or by letters, feature codes, etc.
[0055] Optionally, the alarm backlog level may be expressed as a percentage, and a higher percentage indicates a higher alarm backlog level. The value may be, for example, 10 (%), 30 (%), 50 (%), etc.
[0056] In an exemplary embodiment, the transmitting the alarm backlog level within the current time period determined according to the key information to the BMC includes: storing the alarm backlog level in a preset storage structure, and the BMC acquiring it from the storage structure when an acquisition condition is met; or, directly sending the alarm backlog level to the BMC when a sending condition is met.
[0057] It should be noted that the acquisition condition is a condition set for the BMC, and the acquisition condition may be a condition that the BMC needs to meet when acquiring the alarm backlog level, for example, the acquisition condition is set based on time, number of acquisitions, etc.; the sending condition is a condition set for the BMC agent service, and the sending condition may be a condition that the BMC agent service needs to meet when sending the alarm backlog level, for example, the sending condition is set based on time, number of sendings, etc.
[0058] Specifically, the BMC proxy service may update the alarm backlog level in the current time period to a prepared monitoring information structure, which stores not only the alarm backlog level but also other monitoring information. When the BMC obtains the monitoring information, the alarm backlog level may be obtained at the same time.
[0059] Optionally, the communication between the BMC proxy service and the BMC is based on the I2C bus and is carried out in a master-slave mode, that is, the BMC initiates a query as a master device, and the BMC proxy service responds as a slave device. By storing the calculated alarm backlog level in the monitoring information structure, the BMC can obtain the alarm backlog level while obtaining the monitoring information, so that the BMC can obtain the alarm backlog level without intermittently querying the BMC proxy service, saving time and improving system performance.
[0060] In an exemplary embodiment, before step S204, it also includes: obtaining a first alarm linked list determined in a first time period before the current time period; writing the key information into the first alarm linked list to update the first alarm linked list to obtain a second alarm linked list in the current time period; and determining the degree of alarm backlog in the current time period based on the second alarm linked list.
[0061] Among them, the alarm linked list is a storage structure that stores the key information of the alarm through the node. The first alarm linked list is the alarm linked list determined in the first time period before the current time period; by writing the key information into the first alarm linked list, the second alarm linked list can be obtained. It should be noted that before the current time period, there is a historical time period, and the first time period is the previous time period of the current time period, that is, the first time period is the adjacent time period of the current time period.
[0062] Optionally, when the BMC proxy service is initialized, an initial alarm chain list may be created. When creating the initial alarm chain list, a first node may be set. When writing key information of an alarm, an alarm node is created to store the key information of the alarm, thereby repeatedly obtaining a first alarm chain list. The BMC proxy service obtains a second alarm chain list by writing the key information into the first alarm chain list.
[0063] In the above embodiment, by updating the first alarm chain list to obtain the second alarm chain list, the alarm backlog level in the current time period can be accurately calculated, thereby providing an accurate reference for the subsequent BMC to determine whether to obtain the alarm content, effectively improving system performance.
[0064] In an exemplary embodiment, determining the degree of alarm backlog in the current time period based on the second alarm linked list includes: determining the number of alarms in the second alarm linked list and the linked list capacity; and determining the quotient of the number of alarms and the linked list capacity as the degree of alarm backlog in the current time period.
[0065] That is, in this embodiment, the alarm quantity and linked list capacity of the second alarm can be determined. The alarm quantity can be determined by the number of alarm nodes in the second alarm linked list, that is, the number of alarms can be determined by judging how many alarm nodes there are; the linked list capacity is set when the initial alarm linked list is created, and the alarm quantity and the linked list capacity in the second alarm linked list are divided to obtain the quotient of the alarm quantity and the linked list capacity, and the quotient is determined as the alarm backlog level in the current time period. Optionally, the quotient can be expressed as a percentage.
[0066] In an exemplary embodiment, the writing of the key information into the first alarm linked list to update the first alarm linked list to obtain the second alarm linked list within the current time period also includes: determining the real-time storage capacity of the first alarm linked list; when it is determined that the real-time storage capacity meets the list cleaning condition, determining the target alarm node to be cleared from the first alarm linked list; and clearing the target alarm node from the first alarm linked list.
[0067] It should be noted that the real-time storage capacity is the current actual storage capacity of the first alarm linked list; the linked list cleaning condition refers to the set conditions for clearing the alarm node. When setting the linked list cleaning condition, it can be set in combination with the data scale supported by the computer terminal, linked list performance, etc.
[0068] Optionally, when it is determined that the real-time storage capacity does not meet the linked list cleaning conditions, indicating that the capacity of the linked list at this time can accommodate the writing of key information of the alarm, there is no need to carry out clearing processing, and the key information is directly written into the first alarm linked list to update the first alarm linked list.
[0069] In the above embodiment, before writing the key information of the alarm in the current time period into the first alarm chain list, it is determined whether cleaning is required to ensure that the first alarm chain list can accept new alarms reported in the current time period, thereby preventing the problem of alarm loss.
[0070] In an exemplary embodiment, when it is determined that the real-time storage capacity satisfies the linked list cleaning conditions, the target alarm nodes to be cleared are determined from the first alarm linked list, including: when the real-time storage capacity reaches a set capacity threshold, obtaining the alarm backlog level in the current time period and the alarm backlog level in a first time period before the current time period; determining the number of target alarm nodes to be cleared based on the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period; and determining the number of target alarm nodes to be cleared from the first alarm linked list.
[0071] The capacity threshold is the maximum capacity or a specific limit of the capacity that the first alarm chain list can reach or withstand.
[0072] Optionally, when the BMC proxy service determines that the real-time storage capacity has reached a set capacity threshold, such as when it reaches an upper limit of 95%, the "aging" mechanism is turned on, and the percentage of linked list aging is calculated based on the alarm backlog level in the current time period and the alarm backlog level in the first time period. The alarm node at the front end of the linked list is "aged" with this percentage, so that new alarms reported at this rate can be accepted without being lost easily.
[0073] Optionally, the BMC agent service can determine the number of target alarm nodes to be cleared based on the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period, and further select the alarm nodes corresponding to the key information with an earlier writing time as the target alarm nodes according to the time when the key information is written into the first alarm linked list.
[0074] Optionally, the BMC agent service can determine the number of target alarm nodes to be cleared based on the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period, and further, according to the urgency of the alarm indicated by the key information, give priority to selecting the alarm nodes corresponding to the key information indicating a lower urgency of the alarm, and determine them as the target alarm nodes, thereby improving the security of the hard disk.
[0075] In the above embodiment, the target alarm nodes to be cleared are deleted through the alarm linked list "aging" mechanism, which can release linked list resources and reduce storage pressure. When the storage pressure is reduced, the performance of the computer terminal can be optimized, thereby improving the efficiency of sending alarm content.
[0076] Step S206: acquiring the alarm content of the alarm according to the read instruction sent by the BMC, and transmitting the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it is determined that the backlog level of the received alarms meets the alarm triggering condition, and the read instruction is used to instruct the BMC agent service to acquire the alarm content of the alarm and transmit the alarm content to the BMC;
[0077] In an exemplary embodiment, obtaining the alarm content of the alarm according to the read instruction sent by the BMC includes: determining whether the remaining cache of the BMC agent service meets the capacity condition; when it is determined that the remaining cache meets the capacity condition, calling the alarm interface provided by the alarm module in the hard disk according to the read instruction sent by the BMC; obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information.
[0078] It should be noted that the cache of the BMC proxy service is the buffer (buffer) used by the BMC proxy service to store the alarm content of the alarm; the remaining cache of the BMC proxy service is the part of the cache that has not yet stored the alarm content. The capacity condition is used to determine whether the remaining cache of the buffer meets the storage standard conditions. The storage standard is set according to the actual alarm scenario and requirements. For example, when the remaining cache of the buffer is insufficient to store the alarm content of an alarm, it means that the storage standard is not met and the capacity condition is not met. Otherwise, it means that the capacity condition is met. For another example, when the remaining cache of the buffer is insufficient to store the alarm content of two alarms, it means that the storage standard is not met and the capacity condition is not met. Otherwise, it means that the capacity condition is met.
[0079] Optionally, the alarm content of the alarm may include SN (Serial Number), opcode (operation code), level (level), description (comment), time (time) and the like.
[0080] In an exemplary embodiment, the method further includes: when it is determined that the remaining cache does not meet the capacity condition, directly extracting the alarm content of the alarm from the cache of the BMC agent service.
[0081] It is understandable that when it is determined that the remaining cache does not meet the capacity condition, it means that a large amount of alarm content is stored in the buffer of the BMC proxy service, and the BMC proxy service can directly obtain the alarm content of the alarm from the cache without obtaining it from the alarm module.
[0082] Optionally, when the BMC proxy service obtains the alarm content of the alarm from the buffer, it can perform a matching query from the buffer through the key information, determine the target key information that matches the key information, and transmit the alarm content that matches the target key information to the BMC. When the BMC proxy service transmits the alarm content that matches the target key information to the BMC, it can perform sub-packaging processing on the alarm content that matches the target key information, obtain the sub-packaging processing result, wait for the BMC to actively read, or directly send the sub-packaging processing result to the BMC.
[0083] Optionally, after transmitting the alarm content in the buffer that matches the target key information to the BMC, the BMC proxy service can delete the relevant alarm node in the second alarm chain list based on the transmitted alarm content to obtain the second alarm chain list after deleting the alarm node. By deleting the second alarm chain list after the alarm node, the number of alarms that have not been transmitted to the BMC is determined, and according to the number of alarms that have not been transmitted to the BMC and the chain list capacity of the second alarm chain list, a new alarm backlog level is calculated, and the new alarm backlog level is transmitted to the BMC.
[0084] In an exemplary embodiment, the key information includes the alarm identifier of the alarm; obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information includes: when the alarm module has been connected to the alarm module through the alarm interface, searching the alarm module for a target alarm identifier that matches the alarm identifier; and obtaining the alarm content associated with the target alarm identifier from the alarm module.
[0085] Specifically, the BMC proxy service calls the alarm interface provided by the alarm module to obtain the alarm content, connects to the alarm module through the alarm interface, and then obtains the specific alarm content from the FlashDB (ultra-lightweight database) of the alarm module and puts it into the buffer of the BMC proxy service.
[0086] In an exemplary embodiment, transmitting the alarm content to the BMC includes: subpackaging the alarm content to obtain a subpackaging result, storing the subpackaging result in a cache of the BMC agent service, and having the BMC read the subpackaging result from the cache; or, subpackaging the alarm content to obtain a subpackaging result, and directly sending the subpackaging result to the BMC.
[0087] It is understandable that when the BMC proxy service transmits the alarm content obtained from the FlashDB of the alarm module to the BMC, it can sub-packetize the alarm content obtained from the FlashDB, obtain the sub-packetization result, and store the sub-packetization result in the cache, waiting for the BMC to actively read it, or directly send the sub-packetization result to the BMC.
[0088] In an exemplary embodiment, the BMC proxy service is connected to an alarm module set in the hard disk; the acquisition of key information of the alarm generated by the hard disk in the current time period includes: acquiring the recorded alarm pass rate of the alarm module in the current time period; when it is determined that the alarm pass rate reaches a first pass rate threshold, sending a first prompt instruction to the alarm module; the first prompt instruction is used to instruct the alarm module to send key information of critical alarms to the BMC proxy service; and obtaining key information of critical alarms generated by the hard disk in the current time period.
[0089] It should be noted that in order to prevent the alarm module from reporting a large number of frequent alarms suddenly, which would cause the performance of the BMC proxy service module to deteriorate, flow control is implemented for the alarm module. Specifically, for the alarm module, a second timer is enabled, and the alarm pass rate of the alarm module is recorded in real time through the second timer. The alarm pass rate can be used to represent the number of alarms reported by the alarm module to the BMC proxy service. Each time the alarm module reports an alarm to the BMC proxy service, the alarm pass rate will increase. The first pass rate threshold is the limit set for flow control. When the alarm pass rate reaches the first pass rate threshold, measures need to be taken.
[0090] Optionally, the first pass rate threshold can be determined based on the circulation base value. The circulation base value indicates the number of alarms allowed to be uploaded in the current time period, and the circulation base value can be set based on the performance of the BMC, the reporting scenario of the alarm, etc. Each time the alarm module reports an alarm, the circulation base value is reduced by 1 until the circulation base value is 0 and the alarm module is prohibited from reporting alarms. For example, taking the current time period as an example, if the circulation base value is set to 100, the first pass rate threshold can be set to 50%, that is, 50 alarms have been uploaded in the first time period, and the first pass rate threshold is determined when the circulation base value is reduced to 50; if the circulation base value is set to 100, the first pass rate threshold can be set to 90%, that is, 90 alarms have been uploaded in the first time period, and the first pass rate threshold is determined when the circulation base value is reduced to 10.
[0091] Optionally, each time the alarm module reports an alarm, the circulation base value decreases by 1 until the circulation base value reaches 0 and the alarm module is prohibited from reporting an alarm; when the time recorded by the second timer reaches the time threshold, the circulation base value is restored to the initial value and reporting is allowed again.
[0092] Optionally, in the process of sending the alarm generated in the current time period to the BMC proxy service, the alarm module obtains the alarm pass rate of the alarm module recorded by the second timer, compares the alarm pass rate with the first alarm pass rate threshold, and then determines whether a traffic overflow occurs. If no traffic overflow occurs, the BMC proxy service can directly obtain the key information of the alarm generated by the hard disk in the current time period; if a traffic overflow occurs, the BMC proxy service can send a first prompt instruction to the alarm module, instructing the alarm module to send the key information of a key alarm, where the key alarm can be an emergency alarm.
[0093] It is understandable that when the BMC proxy service determines that traffic overflow has occurred in the current time period, such as when the alarm pass rate of the alarm module in the first time period has reached 90%, it will reversely notify the alarm module that flow control is about to occur, allowing emergency alarms to be reported in advance. At this time, the alarm module will give priority to sending emergency alarms, and the BMC will also give priority to obtaining the alarm content of emergency alarms, so that the BMC can give priority to processing emergency alarms and improve the security of the hard disk.
[0094] In an exemplary embodiment, the method further includes: obtaining the recorded alarm pass rate of the alarm module in the current time period, and the alarm pass rate of the alarm module in the historical time period before the current time period; the historical time period includes at least a first time period and a second time period; the alarm pass rate of the current time period is determined according to the key information of the alarm sent by the alarm module to the BMC agent service in the current time period; when it is determined that the alarm pass rate of the current time period, the alarm pass rate of the first time period, and the alarm pass rate of the second time period all reach a second pass rate threshold, sending a second prompt instruction to the alarm module to instruct the alarm module to suspend sending the key information of the alarm generated in the current time period; wherein the second pass rate threshold is obtained by increasing the first pass rate threshold when the alarm pass rates of the alarm module obtained N times in a row all reach the first pass rate threshold, wherein N is a positive integer.
[0095] It is understandable that the second time period is the previous time period of the first time period. Of course, when obtaining the alarm pass rate of the historical time period, it can include but is not limited to obtaining only the alarm pass rate of the first time period and the second time period.
[0096] Specifically, the BMC agent service compares the alarm pass rate of the current time period, the alarm pass rate of the first time period, and the alarm pass rate of the second time period with the second pass rate threshold. When it is determined that the three alarm pass rates have reached the second pass rate threshold, it indicates that the alarm module has multiple, large, and frequent alarm burst reports, or burst flow control. At this time, the alarm module can be instructed to suspend sending key information of alarms generated in the current time period.
[0097] Optionally, when the alarm pass rate of the alarm module obtained for three consecutive times reaches the first pass rate threshold, the first pass rate threshold may be increased to obtain a second pass rate threshold; the second pass rate threshold may be determined based on the maximum value of the alarm pass rates recorded three times, or the second pass rate threshold may be determined based on the average of the alarm pass rates recorded three times. The embodiments of the present application are not limited here.
[0098] In the above steps, the key information of the alarm generated by the hard disk in the current time period is obtained, and then the alarm backlog level in the current time period determined by the key information is transmitted to the BMC, and then the alarm content of the alarm is obtained according to the read instruction sent by the BMC when it is determined that the received alarm backlog level meets the alarm triggering condition, and the alarm content is sent to the BMC. Since the BMC proxy service can determine the alarm backlog level, the BMC can determine whether to send a read instruction based on the obtained alarm backlog level, thereby avoiding the situation where the BMC needs to read the alarm content frequently, and solves the problem of frequent reading of alarm content in a short period of time, which wastes time and affects system performance.
[0099] In an exemplary embodiment, the present application also provides a method for obtaining alarm content, which is applied to a baseboard management controller BMC, including: obtaining the alarm backlog level; wherein the alarm backlog level is determined by a BMC agent service based on obtaining key information of alarms generated by the hard disk in a current time period; when an alarm trigger condition is met based on the alarm backlog level, a read instruction is sent to the BMC agent service, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC; obtain the alarm content transmitted by the BMC agent service.
[0100] In an exemplary embodiment, obtaining the alarm backlog level includes: obtaining the alarm backlog level from a set storage structure when an acquisition condition is met, or receiving the alarm backlog level sent by the BMC agent service to the BMC when a sending condition is met.
[0101] In an exemplary embodiment, obtaining the alarm content transmitted by the BMC proxy service includes: obtaining a subpackaging result from a cache of the BMC proxy service, and determining the subpackaging result as the alarm content; wherein the subpackaging result is stored in the cache after the BMC proxy service subpackages the alarm content, or directly obtaining the subpackaging result sent by the BMC proxy service.
[0102] The above-mentioned method for obtaining alarm content obtains the alarm backlog degree through BMC; wherein, the alarm backlog degree is determined by the BMC proxy service based on key information of the alarm generated by the hard disk in the current time period, and then when the alarm triggering condition is met based on the alarm backlog degree, a read instruction is sent to the BMC proxy service, and the read instruction is used to instruct the BMC proxy service to obtain the alarm content of the alarm and obtain the alarm content transmitted by the BMC proxy service, thereby avoiding frequent acquisition of alarm content in a short time and solving the problem of time consumption and system performance impact caused by frequent reading of alarm content in a short time.
[0103] Obviously, the above-described embodiments are only embodiments of a part of the present invention, rather than all embodiments. In order to better understand the above method, the above process is described below in conjunction with embodiments, but it is not intended to limit the technical solutions of the embodiments of the present invention, specifically:
[0104] refer to Figure 3 As shown, it is a structural block diagram of the RAID alarm system involved in the present application. The method for sending the alarm content of the present application can be implemented based on the alarm system. Figure 3 It includes three modules: baseboard management controller (BMC), redundant array of independent disks (RAID card) and array. The RAID card is composed of alarm module (Alarm module) and baseboard management controller agent service (BMC agent service (BMC AGENT)). The alarm module and BMC AGENT communicate through RPC channel, BMC and RAID card can communicate through I2C channel, BMC AGENT can send alarm backlog level to BMC, and BMC can read alarm content from BMC AGENT.
[0105] Step 1: When an abnormality occurs in the array, an alarm is reported. The alarm is received by the Alarm module of the RAID card and saved in the storage FlashDB of the Alarm module. The alarm content of the alarm is stored here, which includes detailed information of the alarm, such as SN, opcode, level, description, time, etc. The memory overhead of a single piece of information is relatively large.
[0106] Step 2: The Alarm module reports only the key information of the alarm to the BMC AGENT through the RPC channel. The key information may include the alarm SN, which is the unique identifier of the alarm, and the alarm operation code (add\restore) and alarm level (Critical\Major\Minor\Warning);
[0107] Step 3: BMC AGENT will create an alarm list during initialization: alarm_key_list, which will store the key information of the alarms reported by the Alarm module. Figure 4 As shown in the figure, it is a structural diagram of the alarm chain list: when creating the alarm chain list, a first node will be created. Figure 4 The alarm chain list is composed of multiple alarm nodes, alarm node 1, alarm node 2, ... alarm node n, etc. Among them, Node represents the alarm node, that is, Figure 4 It includes multiple alarm nodes such as Node1, Node2, Node3...Node n, the key information of the alarm (i.e. key info), the alarm backlog level (i.e. PCT), and the percentage of the number of alarms in the alarm chain list to the chain list capacity, which can be represented by the report flag reportflag.
[0108] Step 4: Reference Figure 5 As shown in the figure, it is a flowchart for determining reportflag: the Alarm module calls the RPC interface provided by BMC AGENT to report key info. When BMC AGENT obtains new key information, it will hang keyinfo in the alarm chain list and update reportflag. Reportflag is equal to the percentage PCT of the existing alarm quantity to the chain list capacity, PCT = alarm quantity / chain list capacity. Reportflag can be updated regularly to the monitoring information structure prepared by BMC AGENT, or it can be sent directly to BMC by BMC AGENT. In this way, BMC does not need to query alarms frequently. By carrying reportflag, it can quickly inform BMC to obtain alarm content. With PCT mode as an identifier, BMCAGENT updates its value in real time, such as 10 (%), 30 (%), 50 (%), etc. The increment can enable BMC to use this as a measure of the degree of alarm backlog and speed up the reading speed.
[0109] Step 5: After obtaining the reportflag, the BMC can send a read command based on the reportflag. Figure 6As shown in the figure, it is a flowchart for obtaining alarm content. For example, when BMC recognizes that reportflag is not 0, it determines that there are still alarms that have not been fully reported, and can send a read instruction to obtain the alarm content to BMC AGENT. After receiving the read instruction, BMC AGENT parses the read instruction to determine the reporting flag, that is, whether reportflag is 0. When it is 0, the process ends. When it is not 0, it determines whether its own buffer is sufficient. When its own buffer is sufficient, it will call the interface for obtaining key information provided by the Alarm module, and based on key info, obtain the specific alarm content corresponding to key info, put it into the buffer of BMC AGENT, and delete the alarm node corresponding to the key info in the alarm chain list. Determine whether the current node has reached the first node of the alarm chain list. If so, reportflag can be set to 0, and the alarm content in the buffer of BMC AGENT can be sub-packaged, and the sub-packaged result obtained by the sub-package processing is sent to BMC. If the first node of the alarm chain list has not been reached yet, the alarm content can continue to be obtained. When the buffer itself is insufficient, the alarm content is directly extracted from the buffer itself and sent to the BMC in multiple packets. It is understandable that the buffer space of the BMC AGENT is limited. If there is too much alarm content to store, it needs to be identified: when the remaining space in the buffer is insufficient to store a complete alarm content, it is necessary to stop obtaining alarms, update the report flag reportflag to the PCT of the remaining alarm number occupying the chain list capacity, and wait for the next acquisition; if all alarms are obtained, reportflag will be returned to 0.
[0110] refer to Figure 7 As shown, this application will also clean the alarm chain list. Under normal circumstances, BMC can read all the alarms on the alarm chain list, but there are two abnormal situations that will cause the chain list capacity to exceed the limit. One is that BMC fails to obtain the alarms in time due to unknown reasons, resulting in backlog; the other is that the alarm reporting rate is too fast. For the above situation, this method designs a chain list "aging" mechanism to delete alarms that have not been read for a long time, and new alarms can be added. The specific mechanism is as follows: When BMC AGENT determines that the alarm ratio has reached the upper limit of 95%, the aging mechanism is turned on. According to the most recent PCT1 (that is, the latest determined alarm backlog level) and the last PCT2 (that is, the historical alarm backlog level), the percentage of chain list aging Percent = PCT1-PCT2 is calculated, and the alarm nodes at the front end of the chain list are "aged" with this percentage, so that new alarms reported at this rate can be accepted without being lost.
[0111] Step 6: In order to prevent the Alarm module from reporting a large number of frequent alarms suddenly, which would cause the performance of the BMC AGENT to deteriorate, this application also provides a flow control mechanism. Enable a second timer, and update the base value of totalnums of the alarms allowed to pass every second. Every time an alarm is reported, totalnums decreases by 1 until totalnums reaches 0, which prohibits reporting alarms. After the second timer times out, totalnums returns to the initial value and reporting is allowed again. The base value of totalnums can be set through the BMC. Reference Figure 8 As shown, in order to maintain the stability of the system and keep the integrity of the alarm to the maximum extent, the present application has designed the following two mechanisms: 1. In the case of alarm reporting, when the timer records that the alarm pass rate has reached 90% of the circulation base value totalnums, it will reversely notify the Alarm module that flow control is about to occur, allowing emergency alarms to be reported in advance. At this time, the Alarm module will give priority to sending emergency alarms, and the BMC AGENT will obtain them first; when it is lower than 90% of the circulation base value totalnums, the Alarm module can be restored to report in sequence according to the alarm time; 2. When the timer records that the base value has overflowed for three consecutive times, resulting in flow control, the BMC AGENT will automatically expand the circulation base value. The new circulation base value new_totalnums=MAX(T1,T2,T3). T1 / T2 / T3 is the total alarm amount when there are three consecutive overflows. The default is that the business reports the alarm flow normally (fuzzy matching). If flow control occurs again, if the capacity is 0, it is considered to be a sudden flow control, and the capacity will no longer be expanded. The alarm will be discarded and the log will be recorded. If the capacity is not 0, the alarm passes. If the timer detects that the total alarm amount is lower than totalnums for three consecutive times, the circulation base value is restored to the initial totalnums.
[0112] The method for sending alarm content proposed in this application is to use only the linked list structure to manage the key information of the reported alarm (such as alarm SN / operation code / level, etc.) instead of the detailed information of the entire alarm, which can save a lot of memory space; in order to enable the BMC to quickly perceive and obtain key information, this application adopts a method of carrying a dynamic PCT alarm identifier, that is, the degree of alarm backlog, with the monitoring information, so that the BMC can be notified of the alarm backlog in the first time without the BMC making regular inquiries. In addition, in order to ensure that the capacity of the linked list does not overflow, an "aging" mechanism is designed to prevent the loss of new alarms due to insufficient capacity. This application also designs an alarm flow control function, so that emergency alarms can be reported in a timely manner, and the alarm rate can be elastically expanded to prevent the sudden alarm from affecting the performance of BMCAGENT.
[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0114] In the present embodiment, a sending device for alarm content is also provided, which is used to implement the above-mentioned embodiment and preferred implementation mode, and the descriptions have been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the modules described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0115] Fig. 9 : is a structural block diagram of a device for sending alarm content according to an embodiment of the present application, the device comprising:
[0116] The information acquisition module 902 is used to acquire key information of the alarm generated by the hard disk in the current time period, wherein the BMC agent service is set in the hard disk;
[0117] A transmission module 904, configured to transmit the alarm backlog level in the current time period determined according to the key information to the BMC;
[0118] The transmission module 904 is further used to obtain the alarm content of the alarm according to the read instruction sent by the BMC, and transmit the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it determines that the backlog level of the received alarms meets the alarm trigger condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the transmission module of the BMC.
[0119] The above device obtains the key information of the alarm generated by the hard disk in the current time period, and then transmits the alarm backlog level in the current time period determined by the key information to the BMC, and then obtains the alarm content of the alarm according to the read instruction sent by the BMC when it determines that the received alarm backlog level meets the alarm triggering condition, and sends the alarm content to the BMC. Since the BMC proxy service can determine the alarm backlog level, the BMC can determine whether to send a read instruction based on the obtained alarm backlog level, thereby avoiding the situation where the BMC needs to read the alarm content frequently, and solves the problem of frequent reading of alarm content in a short period of time, which wastes time and affects system performance.
[0120] In an exemplary embodiment, the transmission module 904 is further used to store the alarm in a preset storage structure, and the BMC obtains the alarm from the storage structure when the acquisition condition is met; or, when the sending condition is met, directly send the alarm backlog level to the BMC.
[0121] In an exemplary embodiment, the device also includes a determination module; the determination module is used to obtain a first alarm linked list determined in a first time period before the current time period; write the key information into the first alarm linked list to update the first alarm linked list to obtain a second alarm linked list in the current time period; determine the degree of alarm backlog in the current time period based on the second alarm linked list.
[0122] In an exemplary embodiment, the determination module is further used to determine the number of alarms in the second alarm linked list and the capacity of the linked list; and determine the quotient of the number of alarms and the capacity of the linked list as the alarm backlog level in the current time period.
[0123] In an exemplary embodiment, the device also includes a cleaning module; the cleaning module is used to determine the real-time storage capacity of the first alarm linked list; when it is determined that the real-time storage capacity meets the linked list cleaning condition, determine the target alarm node to be cleared from the first alarm linked list; and clear the target alarm node from the first alarm linked list.
[0124] In an exemplary embodiment, the cleaning module is also used to obtain the alarm backlog level in the current time period and the alarm backlog level in a first time period before the current time period when the real-time storage capacity reaches a set capacity threshold; determine the number of target alarm nodes to be cleared based on the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period; and determine the number of target alarm nodes to be cleared from the first alarm linked list.
[0125] In an exemplary embodiment, the device also includes a reading module; the reading module is used to determine whether the remaining cache of the BMC proxy service meets the capacity condition; the capacity condition refers to the condition used to determine whether the remaining cache of the BMC proxy service meets the storage standard; when it is determined that the remaining cache meets the capacity condition, calling the alarm interface provided by the alarm module in the hard disk according to the read instruction sent by the BMC; obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information.
[0126] In an exemplary embodiment, the reading module is further configured to directly extract the alarm content of the alarm from the cache of the BMC agent service when it is determined that the remaining cache does not meet the capacity condition.
[0127] In an exemplary embodiment, the key information includes the alarm identifier of the alarm; the reading module is also used to search for a target alarm identifier matching the alarm identifier in the alarm module when the alarm module has been connected to the alarm module through the alarm interface; and obtain the alarm content associated with the target alarm identifier from the alarm module.
[0128] In an exemplary embodiment, the transmission module 904 is also used to subpacketize the alarm content, obtain a subpacketization result, store the subpacketization result in a cache of the BMC agent service, and the BMC reads the subpacketization result from the cache; or, subpacketize the alarm content, obtain a subpacketization result, and directly send the subpacketization result to the BMC.
[0129] In an exemplary embodiment, the information acquisition module 902 is used to obtain the recorded alarm pass rate of the alarm module in the current time period; the alarm pass rate is determined based on the key information of the alarm sent by the alarm module to the BMC agent service in the current time period; when it is determined that the alarm pass rate reaches a first pass rate threshold, a first prompt instruction is sent to the alarm module; the first prompt instruction is used to instruct the alarm module to send key information of key alarms to the BMC agent service; and key information of key alarms generated by the hard disk in the current time period is obtained.
[0130] In an exemplary embodiment, the information acquisition module 902 is also used to obtain the recorded alarm pass rate of the alarm module in the current time period, and the alarm pass rate of the alarm module in the historical time period before the current time period; the historical time period includes at least a first time period and a second time period; the alarm pass rate of the current time period is determined according to the key information of the alarm sent by the alarm module to the BMC agent service in the current time period; when it is determined that the alarm pass rate of the current time period, the alarm pass rate of the first time period and the alarm pass rate of the second time period all reach a second pass rate threshold, a second prompt instruction is sent to the alarm module to instruct the alarm module to suspend sending the key information of the alarm generated in the current time period; wherein the second pass rate threshold is obtained by increasing the first pass rate threshold when the alarm pass rates of the alarm module obtained N times in a row all reach the first pass rate threshold, wherein N is a positive integer.
[0131] In this embodiment, a device for obtaining alarm content is also provided, including a degree acquisition module, which is used to obtain the alarm backlog degree; wherein the alarm backlog degree is determined by the BMC agent service based on key information of the alarm generated by the hard disk in the current time period; an indication module, which is used to send a read instruction to the BMC agent service when an alarm trigger condition is met based on the alarm backlog degree, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC; a content acquisition module, which is used to obtain the alarm content transmitted by the BMC agent service.
[0132] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0133] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0134] Optionally, in this embodiment, the computer program may be configured to perform the following steps by means of the computer program:
[0135] S1, obtaining key information of alarms generated by a hard disk in a current time period, wherein the BMC agent service is set in the hard disk;
[0136] S2, transmitting the alarm backlog level in the current time period determined according to the key information to the BMC;
[0137] S3, obtaining the alarm content of the alarm according to the read instruction sent by the BMC, and transmitting the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it determines that the backlog level of the received alarms meets the alarm triggering condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
[0138] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0139] An embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the steps in any one of the above method embodiments through the computer program.
[0140] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0141] S1, obtaining key information of alarms generated by a hard disk in a current time period, wherein the BMC agent service is set in the hard disk;
[0142] S2, transmitting the alarm backlog level in the current time period determined according to the key information to the BMC;
[0143] S3, obtaining the alarm content of the alarm according to the read instruction sent by the BMC, and transmitting the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it determines that the backlog level of the received alarms meets the alarm triggering condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
[0144] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0145] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the alarm content sending method, alarm content acquisition method, alarm content sending device, and alarm content acquisition device in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned alarm content sending method. The memory may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0146] In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Specifically, the memory may be used, but is not limited to, to store information such as system configuration files.
[0147] In addition, the electronic device mentioned above further includes: a display; and a connection bus for connecting various module components in the electronic device mentioned above.
[0148] In other embodiments, the electronic device may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0149] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0150] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0151] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0152] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0153] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for sending alarm content, applied to a baseboard management controller BMC agent service, characterized in that: include: Acquire key information of alarms generated by a hard disk in a current time period, wherein the BMC agent service is set in the hard disk; Obtaining a first alarm chain list determined in a first time period before the current time period; Writing the key information into the first alarm chain list to update the first alarm chain list and obtain a second alarm chain list within the current time period; Determine the alarm backlog level within the current time period based on the second alarm chain list; transmitting the alarm backlog level to the BMC; The alarm content of the alarm is obtained according to the read instruction sent by the BMC, and the alarm content is transmitted to the BMC, wherein the read instruction is an instruction sent by the BMC when it is determined that the backlog level of the received alarms meets the alarm triggering condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
2. The method according to claim 1, characterized in that The step of transmitting the alarm backlog level in the current time period determined according to the key information to the BMC includes: The alarm backlog level is stored in a preset storage structure, and the BMC obtains the alarm from the storage structure when an acquisition condition is met; or, When the sending condition is met, the alarm backlog level is directly sent to the BMC.
3. The method according to claim 1, characterized in that The determining, based on the second alarm chain list, the alarm backlog level in the current time period includes: Determine the number of alarms in the second alarm chain list and the chain list capacity; The quotient of the alarm quantity and the linked list capacity is determined as the alarm backlog level in the current time period.
4. The method according to claim 1, characterized in that: Before the key information is written into the first alarm chain list to update the first alarm chain list and obtain the second alarm chain list within the current time period, the method further includes: Determining the real-time storage capacity of the first alarm chain list; In the case where it is determined that the real-time storage capacity meets the linked list cleaning condition, determining a target alarm node to be cleared from the first alarm linked list; The target alarm node is cleared from the first alarm linked list.
5. The method according to claim 4, characterized in that The step of determining a target alarm node to be cleared from the first alarm linked list when it is determined that the real-time storage capacity satisfies the linked list cleaning condition comprises: When the real-time storage capacity reaches a set capacity threshold, obtaining the alarm backlog level in the current time period and the alarm backlog level in a first time period before the current time period; Determining the number of target alarm nodes to be cleared according to the difference between the alarm backlog level in the current time period and the alarm backlog level in the first time period; Determine the number of target alarm nodes to be cleared from the first alarm linked list.
6. The method according to claim 1, characterized in that The obtaining the alarm content of the alarm according to the read instruction sent by the BMC includes: Determine whether the remaining cache of the BMC proxy service meets a capacity condition; the capacity condition refers to a condition for determining whether the remaining cache of the BMC proxy service meets a storage standard; When it is determined that the remaining cache meets the capacity condition, calling an alarm interface provided by an alarm module in the hard disk according to a read instruction sent by the BMC; The alarm content of the alarm is obtained from the alarm module through the alarm interface and the key information.
7. The method according to claim 6, characterized in that The method further comprises: When it is determined that the remaining buffer does not satisfy the capacity condition, the alarm content of the alarm is directly extracted from the buffer of the BMC agent service.
8. The method according to claim 6, characterized in that The key information includes the alarm identifier of the alarm; The obtaining the alarm content of the alarm from the alarm module through the alarm interface and the key information includes: In the case where the alarm module is connected via the alarm interface, searching the alarm module for a target alarm identifier that matches the alarm identifier; Acquire the alarm content associated with the target alarm identifier from the alarm module.
9. The method according to claim 1, characterized in that: The transmitting the alarm content to the BMC includes: Subpackaging the alarm content to obtain a subpackaging result, storing the subpackaging result in a cache of the BMC proxy service, and having the BMC read the subpackaging result from the cache; or, The alarm content is sub-packed to obtain a sub-packaging result, and the sub-packaging result is directly sent to the BMC.
10. The method according to claim 1, characterized in that The BMC proxy service is connected to an alarm module set in the hard disk; the key information of the alarm generated by the hard disk in the current time period is obtained, including: Acquire the recorded alarm pass rate of the alarm module in the current time period; the alarm pass rate is determined according to key information of the alarms sent by the alarm module to the BMC agent service in the current time period; When it is determined that the alarm pass rate reaches a first pass rate threshold, sending a first prompt instruction to the alarm module; the first prompt instruction is used to instruct the alarm module to send key information of the critical alarm to the BMC agent service; Acquire key information of key alarms generated by the hard disk within the current time period.
11. The method according to claim 1, characterized in that: The BMC proxy service is connected to an alarm module set in the hard disk; the method also includes: Obtaining the recorded alarm pass rate of the alarm module in the current time period, and the alarm pass rate of the alarm module in the historical time period before the current time period; the historical time period includes at least a first time period and a second time period; the alarm pass rate of the current time period is determined according to the key information of the alarm sent by the alarm module to the BMC agent service in the current time period; When it is determined that the alarm pass rate of the current time period, the alarm pass rate of the first time period, and the alarm pass rate of the second time period all reach the second pass rate threshold, a second prompt instruction is sent to the alarm module to instruct the alarm module to suspend sending key information of the alarm generated in the current time period; wherein the second pass rate threshold is obtained by increasing the first pass rate threshold when the alarm pass rates of the alarm module obtained for N consecutive times all reach the first pass rate threshold, wherein N is a positive integer.
12. A method for obtaining alarm content, applied to a baseboard management controller BMC, characterized in that: include: Get the alarm backlog level; When an alarm triggering condition is met based on the alarm backlog level, a read instruction is sent to the BMC proxy service, wherein the read instruction is used to instruct the BMC proxy service to obtain the alarm content of the alarm and transmit the alarm content to the baseboard management controller BMC; Obtaining alarm content transmitted by the BMC agent service; Among them, the alarm backlog level is determined by the BMC agent service in the following manner: obtaining a first alarm linked list determined in a first time period before the current time period; writing key information of the alarm generated by the hard disk in the current time period into the first alarm linked list to update the first alarm linked list to obtain a second alarm linked list in the current time period; and determining the alarm backlog level in the current time period based on the second alarm linked list.
13. A device for sending alarm content, characterized in that: include: An information acquisition module, used to acquire key information of alarms generated by a hard disk in a current time period, wherein a BMC agent service is provided in the hard disk; A determination module, configured to obtain a first alarm chain list determined in a first time period before the current time period; write the key information into the first alarm chain list to update the first alarm chain list to obtain a second alarm chain list in the current time period; and determine the alarm backlog degree in the current time period based on the second alarm chain list; A transmission module, used for transmitting the alarm backlog level to the BMC; The transmission module is further used to obtain the alarm content of the alarm according to the read instruction sent by the BMC, and transmit the alarm content to the BMC, wherein the read instruction is an instruction sent by the BMC when it is determined that the backlog level of the received alarms meets the alarm triggering condition, and the read instruction is used to instruct the BMC agent service to obtain the alarm content of the alarm and transmit the alarm content to the BMC.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 11, or the steps of the method described in claim 12.
Citation Information
Patent Citations
Table space automatic alarm method and terminal device
CN109165146A
Information acquisition method of storage module and related device
CN116521574A