Fault reporting method, electronic equipment, medium and computer program product
By writing fault diagnosis information into shared memory in the BIOS and having it read by the BMC, the problem of excessively long SMI time caused by the IPMI byte limit is solved, improving data transmission efficiency and system stability.
Patent Information
- Application Number
- CN202411523541.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In existing technologies, the number of bytes that IPMI can send for fault diagnosis information is limited, which leads to multiple calls to SMI, resulting in excessively long SMI times and affecting business continuity.
The fault diagnosis information is written to a designated area of shared memory via the BIOS, and SMI is stopped after the writing is completed. The information is then read from the shared memory using the BMC, avoiding the need to call IPMI.
It shortened the SMI time, improved data transmission efficiency and reliability, reduced business fluctuations, and ensured the stability and continuous availability of the system.
Smart Images

Figure CN119046050A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a fault reporting method, electronic equipment, medium and computer program product. Background Art
[0002] Currently, in various application scenarios of servers, there is a constant need for optimization and update of fault diagnosis reporting. In related technologies, IPMI (Intelligent Platform Management Interface) is used to send fault diagnosis information in registers to BMC. However, IPMI has a byte limit. If the fault diagnosis information exceeds the maximum number of bytes that IPMI can send at a time, IPMI needs to be called multiple times. However, IPMI calls are made in the SMI (System Management Interrupt) state. Multiple IPMI calls will cause the SMI time to be too long, which will affect the customer's business continuity. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a fault reporting method, electronic device, medium and computer program product. The technical solution of the present disclosure is as follows: According to a first aspect of an embodiment of the present disclosure, a fault reporting method is provided, including: In the event of a device failure within the system, a system management interruption is triggered; Obtaining fault diagnosis information from a register corresponding to the device through a basic input and output system; Writing the fault diagnosis information into a designated area of a shared memory through the basic input and output system; After the fault diagnosis information is written into the designated area of the shared memory, stopping the system management interrupt; The control substrate management controller reads the fault diagnosis information from a designated area of the shared memory.
[0004] Optionally, it also includes: After the system is powered on, using the baseboard management controller to allocate the shared memory; Mapping the shared memory to a basic input / output system memory; the basic input / output system and the baseboard management controller can access the shared memory; A portion of the shared memory is determined as a designated area of the shared memory.
[0005] Optionally, the designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; and writing the fault diagnosis information into the designated area of the shared memory through the basic input and output system includes: Determining the size of the fault diagnosis information; Determining a write pointer offset; the write pointer offset is used to indicate the position of the write pointer in the ring buffer and to indicate a writable position of the ring buffer; Determine the writable length of the cache tail of the circular cache from the write pointer offset through the write pointer offset; the cache tail of the circular cache represents: the very end of the circular cache; Determine, based on the size of the fault diagnosis information and the writable length, whether the end of the cache is exceeded after all the fault diagnosis information is written into the circular cache starting from the write pointer offset; By judging whether the cache tail is exceeded, a write strategy corresponding to the judgment result is determined; The fault diagnosis information is written into the ring buffer through the write strategy.
[0006] Optionally, determining a write strategy corresponding to the determination result by judging whether the cache tail is exceeded includes: Without exceeding the cache end, directly starting to perform a write operation on the fault diagnosis information from a position corresponding to the write pointer; After completing the fault diagnosis information, updating the write pointer offset; In the case of exceeding the cache tail, determining first fault diagnosis information and second fault diagnosis information corresponding to the fault diagnosis information through the writable length; the length corresponding to the first fault diagnosis information is the same as the writable length; Writing the first fault diagnosis information into the ring buffer starting from the write pointer offset; After the first fault diagnosis information is written into the circular buffer, the second fault diagnosis information is written into the circular buffer starting from the cache header of the circular buffer; the cache header of the circular buffer represents: the start of the circular buffer; After writing the second fault diagnosis information into the ring buffer, the write pointer offset is updated.
[0007] Optionally, it also includes: Controlling the baseboard management controller to monitor in a polling manner whether there is any unread fault diagnosis information in a designated area of the shared memory; The control substrate management controller reads fault diagnosis information from a specified area of the shared memory, including: When it is detected that the fault diagnosis information that has not been read exists in the designated area of the shared memory, the baseboard management controller is controlled to read the fault diagnosis information from the designated area of the shared memory.
[0008] Optionally, the designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; controlling the baseboard management controller to monitor whether there is unread fault diagnosis information in the designated area of the shared memory in a polling manner includes: At every preset time interval, controlling the baseboard management controller to monitor the write pointer offset and the read pointer offset corresponding to the ring buffer; In a case where the write pointer offset and the read pointer offset are not located at the same position of the ring buffer, it is determined that unread fault diagnosis information exists in the designated area of the shared memory.
[0009] Optionally, the designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; when it is detected that the fault diagnosis information that has not been read exists in the designated area of the shared memory, controlling the baseboard management controller to read the fault diagnosis information from the designated area of the shared memory comprises: Calculating a readable length between the read pointer offset and the write pointer offset; Controlling the baseboard management controller to perform a read operation on the fault diagnosis information starting from the read pointer offset to obtain the fault diagnosis information; After the fault diagnosis information is read, the read pointer offset is updated based on the write pointer offset; the updated read pointer offset and the write pointer offset are located at the same position in the ring buffer.
[0010] Optionally, before writing the fault diagnosis information into a designated area of a shared memory through the basic input and output system, the method includes: Calculating a cyclic redundancy check value corresponding to the fault diagnosis information; the cyclic redundancy check value is used to verify data security; Adding the cyclic redundancy check value to the end of the data packet corresponding to the fault diagnosis information to obtain the fault diagnosis information after the cyclic redundancy check value is added; The step of writing the fault diagnosis information into a designated area of a shared memory through the basic input / output system comprises: The fault diagnosis information after adding the cyclic redundancy check value is written into the designated area of the shared memory through the basic input and output system.
[0011] Optionally, after the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, the method further includes: Calculating a target cyclic redundancy check value corresponding to the fault diagnosis information read; Determining whether the target cyclic redundancy check value is consistent with the cyclic redundancy check value; In the event of inconsistency, determining that a data error occurs in the fault diagnosis information, and generating an alarm log corresponding to the data error; In the case of consistency, the fault diagnosis information is parsed to obtain a parsing result of the fault diagnosis information.
[0012] Optionally, obtaining fault diagnosis information from a register corresponding to the device through a basic input and output system includes: Determining fault data in a register corresponding to the device; determining the error type included in the fault data; Determine each of the error types as a corresponding data segment; the data segment includes an error domain, a sub-error domain, a stage, a mode, and a sequence number corresponding to the error type; By arranging the data segments in sequence, a total data segment is obtained; The fault diagnosis information is obtained through the total data segment.
[0013] Optionally, after the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, the method further includes: Determining the total data segments corresponding to the fault diagnosis information; determining a target data segment from the total data segments; Parsing the target data segment to obtain a parsing result of the target data segment; After the target data segment is parsed, determining the starting offset of the next data segment to be parsed in the total data segment according to the size of the target data segment; Determining the next data segment to be parsed according to the starting offset; The next data segment to be parsed is parsed.
[0014] Optionally, after obtaining the analysis result of the fault diagnosis information, or after generating an alarm log corresponding to the data error, the method further includes: The analysis result or the alarm log is reported to the terminal through the baseboard management controller.
[0015] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the fault reporting method described in the first aspect are implemented.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the fault reporting method described in the first aspect are implemented.
[0017] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the fault reporting method described in the first aspect are implemented.
[0018] The present disclosure writes fault diagnosis information into a shared memory through BIOS, and stops SMI after the information is written, thereby shortening the SMI time. By using shared memory to transmit fault diagnosis information during system operation, calling IPMI to send fault diagnosis information is avoided, thereby improving the efficiency and reliability of data transmission. By shortening the SMI time, business fluctuations can be reduced, the continuous availability of the entire machine can be increased, and a stable and secure business operation environment can be provided to business-sensitive customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a schematic diagram of the steps of a fault reporting method shown in an embodiment of the present disclosure; Figure 2 is a flow chart of fault diagnosis information processing at a baseboard management controller end shown in an embodiment of the present disclosure; Figure 3 is a flowchart of a basic input / output system fault diagnosis information processing method shown in an embodiment of the present disclosure; Figure 4 is a schematic diagram of an architecture diagram shown in an embodiment of the present disclosure; Figure 5 It is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0022] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0023] In related technologies, in order to improve the accuracy of fault diagnosis and analysis, registers are usually added, such as IERR (Internal Error) registers, PCIE error status registers, etc. The increase in registers will increase the amount of information in fault diagnosis information. Since IPMI has a byte limit, it can only send a maximum of 255 bytes each time. If you want to send more than 255 bytes, you need to call it multiple times. Therefore, as the number of registers increases, calling IPMI to send fault diagnosis information will cause SMI to take too long. And the time it takes to call IPMI to send fault diagnosis information each time is fluctuating, which will cause business fluctuations.
[0024] Therefore, using IPMI to send fault diagnosis information will affect business continuity, work efficiency and real-time performance, especially for scenarios that require 24-hour uninterrupted operation.
[0025] In order to solve the above technical problems, the present disclosure proposes a fault reporting method, which can prevent SMI from taking too long.
[0026] Figure 1 FIG. 1 is a schematic diagram of a method for reporting a fault according to an embodiment of the present disclosure. Figure 1 As shown, the fault reporting method may specifically include the following steps: Step S11: When a device in the system fails, a system management interrupt is triggered.
[0027] When a device failure is detected, such as hardware failure, overheating, connection problems, etc., the SMI is triggered immediately. This ensures that the system can take prompt action after a failure is detected, reducing the potential impact of the failure on system operation.
[0028] Step S12: Obtaining fault diagnosis information from a register corresponding to the device through a basic input and output system.
[0029] When SMI is triggered, the CPU will suspend the currently executed task and execute the SMI handler in the BIOS (Baseboard Manager Controller, basic input and output system). The BIOS can access the registers corresponding to the faulty device through specific instructions or interfaces. The registers corresponding to the faulty device include detailed information about the fault, such as error code, fault type, etc. This information is the fault diagnosis information corresponding to the fault of the device. The BIOS reads and collects the fault diagnosis information in these registers.
[0030] The fault diagnosis information is obtained from the register corresponding to the device through BIOS, ensuring the accuracy of the information and the reliability of the source.
[0031] Step S13: writing the fault diagnosis information into a designated area of the shared memory through the basic input and output system.
[0032] BIOS writes the fault diagnosis information collected from the register to the specified area of the shared memory. The shared memory is pre-allocated, and the BIOS can directly access the shared memory. The specified area of the shared memory refers to a certain part of the shared memory. When the BIOS writes the fault diagnosis information to the specified area of the shared memory, it is necessary to ensure the integrity and consistency of the data to avoid data loss or damage.
[0033] Step S14: After the fault diagnosis information is written into the designated area of the shared memory, the system management interrupt is stopped.
[0034] After the BIOS successfully and completely writes the fault diagnosis information into the specified area of the shared memory, a signal can be sent to the CPU through the BIOS to indicate that the SMI processing is completed. After receiving the signal, the CPU resumes normal operation of the system.
[0035] Step S15: controlling the baseboard management controller to read the fault diagnosis information from the designated area of the shared memory.
[0036] The BMC (Baseboard Manager Controller) can also directly access the specified area of the shared memory and obtain fault diagnosis information from the specified area of the shared memory. After the BIOS writes the fault diagnosis information to the specified area of the shared memory, the BMC reads the fault diagnosis information from the specified area of the shared memory. There is no need to call IPMI to send the fault diagnosis information.
[0037] By adopting the embodiments of the present disclosure and utilizing the high-speed access characteristics of shared memory, fault diagnosis information is written into a designated area of shared memory, which helps to reduce the delay in information reporting and improve the overall response speed of the system. After the fault diagnosis information is successfully written into the shared memory, SMI is stopped to avoid unnecessary system overhead and ensure that the system can maintain normal operating efficiency while handling faults. Controlling BMC to read fault diagnosis information from a designated area of shared memory can avoid calling PIMI and effectively improve the continuous availability time of the entire machine. Controlling BMC to read fault diagnosis information from a designated area of shared memory can achieve remote monitoring and management of faults, thereby improving the maintainability and reliability of the system.
[0038] For the integrity and security of the data, the acquired fault diagnosis information needs to be verified. The original check value carried by the fault diagnosis information can be compared with the recalculated check value to determine whether the fault diagnosis information meets the integrity and security requirements.
[0039] The following is a method for implementing fault diagnosis information carrying original checksum values.
[0040] Among them, in an optional embodiment, before writing the fault diagnosis information into the designated area of the shared memory through the basic input and output system, it includes: calculating a cyclic redundancy check value corresponding to the fault diagnosis information; the cyclic redundancy check value is used to verify data security; adding the cyclic redundancy check value to the end of the data packet corresponding to the fault diagnosis information to obtain the fault diagnosis information after the cyclic redundancy check value is added; the writing of the fault diagnosis information into the designated area of the shared memory through the basic input and output system includes: writing the fault diagnosis information after the cyclic redundancy check value is added into the designated area of the shared memory through the basic input and output system.
[0041] The present disclosure may use CRC (Cyclic Redundancy Check) to determine the check value of the fault diagnosis information.
[0042] After the BIOS obtains the fault diagnosis information, before the BIOS writes the fault diagnosis information into the designated area of the shared memory, the cyclic redundancy check value corresponding to the fault diagnosis information at this time is calculated, and the cyclic redundancy check value is added to the end of the data packet corresponding to the fault diagnosis information, so that the fault diagnosis information carries the cyclic redundancy check value used for verification. When a certain device needs to use the fault diagnosis information or receives the fault diagnosis information, the cyclic redundancy check value carried by the fault diagnosis information can be used to verify the integrity of the cyclic redundancy check value.
[0043] The fault diagnosis information after the cyclic redundancy check value is added is written into a specified area of the shared memory through the BIOS.
[0044] By adopting the embodiments of the present disclosure, errors that may occur during data transmission or storage can be effectively detected through cyclic redundancy check values. By adding cyclic redundancy check values and performing verification at the receiving end, data errors can be discovered and corrected in a timely manner, thereby significantly reducing the data error rate. By adding cyclic redundancy check values, data can also be prevented from being maliciously tampered with to a certain extent. Through the cyclic redundancy check value, the system can tolerate a certain degree of errors, thereby enhancing the fault tolerance of the system.
[0045] The following is a method for verifying the integrity of fault diagnosis information using cyclic redundancy check values: Among them, in an optional embodiment, after the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, it also includes: calculating the target cyclic redundancy check value corresponding to the read fault diagnosis information; judging whether the target cyclic redundancy check value is consistent with the cyclic redundancy check value; in the case of inconsistency, determining that a data error occurs in the fault diagnosis information, and generating an alarm log corresponding to the data error; in the case of consistency, parsing the fault diagnosis information to obtain the parsed result of the fault diagnosis information.
[0046] After the BMC reads the fault diagnosis information from the specified area of the shared memory, it needs to verify the integrity of the fault diagnosis information.
[0047] Calculate the target cyclic redundancy check value corresponding to the acquired fault diagnosis information. And determine the cyclic redundancy check value carried by the fault diagnosis information from the fault diagnosis information. By comparing the target cyclic redundancy check value with the cyclic redundancy check value, it is determined whether the target cyclic redundancy check value is consistent with the cyclic redundancy check value to determine the integrity of the fault diagnosis information. Among them, the target cyclic redundancy check value and the cyclic redundancy check value are obtained using the same calculation strategy. The same calculation strategy means that when the same segment of data is calculated multiple times, the calculation results obtained by the multiple calculations are consistent.
[0048] When the target cyclic redundancy check value is consistent with the cyclic redundancy check value, it indicates that the fault diagnosis information has not been tampered with and no data error has occurred. The fault diagnosis information can be used in subsequent services, such as parsing the fault diagnosis information to determine the information corresponding to the faulty device.
[0049] When the target cyclic redundancy check value is inconsistent with the cyclic redundancy check value, it means that the integrity test of the fault diagnosis information has not passed, the fault diagnosis information may be missing or tampered with, and there is a data error. Therefore, the fault diagnosis information cannot be used normally. A corresponding alarm log can be generated based on the data error. The alarm log is used to indicate that there is a problem with the data here and it needs to be processed.
[0050] By adopting the embodiments of the present disclosure, by calculating the target cyclic redundancy check value of the fault diagnosis information read, and comparing the target cyclic redundancy check value with the cyclic redundancy check value, the integrity of the data can be ensured, and data errors can be discovered and reported in a timely manner. Once the target cyclic redundancy check value is found to be inconsistent, the system can immediately determine that there is a data error in the fault diagnosis information and generate a corresponding alarm log, which helps the operation and maintenance personnel to quickly locate the problem and take necessary repair measures. When the cyclic redundancy check values are consistent, the fault diagnosis information can be used for subsequent business processing to ensure business continuity.
[0051] Among them, in an optional embodiment, after the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, it also includes: determining the total data segment corresponding to the fault diagnosis information; determining the target data segment from the total data segment; parsing the target data segment to obtain the parsing result of the target data segment; after the target data segment is parsed, according to the size of the target data segment, determining the starting offset of the next data segment to be parsed in the total data segment; according to the starting offset, determining the next data segment to be parsed; parsing the next data segment to be parsed.
[0052] In the present disclosure, in order to complete the reporting of equipment failures, after obtaining the fault diagnosis information, it is necessary to parse the fault diagnosis information to determine the fault causes corresponding to each faulty device to facilitate user processing.
[0053] Each time an SMI is triggered, one or more devices may fail, or a device may have multiple types of failures. Therefore, each fault diagnosis information read by the BMC may include one or more data segments, each of which is an error type. Each data segment constitutes a total data segment.
[0054] The BMC parses each data segment in turn and processes each data segment in order to ensure that all data is processed correctly. Specifically, the parsing can be performed from the first data segment corresponding to the total data segment to the last data segment corresponding to the total data segment.
[0055] The currently parsed data segment is determined as the target data segment. The number of total data segments and the number of the target data segment in the total data segment can be determined through the first byte information of the corresponding position in the target data segment, for example, byte 6 of the target data segment.
[0056] By obtaining the number of data segments included in the total data segment and the number of the total data segment in which the current target data segment is located, it can effectively ensure that all data segments are received and processed. When a data segment is lost or an error occurs, the corresponding alarm log can be generated based on the information of the current segment and the total segment to help maintenance personnel quickly locate and solve the problem. And knowing the number of the total data segment in which the current target data segment is located can help the BMC process data in the correct order.
[0057] After parsing of the target data segment is completed, a parsing result of the target data segment may be obtained, and the parsing result of the target data segment may represent error information corresponding to an error type.
[0058] After the parsing of the target data segment is completed, if there are still unparsed data segments in the total data segments, the unparsed data segments continue to be parsed.
[0059] The starting offset of the next data segment adjacent to the target data segment can be determined by the second byte information of the corresponding position in the target data segment, for example, byte 7 of the target data segment. The starting offset of the next data segment to be parsed can be determined by the size of the target data segment. By calculating the starting offset of the next segment, the BMC can quickly locate the next segment of data, reduce the search time, and thus improve processing efficiency.
[0060] After the parsing of the target data segment is completed, the data segment is located by the starting offset of the next data segment to be parsed, and then the data segment is parsed to obtain the parsing result corresponding to the data segment.
[0061] All data segments included in the total data segment are parsed in sequence in a certain order, and when all data segments are parsed, it indicates that the fault diagnosis information parsing is complete, and the next unparsed fault diagnosis information can be parsed.
[0062] The use of the embodiments of the present disclosure ensures that the BMC can accurately identify and locate the total data segment containing complete fault diagnosis information. By parsing the target data segment, the BMC can extract specific fault diagnosis information and improve the efficiency of subsequent diagnosis, repair and recording. After completing the parsing of a data segment, the BMC needs to be able to accurately find the starting position of the next data segment and ensure that the BMC can process all data in the total data segment in sequence and without omission. Completing the processing in sequence can ensure that all data segments are processed, avoid missing or repeatedly processing a certain segment of data, and thus ensure the integrity and accuracy of the data.
[0063] In order to parse the fault diagnosis information in the data segment mode, it is necessary to collect the fault diagnosis information in the specified rule format when the BIOS collects the fault diagnosis information, and to ensure that the fault diagnosis information is written in the specified rule format when writing to the specified area of the shared memory, so that when the BMC obtains the fault diagnosis information and parses the fault diagnosis information, the fault diagnosis information used also conforms to the specified rule format.
[0064] Among them, in an optional embodiment, the obtaining of fault diagnosis information from the register corresponding to the device through the basic input and output system includes: determining the fault data in the register corresponding to the device; determining the error type included in the fault data; determining each of the error types as a corresponding data segment; the data segment includes the error domain, sub-error domain, stage, mode and sequence number corresponding to the error type; by arranging each of the data segments in sequence to obtain a total data segment; and obtaining the fault diagnosis information through the total data segment.
[0065] Fault information is obtained from the register corresponding to the faulty device according to the specified rule format. For example, for a fault type, it is necessary to obtain the fault information including the error domain, sub-error domain, stage, mode, sequence number, etc. of the fault type, and determine the fault information corresponding to the fault type as a data segment.
[0066] In the case where the SMI triggered this time corresponds to multiple fault types, each fault type is determined as a data segment corresponding to the fault type in the same way. Each data segment is combined to obtain a total data segment, which is composed of the data segments corresponding to these fault types. Each data segment can be arranged in sequence in the total data segment.
[0067] The overall information corresponding to a total data segment, for example, data packet length, command word, may also be determined, and the overall information may be added to the header of the data packet corresponding to the total data segment.
[0068] Write fault diagnosis information to a specified area of shared memory in the form of a data segment.
[0069] In the embodiment of the present disclosure, each error type is encapsulated into an independent data segment in this step, and the structured data representation method is helpful for subsequent data analysis and processing. The data segments are arranged in a certain order into a total data segment, ensuring that all fault data are included completely and orderly, which helps the BIOS to fully understand the fault status of the device in subsequent processing.
[0070] The data processed by the BMC needs to be transmitted to the terminal so that the administrator can understand the system operation status in a timely manner. When a device fails, measures can be taken quickly based on the information transmitted by the BMC.
[0071] Among them, in an optional embodiment, after obtaining the analysis result of the fault diagnosis information, or after generating an alarm log corresponding to the data error, it also includes: reporting the analysis result or the alarm log to the terminal through the baseboard management controller.
[0072] After discovering data errors in the fault diagnosis information through the cyclic redundancy check value, or after parsing the fault diagnosis information to obtain the parsing result of the fault diagnosis information, the BMC will transmit the alarm log corresponding to the data error or the parsing result to the terminal. Among them, when parsing the fault diagnosis information, each data segment included in the fault diagnosis information is parsed in turn, and after each data segment is parsed to obtain the corresponding parsing result, the parsing result corresponding to the data segment is reported to the interrupt, and the parsing of the fault diagnosis information is completed after all data segments included in the fault diagnosis information are parsed.
[0073] By adopting the embodiments of the present disclosure, the processing information is sent to the terminal through the BMC, so that the operation and maintenance personnel can timely understand the system operation status. Sending fault information to the terminal can help record data, and the weak links of the system can be identified by analyzing historical fault data. Sending fault information to the terminal can improve the transparency of system operation, and relevant personnel can clearly understand the system operation status and fault information.
[0074] The designated area of shared memory is determined as follows.
[0075] Among them, in an optional embodiment, it also includes: after the system is powered on, using the baseboard management controller to allocate the shared memory; mapping the shared memory to the basic input and output system memory; the basic input and output system and the baseboard management controller can access the shared memory; determining a part of the shared memory as the designated area of the shared memory.
[0076] System power-on refers to the process of connecting a power source to a computer or other electronic device so that it starts running and initializing. When the system is powered on and completes the initial self-check process, the system enters the initialization phase. The BMC starts running its firmware code to perform system management and monitoring tasks.
[0077] The BMC can check the system's physical memory resources, including the memory areas that can be used for sharing. According to the pre-defined allocation strategy, a certain size of memory area can be allocated as shared memory through the BMC. The size of the shared memory can be determined based on system requirements and the expected amount of data.
[0078] After the allocation is completed, the BMC maps the shared memory to the memory space of the BIOS. Mapping ensures that the BIOS can access the shared memory, specifically through a specific memory address range.
[0079] The shared memory can be accessed by the BIOS and BMC. The BIOS and BMC access the shared memory through their own memory access mechanisms and perform write or read operations on the shared memory.
[0080] Then, a portion of the shared memory is determined as the designated area of the shared memory to ensure that the use of other areas of the shared memory is not affected.
[0081] By adopting the embodiments of the present disclosure, data is stored in shared memory, and BIOS and BMC are allowed to directly access the shared data area without other intermediate media, thereby reducing communication delay. Shared memory allows BIOS and BMC to exchange data at a speed close to that of memory access, which can increase the rate of data transmission. By reasonably dividing the shared memory area, it is possible to optimize the use of system resources and avoid resource waste.
[0082] Among them, in an optional embodiment, it also includes: controlling the baseboard management controller to monitor whether there is any unread fault diagnosis information in the specified area of the shared memory in a polling manner; controlling the baseboard management controller to read the fault diagnosis information from the specified area of the shared memory, including: when it is monitored that there is any unread fault diagnosis information in the specified area of the shared memory, controlling the baseboard management controller to read the fault diagnosis information from the specified area of the shared memory.
[0083] The BMC accesses the specified area of the shared memory in a polling manner to query whether there is fault diagnosis information in the specified area of the shared memory. The polling manner means performing the same operation at every preset time interval. In the present disclosure, the BMC accesses the specified area of the shared memory at every preset time interval through the polling manner to monitor whether there is unread fault diagnosis information in the specified area of the shared memory.
[0084] Since each time the BMC reads fault diagnosis information from the specified area of the shared memory, all fault diagnosis information in the specified area of the shared memory will be read, therefore, when the BMC accesses fault diagnosis information in the specified area of the shared memory, it indicates that there is unread fault diagnosis information in the specified area of the shared memory.
[0085] When the BMC detects that unread fault diagnosis information exists in the designated area of the shared memory, the BMC is controlled to read the fault diagnosis information from the designated area of the shared memory, so that the BMC obtains the fault diagnosis information.
[0086] By adopting the embodiments of the present disclosure, through the polling mechanism, the BMC can regularly and quickly check the designated area in the shared memory, ensuring that once fault diagnosis information is written, it can be discovered and processed in time, and the system fault can be quickly responded to and repaired. The use of polling to detect fault diagnosis information simplifies the system architecture, reduces the implementation cost, and effectively utilizes system resources. By continuously monitoring the shared memory, the BMC can ensure that all generated fault diagnosis information is read in time, avoiding the difficulty of troubleshooting due to missing information.
[0087] The designated area of the shared memory can be set as a circular buffer. When the write pointer reaches the end of the array, it will wrap around to the beginning of the array to form a loop. The circular buffer includes two pointers: one is a write pointer and the other is a read pointer. The two pointers can be moved independently, allowing parallel reading and writing in the cache. Specifically, by moving the write pointer, the data is temporarily stored in the circular buffer waiting to be read, and by moving the read pointer, the data is read out of the circular buffer and the circular buffer space is released. The write pointer offset is used to indicate the position of the write pointer in the circular buffer, and the read pointer offset is used to indicate the position of the read pointer in the circular buffer. By comparing the relationship between the write pointer offset and the read pointer offset, it is determined whether there is data to read in the circular buffer or whether there is space to write in the circular buffer. The circular buffer can further save shared memory, and the memory corresponding to the circular buffer can be reused, and the impact on the use of other areas in the circular buffer can be effectively avoided.
[0088] Among them, when demarcating a designated area from the shared memory and setting the designated area as a ring buffer, it is necessary to ensure that the data in the ring buffer will not be overwritten by the newly written data before reading. For example, in the present disclosure, the size of the ring buffer can be set to 32KB. The specific setting steps can be, first determine the maximum time interval between each read operation, the frequency of SMI triggered by device failure, and the maximum bytes that the fault diagnosis information corresponding to the SMI can reach. Through this information, determine a suitable ring buffer size to avoid data overwriting due to untimely reading.
[0089] Among them, in an optional embodiment, the designated area of the shared memory is a circular cache, and the circular cache includes a read pointer and a write pointer; the baseboard management controller is controlled to monitor whether there is any unread fault diagnosis information in the designated area of the shared memory in a polling manner, including: at each preset time interval, controlling the baseboard management controller to monitor the write pointer offset and the read pointer offset corresponding to the circular cache; when the write pointer offset and the read pointer offset are not located at the same position of the circular cache, determining that there is unread fault diagnosis information in the designated area of the shared memory.
[0090] In the case where the designated area of the shared memory is a circular buffer, since the circular buffer manages two pointers, including a read pointer and a write pointer, the read pointer offset is used to indicate a readable position in the circular buffer, and the write pointer offset is used to indicate a writable position in the circular buffer.
[0091] Since each time the BMC reads fault diagnosis information from the circular buffer, all fault diagnosis information in the circular buffer will be read completely, therefore, when there is no unread fault diagnosis information in the circular buffer, the read pointer offset and the write pointer offset should indicate the same one in the circular buffer.
[0092] The BMC may query the positions of the read pointer offset and the write pointer offset in the ring buffer at preset time intervals.
[0093] If the write pointer offset and the read pointer offset are not located at the same position of the ring buffer, it means that the current write pointer offset has moved relative to the read pointer offset, which means that new data has been written into the ring buffer between this monitoring and the last monitoring, which has caused the movement of the write pointer and updated the write pointer offset. The BMC will read the fault diagnosis information in the ring buffer only when it monitors each time and detects the unread fault diagnosis information. Therefore, during this monitoring and the last monitoring, the fault diagnosis information in the ring buffer will not be read by the BMC. Therefore, for the BMC, the fault diagnosis information in the ring buffer detected this time is the unread fault diagnosis information.
[0094] By adopting the embodiments of the present disclosure, the BMC can quickly determine whether there is new fault diagnosis information by regularly monitoring the offset of the write pointer and the read pointer in a polling manner, thereby realizing real-time monitoring of the system status. By continuously monitoring the offset of the write pointer and the read pointer, it can be ensured that all generated fault diagnosis information is read in a timely manner, avoiding troubleshooting difficulties caused by missing information. The BMC determines whether there is unread fault diagnosis information by monitoring the pointer offset, so that system resources can be reasonably scheduled to ensure priority processing of key tasks. The polling mechanism of the ring cache and the BMC can be easily integrated into the existing system.
[0095] When it is detected that unread fault diagnosis information exists in the designated area of the shared memory, the fault diagnosis information in the designated area of the shared memory is read.
[0096] In one optional embodiment, the designated area of the shared memory is a circular cache, and the circular cache includes a read pointer and a write pointer; when it is detected that the fault diagnosis information that has not been read exists in the designated area of the shared memory, the baseboard management controller is controlled to read the fault diagnosis information from the designated area of the shared memory, including: calculating the readable length between the read pointer offset and the write pointer offset; controlling the baseboard management controller to perform a read operation on the fault diagnosis information starting from the read pointer offset to obtain the fault diagnosis information; after the fault diagnosis information is read, updating the read pointer offset based on the write pointer offset; the updated read pointer offset and the write pointer offset are located at the same position in the circular cache.
[0097] When the designated area of the shared memory is a ring buffer, data in the ring buffer can be read through a read pointer and a write pointer managed by the ring buffer.
[0098] First, the length between the write pointer offset and the read pointer offset is calculated, and the length between the write pointer offset and the read pointer offset is used to represent the readable length in the current ring buffer. The readable length represents the size of the data that can be read.
[0099] After the readable length is determined, the BMC is controlled to read data starting from the read pointer offset until all data corresponding to the readable length is read, so as to obtain all unread fault diagnosis information in the current ring buffer.
[0100] After the BMC finishes reading the fault diagnosis information, the read pointer offset is updated.
[0101] Since the BMC reads all the unread fault diagnosis information in the ring buffer, there is no unread fault diagnosis information in the current ring buffer. Therefore, after the reading is completed, the updated read pointer offset should be located at the same position in the ring buffer as the write pointer offset. As for how to update the read pointer offset, the write pointer offset is also used as the basis for adjusting the read pointer offset.
[0102] By using the embodiments of the present disclosure, by calculating the readable length between the read pointer offset and the write pointer offset, the BMC can quickly locate the fault diagnosis information to be read, thereby reducing the delay in data reading. The read operation is performed starting from the read pointer offset, ensuring the sequentiality of data reading and avoiding processing errors caused by data disorder. After the reading is completed, the read pointer offset is updated based on the write pointer offset, ensuring the integrity of the data and avoiding data loss caused by pointer misalignment.
[0103] Among them, in an optional embodiment, the designated area of the shared memory is a circular cache, and the circular cache includes a read pointer and a write pointer; the writing of the fault diagnosis information to the designated area of the shared memory through the basic input and output system includes: determining the size of the fault diagnosis information; determining the write pointer offset; the write pointer offset is used to indicate the position of the write pointer in the circular cache, and is used to indicate the writable position of the circular cache; through the write pointer offset, determine the writable length from the write pointer offset to the cache tail of the circular cache; the cache tail of the circular cache represents: the very end of the circular cache; through the size of the fault diagnosis information and the writable length, determine whether the cache tail is exceeded after all the fault diagnosis information is written into the circular cache starting from the write pointer offset; determine the write strategy corresponding to the judgment result by judging whether it exceeds the cache tail; write the fault diagnosis information into the circular cache by the write strategy.
[0104] After the designated area of the shared memory is set as a circular buffer, the data in the circular buffer is read or written through the read pointer and write pointer of the circular buffer. The write pointer offset indicates the position of the write pointer in the circular buffer, indicating the writable position in the circular buffer.
[0105] When writing data into the circular buffer, if the data has reached the end of the circular buffer, the corresponding exception handling function will be used to roll back to the head of the circular buffer.
[0106] Therefore, before the BIOS writes the fault diagnosis information into the shared memory, the size of the fault diagnosis information to be written is first determined, which can be determined by determining the data length of the fault diagnosis information. Then, the writable length of the cache tail of the ring buffer is determined. The cache tail of the ring buffer represents the end of the ring buffer. When the data exceeds the cache tail, the exception handling function is triggered, and the data is rolled back to the head of the ring buffer, that is, the beginning of the ring buffer, and the data is continued to be written from the beginning of the ring buffer.
[0107] By comparing the size of the fault diagnosis information with the writable length of the circular buffer, it can be determined whether the writing of the fault diagnosis information this time will trigger the data rollback of the circular buffer. If the size of the fault diagnosis information does not exceed the writable length of the circular buffer, then the fault diagnosis information written this time will not exceed the end of the cache, and will not trigger the rollback of the circular buffer; if the size of the fault diagnosis information exceeds the writable length of the circular buffer, then the fault diagnosis information written this time will exceed the end of the cache, which will trigger the rollback of the circular buffer and continue to write data from the beginning of the circular buffer. If there is unread data at the beginning of the circular buffer, the newly written data will overwrite the unread data, resulting in data loss.
[0108] Therefore, for two scenarios where the size of the fault diagnosis information does not exceed the writable length of the circular buffer, and where the size of the fault diagnosis information exceeds the writable length of the circular buffer, different writing strategies are used to write the fault diagnosis information.
[0109] After obtaining the determination result of the size of the fault diagnosis information and the writable length of the circular buffer, different writing strategies are executed to write the fault diagnosis information.
[0110] By using the embodiments of the present disclosure, the system can efficiently manage the storage of fault diagnosis information by using a circular cache, without the need to frequently allocate and release memory, thereby reducing memory fragmentation and management overhead. The use of write pointers and read pointers ensures the orderly storage and reading of data, avoiding data confusion and loss. The system can dynamically adjust the write strategy according to the size of the fault diagnosis information and the writable length of the circular cache to ensure that new fault diagnosis information can be correctly stored. By determining whether the fault diagnosis information exceeds the end of the cache after being written, it can be ensured that the data will not be accidentally overwritten.
[0111] Among them, in an optional embodiment, by judging whether the cache tail is exceeded, a write strategy corresponding to the judgment result is determined, including: when the cache tail is not exceeded, directly starting to execute the write operation of the fault diagnosis information from the position corresponding to the write pointer; after completing the fault diagnosis information, updating the write pointer offset; when the cache tail is exceeded, determining the first fault diagnosis information and the second fault diagnosis information corresponding to the fault diagnosis information through the writable length; the length corresponding to the first fault diagnosis information is the same as the writable length; writing the first fault diagnosis information to the circular cache starting from the write pointer offset; after writing the first fault diagnosis information to the circular cache, writing the second fault diagnosis information to the circular cache starting from the cache head of the circular cache; the cache head of the circular cache represents: the start of the circular cache; after writing the second fault diagnosis information to the circular cache, updating the write pointer offset.
[0112] In the case where the cache tail is not exceeded, that is, when the fault diagnosis information to be written this time is written from the write pointer, and the rollback of the ring cache is not triggered, the write operation is directly performed to write the fault diagnosis information from the write pointer to the ring cache. After the fault diagnosis information is completely written into the ring cache, the write pointer offset is updated.
[0113] In the case where the cache tail is exceeded, the fault diagnosis information to be written this time is divided into two parts according to the writable length of the circular cache, namely, the first fault diagnosis information and the second fault diagnosis information. The first fault diagnosis information is the same as the writable length of the circular cache. After the first fault diagnosis information is completely written, the cache tail of the circular cache is reached, triggering the rollback of the circular cache, and the data to be written thereafter will be written from the beginning of the circular cache.
[0114] In the present disclosure, when setting the size of the circular buffer, in order to ensure that unread data will not be overwritten by newly written data, the space of the circular buffer is set large enough to ensure that the written data will not completely occupy the space of the circular buffer during the time interval between two read operations.
[0115] Therefore, for the second fault diagnosis information, after the circular buffer is rolled back, the second fault diagnosis information is directly written starting from the cache header of the circular buffer, and the cache header of the circular buffer is also the beginning of the circular buffer.
[0116] In the case of exceeding the cache tail, it is necessary to update the write pointer offset after the second fault diagnosis information is completely written into the circular cache.
[0117] The purpose of updating the write pointer offset is to update the position of the write pointer in the ring buffer, indicating a new writable position in the ring buffer. When writing fault diagnosis information next time, writing starts from the updated write pointer offset.
[0118] By using the embodiments of the present disclosure, by judging whether the fault diagnosis information exceeds the cache end, the write strategy can be dynamically adjusted to ensure that the cache space is maximized. When the cache end is not exceeded, the information is directly written; when the cache end is exceeded, the information is split and written separately, avoiding write failure or data loss due to insufficient space. By intelligently managing the write pointer offset, when the cache space is tight, the data can be split and the write position can be reasonably arranged to ensure the persistent preservation of important information.
[0119] In an optional embodiment, the asset information can also be quickly transmitted to the baseboard management controller through the ring buffer during the startup process to reduce the startup time. Asset information refers to various data and information related to a system or device, which can be used to describe, manage and monitor the status and performance of the system or device. The asset information is stored in the corresponding register.
[0120] Figure 2 This is a flow chart of fault diagnosis information processing at a baseboard management controller end shown in an embodiment of the present disclosure. When the baseboard management controller detects that there is unread fault diagnosis information, that is, when the read pointer offset and the write pointer offset of the shared memory are not located at the same position of the shared memory, the baseboard management controller is triggered to read the circular buffer; the shared memory write pointer offset and the read pointer offset are obtained, data is read from the read pointer offset, the size is the readable data in the circular buffer, the fault diagnosis information is obtained, and the read pointer offset is updated; the cyclic redundancy check value carried by the fault diagnosis information is read, and a cyclic redundancy check is performed to determine whether the check is passed; if the check fails, the analysis of the fault diagnosis information is exited, and an alarm log is generated; if the check passes, each data segment corresponding to the fault diagnosis information is identified, and the overall information of the data packet corresponding to the fault diagnosis information, each data segment and the cyclic redundancy check value carried by the fault diagnosis information are obtained, and the overall information includes the command word and the data packet length; the baseboard management controller processes the fault diagnosis information in the form of data segments, and sequentially completes the analysis of each data segment included in the fault diagnosis information.
[0121] Figure 3This is a fault diagnosis information processing flow chart of a basic input / output system end shown in an embodiment of the present disclosure. When an error occurs in the system and a system management interrupt is triggered, the basic input / output system collects write data in a specified regular format and calculates a cyclic redundancy check value of the write data; before writing the write data into the shared memory, it is determined whether writing from the write pointer offset of the current shared memory will exceed the cache tail; if it does not exceed the cache tail, the write data is directly written to the shared memory and the write pointer offset is updated; if it exceeds the cache tail, the write data is segmented according to the writable length corresponding to the write pointer offset to the cache tail; the part of the write data corresponding to the writable length is written to the shared memory from the write pointer offset, and then the other part of the write data is written to the shared memory from the cache head of the shared memory; after the write data is completely written to the shared memory, the write pointer offset is updated; after the write pointer offset is updated, the writing of the write data is completed.
[0122] Figure 4 It is a schematic diagram of an architecture diagram shown in an embodiment of the present disclosure. It includes a processor, a shared memory, a basic input / output system, a baseboard management controller, and a terminal, wherein a portion of the shared memory is set as a circular buffer for storing fault information; when a system management interrupt is triggered, fault diagnosis information is collected through the basic input / output system and connected to the circular buffer in the shared memory; the baseboard management controller can directly read the fault diagnosis information from the circular buffer in the shared memory, and after parsing the fault diagnosis information, the parsing result is notified to the terminal through an alarm.
[0123] The present disclosure also provides an electronic device, referring to Figure 5 , Figure 5 is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 includes: a memory 510 and a processor 520. The memory 510 and the processor 520 are connected via a bus communication. A computer program is stored in the memory 510. The computer program can be run on the processor 520 to implement the steps in the fault reporting method disclosed in the embodiment of the present disclosure.
[0124] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the fault reporting method disclosed in the embodiment of the present disclosure are implemented.
[0125] The present disclosure also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the fault reporting method described in the first aspect are implemented. The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0126] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0127] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0128] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0129] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0130] Although some embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the present disclosure.
[0131] The above is a detailed introduction to a fault reporting method, electronic device, medium and computer program product provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present disclosure, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A fault reporting method, characterized in that: include: In the event of a device failure within the system, a system management interruption is triggered; Obtaining fault diagnosis information from a register corresponding to the device through a basic input and output system; Writing the fault diagnosis information into a designated area of a shared memory through the basic input and output system; After the fault diagnosis information is written into the designated area of the shared memory, stopping the system management interrupt; The control substrate management controller reads the fault diagnosis information from a designated area of the shared memory.
2. The method according to claim 1, characterized in that Also includes: After the system is powered on, using the baseboard management controller to allocate the shared memory; Mapping the shared memory into a basic input / output system memory; The basic input and output system and the baseboard management controller can access the shared memory; A portion of the shared memory is determined as a designated area of the shared memory.
3. The method according to claim 1, characterized in that The designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; and writing the fault diagnosis information into the designated area of the shared memory through the basic input and output system includes: Determining the size of the fault diagnosis information; Determining a write pointer offset; the write pointer offset is used to indicate the position of the write pointer in the ring buffer and to indicate a writable position of the ring buffer; Determine the writable length of the cache tail of the circular cache from the write pointer offset through the write pointer offset; the cache tail of the circular cache represents: the very end of the circular cache; Determine, based on the size of the fault diagnosis information and the writable length, whether the end of the cache is exceeded after all the fault diagnosis information is written into the circular cache starting from the write pointer offset; By judging whether the cache tail is exceeded, a write strategy corresponding to the judgment result is determined; The fault diagnosis information is written into the ring buffer through the write strategy.
4. The method according to claim 3, characterized in that By judging whether the cache tail is exceeded, a write strategy corresponding to the judgment result is determined, including: Without exceeding the cache end, directly starting to perform a write operation on the fault diagnosis information from a position corresponding to the write pointer; After completing the fault diagnosis information, updating the write pointer offset; In the case of exceeding the cache tail, determining first fault diagnosis information and second fault diagnosis information corresponding to the fault diagnosis information through the writable length; the length corresponding to the first fault diagnosis information is the same as the writable length; Writing the first fault diagnosis information into the ring buffer starting from the write pointer offset; After the first fault diagnosis information is written into the circular buffer, the second fault diagnosis information is written into the circular buffer starting from the cache header of the circular buffer; the cache header of the circular buffer represents: the start of the circular buffer; After writing the second fault diagnosis information into the ring buffer, the write pointer offset is updated.
5. The method according to claim 1, characterized in that Also includes: Controlling the baseboard management controller to monitor in a polling manner whether there is any unread fault diagnosis information in a designated area of the shared memory; The control substrate management controller reads fault diagnosis information from a specified area of the shared memory, including: When it is detected that the fault diagnosis information that has not been read exists in the designated area of the shared memory, the baseboard management controller is controlled to read the fault diagnosis information from the designated area of the shared memory.
6. The method according to claim 5, characterized in that The designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; controlling the baseboard management controller to monitor whether there is unread fault diagnosis information in the designated area of the shared memory in a polling manner, including: At every preset time interval, controlling the baseboard management controller to monitor the write pointer offset and the read pointer offset corresponding to the ring buffer; In a case where the write pointer offset and the read pointer offset are not located at the same position of the ring buffer, it is determined that unread fault diagnosis information exists in the designated area of the shared memory.
7. The method according to claim 5, characterized in that The designated area of the shared memory is a circular buffer, and the circular buffer includes a read pointer and a write pointer; when it is detected that the fault diagnosis information that has not been read exists in the designated area of the shared memory, controlling the baseboard management controller to read the fault diagnosis information from the designated area of the shared memory includes: Calculating a readable length between the read pointer offset and the write pointer offset; Controlling the baseboard management controller to perform a read operation on the fault diagnosis information starting from the read pointer offset to obtain the fault diagnosis information; After the fault diagnosis information is read, the read pointer offset is updated based on the write pointer offset; the updated read pointer offset and the write pointer offset are located at the same position in the ring buffer.
8. The method according to claim 1, characterized in that: Before writing the fault diagnosis information into a designated area of a shared memory through the basic input and output system, the method includes: Calculating a cyclic redundancy check value corresponding to the fault diagnosis information; the cyclic redundancy check value is used to verify data security; Adding the cyclic redundancy check value to the end of the data packet corresponding to the fault diagnosis information to obtain the fault diagnosis information after the cyclic redundancy check value is added; The step of writing the fault diagnosis information into a designated area of a shared memory through the basic input / output system comprises: The fault diagnosis information after adding the cyclic redundancy check value is written into the designated area of the shared memory through the basic input and output system.
9. The method according to claim 8, characterized in that After the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, the method further includes: Calculating a target cyclic redundancy check value corresponding to the fault diagnosis information read; Determining whether the target cyclic redundancy check value is consistent with the cyclic redundancy check value; In the event of inconsistency, determining that a data error occurs in the fault diagnosis information, and generating an alarm log corresponding to the data error; In the case of consistency, the fault diagnosis information is parsed to obtain a parsing result of the fault diagnosis information.
10. The method according to claim 1, characterized in that The acquiring fault diagnosis information from a register corresponding to the device through a basic input and output system includes: Determine fault data in a register corresponding to the device; determining the error type included in the fault data; Determine each of the error types as a corresponding data segment; the data segment includes an error domain, a sub-error domain, a stage, a mode, and a sequence number corresponding to the error type; By arranging the data segments in sequence, a total data segment is obtained; The fault diagnosis information is obtained through the total data segment.
11. The method according to claim 10, characterized in that After the baseboard management controller reads the fault diagnosis information from the specified area of the shared memory, the method further includes: Determining the total data segments corresponding to the fault diagnosis information; determining a target data segment from the total data segments; Parsing the target data segment to obtain a parsing result of the target data segment; After the target data segment is parsed, determining the starting offset of the next data segment to be parsed in the total data segment according to the size of the target data segment; Determining the next data segment to be parsed according to the starting offset; The next data segment to be parsed is parsed.
12. The method according to claim 9, characterized in that After obtaining the analysis result of the fault diagnosis information, or after generating an alarm log corresponding to the data error, the method further includes: The analysis result or the alarm log is reported to the terminal through the baseboard management controller.
13. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the fault reporting method according to any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the fault reporting method according to any one of claims 1 to 12 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the fault reporting method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Data processing method and device of ring buffers and set top box
CN108897700A
Server and method for data exchange between BMC and BIOS
CN111190749A
Log storage method for syslog of embedded linux system
CN113672572A
Fault-recoverable firmware detection system and method, storage medium and server
CN117389790A
Fault diagnosis drive loading method and device, electronic equipment and storage medium
CN117806721A
Cited By
Voltage fault diagnosis system and method, electronic equipment, medium and product
CN119827833A
