Fault location method, device, electronic device and storage medium for abnormal BMC restart

By monitoring the dog feeding operation of the BMC system and using the double cache area to store the timestamp, the problem of inaccurate fault location of the BMC system abnormal restart in the prior art is solved, and more accurate fault location and storage reliability are achieved.

CN115757042BActive Publication Date: 2024-11-05NETTRIX INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211510743.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2024-11-05
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

The prior art is difficult to accurately locate the cause of abnormal restart of BMC system, especially when the time interval between the hardware watchdog triggers an interrupt and restart is short, and abnormal information of a specific process cannot be collected completely, resulting in inaccurate fault location or inability to locate.

Method used

By monitoring the dog feeding operation of the BMC system, obtaining the current timestamp, and obtaining the timestamp stored before restart after each abnormal restart, determining the time period for failure occurrence, and obtaining the log information within that time period so as to more accurately locate the fault . Use double cache areas and preset cache identification bits to ensure that the timestamps before and after restart are stored independently, avoid overwriting, and improve storage reliability.

Benefits of technology

It realizes more accurate and comprehensive positioning of BMC system abnormal restart failures, improves the accuracy and reliability of fault positioning, and avoids positioning errors caused by time stamp loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757042B_ABST
    Figure CN115757042B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, electronic device and storage medium for locating a fault of abnormal restart of a BMC. The method includes: real-time monitoring of the dog feeding operation of the BMC system, and obtaining the current timestamp each time the BMC system performs the dog feeding operation, and then determining a preset storage location, and storing the obtained timestamp in the preset storage location. After each abnormal restart of the BMC system, obtain the timestamp stored between the restarts, and determine the time period when the fault occurs based on the timestamp before the restart, and then obtain the log information of the BMC system during the time period when the fault occurs, and finally locate the fault of the abnormal restart of the BMC system according to the log information. Based on this, after the restart, the time period when the fault occurs can be determined according to the timestamp stored before the restart, and then the fault of the abnormal restart can be more accurately and comprehensively located according to the log information recorded by the system during the time period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of fault monitoring, and in particular to a method, device, electronic device, and storage medium for locating a fault of an abnormal restart of a BMC. Background Art

[0002] The Baseboard Management Controller (BMC) system is a Linux operating system running on a BMC chip. Due to the high complexity of the system, the probability of failure during daily operation is relatively high.

[0003] In order to prevent the BMC system from continuously failing to work when a fault occurs, a hardware watchdog mechanism is usually set on the BMC chip, and the hardware watchdog is set to be fed regularly in the BMC system kernel. If a fault or error occurs in the BMC system, the above-mentioned scheduled feeding operation will be affected and the scheduled feeding operation will not be possible. At this time, the hardware watchdog will trigger an interrupt to restart the BMC system from the hardware level, so as to break the situation where the BMC system cannot work continuously when a fault occurs and restore the BMC system to normal.

[0004] At present, in order to determine the cause of abnormal restart of the BMC system, the status of the hardware watchdog is usually monitored, and after the watchdog is detected to trigger an interrupt and before the BMC system restarts abnormally, the abnormal information of the specific process is collected, and after the restart is successful, the cause of the fault that caused the abnormal restart of the system is located based on the collected abnormal information. However, this method can only be used for specific application processes, and it is impossible to locate the fault based on the entire BMC system. In addition, the time interval between the triggering interrupt and the abnormal restart of the BMC system is short, and it may be impossible to fully collect the abnormal information of the specific process, resulting in inaccurate fault location or even the problem of being unable to locate the fault. Summary of the invention

[0005] The embodiments of the present application provide a method, device, electronic device and storage medium for locating a fault of an abnormal BMC restart, so as to improve the accuracy of fault locating.

[0006] In a first aspect, an embodiment of the present application provides a method for locating a fault of an abnormal BMC restart, the method comprising:

[0007] Monitoring the dog feeding operation of the BMC system, and obtaining a current timestamp each time the BMC system performs the dog feeding operation;

[0008] Determine a preset storage location, and store the acquired timestamp in the preset storage location;

[0009] After each abnormal restart of the BMC system, obtaining a timestamp stored before the restart;

[0010] Determine a time period during which the fault occurs based on the timestamp stored before the restart, and obtain log information of the BMC system during the time period during which the fault occurs;

[0011] The fault of abnormal restart of the BMC system is located according to the log information within the time period of the fault occurrence.

[0012] Optionally, determining a preset storage location includes:

[0013] Obtaining a value of a preset cache flag, and if the value of the preset cache flag is a first preset value, setting a first cache area in a pre-applied memory space as a preset storage location;

[0014] If the value of the preset cache flag is a second preset value, the second cache area in the pre-applied memory space is set as a preset storage location.

[0015] In the above technical solution, dual buffer areas and preset buffer identification bits are introduced, so that the buffer area to be stored can be identified by the preset buffer identification bits, ensuring that the dog feeding timestamp before a certain fault occurs is not overwritten by the dog feeding timestamp after the fault.

[0016] Optionally, the method further includes:

[0017] After each abnormal restart of the BMC system, the value of the preset cache flag is updated.

[0018] In the above embodiment, by setting the abnormal restart of the BMC system as a trigger mechanism for updating the preset cache flag, the timestamps before and after the restart can be stored independently, and the timestamp after the restart will not overwrite the timestamp stored before the restart.

[0019] Optionally, after each abnormal restart of the BMC system, updating the value of the preset cache flag bit includes:

[0020] After each abnormal restart of the BMC system, the value of the current preset cache flag is determined.

[0021] If the current value of the preset cache flag is the first preset value, updating the value of the preset cache flag to a second preset value;

[0022] If the current value of the preset cache flag is the second preset value, the value of the preset cache flag is updated to the first preset value.

[0023] In the above embodiment, after restarting, the preset cache flag is updated by utilizing the transition between the first preset value and the second preset value.

[0024] Optionally, before determining the preset storage location, the method further includes:

[0025] It is determined whether it is the first time to store the timestamp. If it is the first time, the first cache area, the second cache area and the corresponding offset pointer in the pre-applied memory space are cleared, and the value of the preset cache flag is initialized.

[0026] In the above embodiment, the influence of invalid data that may exist in the buffer area and the offset pointer on the storage process during the first storage is avoided.

[0027] Optionally, the method further includes:

[0028] When receiving a timestamp read request, obtain the current value of the preset cache flag;

[0029] If the current value of the preset cache flag is a first preset value, reading a timestamp from a first cache area in a pre-applied memory space;

[0030] If the current value of the preset cache flag is a second preset value, reading a timestamp from a second cache area in the pre-applied memory space;

[0031] The read timestamp is stored in the form of a file in a pre-created file directory.

[0032] In the above embodiment, the currently stored timestamp information can be read from the corresponding cache area by using the current value of the preset cache flag, and stored in a file format so that it can be easily displayed to the application layer for operation by the application layer.

[0033] Optionally, the method further includes:

[0034] After each abnormal restart of the BMC system, the files in the pre-created file directory are transferred to the non-volatile memory.

[0035] In the above embodiment, the loss of timestamp data during power failure is avoided, thereby improving the reliability of timestamp storage.

[0036] In a second aspect, an embodiment of the present application further provides a fault locating device for abnormal BMC restart, the fault locating device for abnormal BMC restart comprising:

[0037] A timestamp acquisition module is used to monitor the dog feeding operation of the BMC system and obtain the current timestamp each time the BMC system performs the dog feeding operation;

[0038] A storage module, used to determine a preset storage location and store the acquired timestamp in the preset storage location;

[0039] A timestamp reading module, used for obtaining the timestamp stored before the restart each time the BMC system restarts abnormally;

[0040] A log acquisition module, used to determine the time period when the fault occurs based on the timestamp stored before the restart, and obtain log information of the BMC system during the time period when the fault occurs;

[0041] The fault locating module is used to locate the fault of abnormal restart of the BMC system according to the log information within the time period of the fault occurrence.

[0042] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:

[0043] one or more processors;

[0044] a storage device for storing one or more programs,

[0045] When the one or more programs are executed by the one or more processors, the one or more processors implement the fault locating method for abnormal BMC restart provided in any embodiment of the present application.

[0046] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the fault locating method for abnormal restart of the BMC as provided in any embodiment of the present application is implemented.

[0047] In the technical solution of the embodiment of the present application, the dog feeding operation of the BMC system is monitored in real time, and each time the BMC system performs the dog feeding operation, the current timestamp is obtained, and then the preset storage location is determined, and the obtained timestamp is stored in the preset storage location. After each abnormal restart of the BMC system, the timestamp stored between the restarts is obtained, and the time period of the fault occurrence is determined based on the timestamp before the restart, and then the log information of the BMC system in the time period of the fault occurrence is obtained, and finally the fault of the abnormal restart of the BMC system is located according to the log information. Based on this, when the BMC system is operating normally, the dog feeding operation will be performed regularly, but the dog feeding may be stopped after the fault occurs, and there will be no timestamp that can be saved at this time. Then after the restart, the time period of the fault occurrence can be determined according to the timestamp stored before the restart, and then the fault of the abnormal restart can be located more accurately and comprehensively according to the log information recorded by the system in the time period. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for locating a fault caused by abnormal BMC restart provided in Embodiment 1 of the present application;

[0049] Figure 2 A schematic diagram of a fault location process for abnormal BMC restart provided in Embodiment 2 of the present application;

[0050] Figure 3 A schematic diagram of the structure of a fault location device for abnormal BMC restart provided in Embodiment 3 of the present application;

[0051] Figure 4 A schematic diagram of the structure of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION

[0052] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.

[0053] Embodiment 1

[0054] Figure 1 The flowchart of the fault location method for abnormal BMC restart provided in the first embodiment of the present application is shown in FIG. This embodiment is applicable to the scenario of fault location for abnormal BMC restart. The method can be executed by a fault location device for abnormal BMC restart, which can be implemented in hardware and / or software and can generally be integrated in an electronic device such as a computer with data computing capabilities, and specifically includes the following steps:

[0055] Step 101: monitor the dog feeding operation of the BMC system, and obtain the current timestamp each time the BMC system performs the dog feeding operation.

[0056] When the BMC system is operating normally, it will periodically perform the dog feeding operation, which usually sends a dog feeding instruction to the watchdog system. Therefore, this embodiment can monitor whether the BMC system issues the dog feeding instruction. If it is detected that the dog feeding instruction is issued, it is determined that the BMC system is performing the dog feeding operation.

[0057] Specifically, it can be achieved by detecting all information sent by the BMC system to the watchdog system. Every time it is detected that the BMC system has sent information whose target is the watchdog system, the information is parsed and it is determined whether the parsed result contains a dog feeding instruction. If so, it can be determined that the dog feeding instruction has been monitored.

[0058] By the above means, when it is detected that the BMC system performs the dog feeding operation, the timestamp at this time can be obtained, that is, the timestamp when the BMC system performs the dog feeding operation is obtained. It should be noted that the timestamp format can be "year / month / day / hour / minute / second / millisecond". In a specific example, the timestamp can be "2022 / 10 / 11 / 08 / 24 / 35 / 65".

[0059] Step 102: Determine a preset storage location, and store the acquired timestamp in the preset storage location.

[0060] In this step, the preset storage location is located in the memory space pre-allocated from the reserved memory of the BMC system. In order to realize independent storage of the timestamps before and after the restart and avoid the timestamp after the restart being lost due to the reset of the offset pointer used for caching after the restart, which overwrites the storage location of the timestamp before the restart, the allocated memory space can be set to a double cache structure.

[0061] Specifically, a first cache area and a second cache area are set in the memory space, and corresponding preset values ​​are set for the first cache area and the second cache area respectively, and then a preset cache flag is set to store the preset value. The location where the timestamp is currently stored is determined by identifying the value of the preset cache flag, and the location where the timestamp is currently stored is changed by modifying the value of the preset cache flag.

[0062] Based on the above-mentioned pre-set settings, when this step determines the preset storage location, the value of the preset cache identification bit can be obtained first. If the value of the preset cache identification bit is a first preset value, the first cache area in the pre-applied memory space is set to the preset storage location; if the value of the preset cache identification bit is a second preset value, the second cache area in the pre-applied memory space is set to the preset storage location.

[0063] In a specific example, the first preset value may be "0", the second preset value may be "1", the identifier of the first cache area is the first preset value, and the identifier of the second cache area is the second preset value. When determining the preset storage location, first obtain the value in the preset cache identifier, and then determine whether the value is "1" or "0". If it is "1", that is, the second preset value, then the preset storage location is the second cache area; if it is "0", that is, the first preset value, then the preset storage location is the first cache area.

[0064] It should be noted that before determining the preset storage location, it is determined whether this is the first time the timestamp is stored. If it is the first time, the first cache area, the second cache area and their corresponding offset pointers in the pre-applied memory space are cleared, and the value of the preset cache flag is initialized.

[0065] Specifically, a log record may be made for each storage operation. Before determining the preset storage location each time, it may be determined whether this is the first storage based on the log record. If there is a relevant log record, it is not the first storage. In this case, the step of determining the preset storage location may be directly executed.

[0066] If there is no relevant log record, it is the first storage, and the first cache area, the second cache area, the corresponding offset pointer can be cleared and the preset cache flag can be initialized to the first preset value or the second preset value, and then the step of determining the preset storage location is performed.

[0067] In this step, after determining the preset storage location, the obtained timestamp can be stored in the preset storage location. It should be noted that since there are multiple storage bits in each cache area, the specific storage bit can be obtained by relying on the offset pointer. The storage process can refer to the relevant technology of storing data in the cache area relying on the offset pointer, which will not be repeated here.

[0068] Furthermore, after each abnormal restart of the BMC system, the value of the preset cache flag is updated, usually by updating the first preset value to the second preset value or updating the second preset value to the first preset value.

[0069] Based on the above update operation, when storing the timestamp before and after the restart, the preset storage locations determined are the first cache area and the second cache area respectively. For example, the preset storage location determined before the restart is the first cache area, and after the restart, the value of the preset cache flag is updated, and the first preset value is updated to the second preset value. The preset storage location determined after the restart is the second cache area, so that the preset storage locations determined before and after the restart are different.

[0070] The specific update process may be: after each abnormal restart of the BMC system, determine the value of the current preset cache flag; if the value of the current preset cache flag is the first preset value, update the value of the preset cache flag to the second preset value; if the value of the current preset cache flag is the second preset value, update the value of the preset cache flag to the first preset value.

[0071] In a specific example, after an abnormal restart, the value of the current preset cache flag is determined to be "1", indicating that the preset storage location determined before the restart is the second cache area. At this time, "1" is updated to "0", and the preset storage location determined thereafter is the first cache area.

[0072] It should be noted that the update may occur at any time within a period after the restart and before the first dog feeding operation is performed after the restart.

[0073] In order to avoid data loss in the cache area after power failure, this embodiment can also transfer files in the pre-created file directory to the non-volatile memory after each abnormal restart of the BMC system. Since the non-volatile memory will not be affected by power failure, that is, the stored data will not be lost after power failure, after this operation, the stored timestamp will not be lost or damaged due to system power failure, and subsequent fault location based on the timestamp can be performed at any time, which provides convenience for subsequent comprehensive analysis.

[0074] It should be noted that the files in the pre-created file directory are obtained after a read operation. Since the present embodiment adopts a double buffer area to store the timestamp, when reading, the reading position needs to be determined according to the value in the preset buffer flag.

[0075] Specifically, when a timestamp read request is received, the current value of the preset cache flag is obtained; if the current value of the preset cache flag is a first preset value, the timestamp is read from the first cache area in the pre-applied memory space; if the current value of the preset cache flag is a second preset value, the timestamp is read from the second cache area in the pre-applied memory space; the read timestamp is stored in the form of a file in a pre-created file directory.

[0076] Among them, the timestamp reading request can be generated and sent periodically, so as to read the timestamp in the cache area into the file, and then cooperate with the aforementioned transfer operation (ie, transfer the file to the non-volatile memory), thereby improving the reliability of the timestamp storage.

[0077] In addition, in order to avoid repeated reading of the timestamp in the cache area, the specific location of the cache area read can be recorded each time the timestamp is read, and the next reading can start from the next storage address of the specific location.

[0078] Specifically, after reading the timestamp, record the value of the preset cache identification bit corresponding to the read cache area and the last read address. When reading next time, first determine whether the value of the current preset cache identification bit is consistent with the value recorded last. If they are consistent, start reading from the next address of the last read address. If they are inconsistent, read all timestamps from the corresponding cache area.

[0079] Furthermore, the timestamp reading request may also be issued by the user layer. The user may generate and issue the timestamp reading request in the user layer according to the requirements, and then read the corresponding file from the file directory to obtain the read timestamp.

[0080] It should be noted that in addition to the timestamp, the content stored in the file may also include the reading position (such as the first cache area or the second cache area) and the number of timestamps stored before the reading position changes, that is, the number of timestamps stored by this device before each system restart and after the previous restart.

[0081] Step 103: After each abnormal restart of the BMC system, obtain the timestamp stored before the restart, determine the time period when the fault occurs based on the timestamp stored before the restart, and obtain log information of the BMC system in the time period when the fault occurs.

[0082] In this step, when determining the fault occurrence time period, the latest timestamp before the restart can be used as the start time of the fault occurrence time period, and the current time can be used as the end time of the fault occurrence time period. The start time and the end time constitute the fault occurrence time period.

[0083] Furthermore, sometimes after a fault occurs, it takes a period of time to cause the dog feeding operation to fail, and the fault occurrence time period determined above may not include the time when the fault occurs. Therefore, in this embodiment, a tolerance time can be set in advance, and then the above start time can be moved forward by the tolerance time to obtain a new start time, and the new start time and end time are used to form the fault occurrence time period.

[0084] In a specific example, the tolerance time may be 20 seconds, and the time corresponding to the latest timestamp is 8:30:25 on October 31, 2022. After the tolerance time is moved forward, the new start time is 8:30:05 on October 31, 2022.

[0085] After determining the time period when the fault occurs, the log information of the BMC system during the time period when the fault occurs can be obtained. It should be noted that each log has a corresponding log time, and all logs corresponding to the log time within the time period when the fault occurs can be filtered to obtain the log information within the time period when the fault occurs.

[0086] Step 104: locate the fault of abnormal restart of the BMC system according to the log information in the time period when the fault occurs.

[0087] In this step, the fault is located according to the log information. It should be noted that the specific process of the location can refer to the relevant technology and will not be repeated here.

[0088] In the technical solution of the embodiment of the present application, the dog feeding operation of the BMC system is monitored in real time, and each time the BMC system performs the dog feeding operation, the current timestamp is obtained, and then the preset storage location is determined, and the obtained timestamp is stored in the preset storage location. After each abnormal restart of the BMC system, the timestamp stored between the restarts is obtained, and the time period of the fault occurrence is determined based on the timestamp before the restart, and then the log information of the BMC system in the time period of the fault occurrence is obtained, and finally the fault of the abnormal restart of the BMC system is located according to the log information. Based on this, when the BMC system is operating normally, the dog feeding operation will be performed regularly, but the dog feeding may be stopped after the fault occurs, and there will be no timestamp that can be saved at this time. Then after the restart, the time period of the fault occurrence can be determined according to the timestamp stored before the restart, and then the fault of the abnormal restart can be located more accurately and comprehensively according to the log information recorded by the system in the time period.

[0089] Embodiment 2

[0090] Figure 2 A schematic diagram of a fault location process for abnormal BMC restart provided in the second embodiment of the present application. Figure 2 As shown, the fault location process of abnormal BMC restart provided by this embodiment may include:

[0091] Step 201: When the system is started for the first time, a memory space of a preset size is divided in the reserved memory, and the memory space is set as a double buffer structure.

[0092] Step 202: During the operation of the system, the dog feeding operation is performed according to a preset time period, and the dog feeding operation is monitored.

[0093] Step 203: Obtain the current timestamp each time the BMC system performs a dog feeding operation.

[0094] Step 204: Obtain the value of the preset cache flag and determine whether the value is a first preset value.

[0095] Step 205: If the value of the preset cache flag is a first preset value, a first cache area in the pre-applied memory space is set as a preset storage location.

[0096] Step 206: If the value of the preset cache flag is a second preset value, the second cache area in the pre-applied memory space is set to a preset storage location.

[0097] Step 207: Store the acquired timestamp in a preset storage location.

[0098] Step 208: After each abnormal restart of the BMC system, determine whether the value of the current preset cache flag is the first preset value.

[0099] Step 209: If the current value of the preset cache flag is the first preset value, update the value of the preset cache flag to the second preset value.

[0100] Step 210: If the current value of the preset cache flag is the second preset value, update the value of the preset cache flag to the first preset value.

[0101] Step 211: After each abnormal restart of the BMC system, obtain the timestamp stored before the restart.

[0102] Step 212: Determine the time period when the fault occurs based on the timestamp stored before the restart.

[0103] Step 213: Obtain log information of the BMC system during the time period when the fault occurs.

[0104] Step 214: locate the fault of abnormal restart of the BMC system according to the log information in the time period when the fault occurs.

[0105] In the solution of this embodiment, when the BMC system is operating normally, the dog feeding operation will be performed regularly, but after a fault occurs, the dog feeding may be stopped, and at this time there will be no timestamp that can be saved. Then, after restarting, the time period when the fault occurred can be determined based on the timestamp stored before the restart, and then the fault of abnormal restart can be more accurately and comprehensively located based on the log information recorded by the system during the time period.

[0106] Embodiment 3

[0107] Figure 3 This is a schematic diagram of the structure of a fault location device for abnormal BMC restart provided in Example 3 of the present application. The fault location device for abnormal BMC restart provided in the present application embodiment can execute the fault location method for abnormal BMC restart provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. The device can be implemented in software and / or hardware, such as Figure 3 As shown, the fault locating device for abnormal BMC restart specifically includes: a timestamp acquisition module 301 , a storage module 302 , a timestamp reading module 303 , a log acquisition module 304 , and a fault locating module 305 .

[0108] The timestamp acquisition module is used to monitor the dog feeding operation of the BMC system and obtain the current timestamp each time the BMC system performs the dog feeding operation;

[0109] A storage module, used to determine a preset storage location and store the acquired timestamp in the preset storage location;

[0110] The timestamp reading module is used to obtain the timestamp stored before the restart after each abnormal restart of the BMC system;

[0111] A log acquisition module, used to determine the time period when the fault occurred based on the timestamp stored before the restart, and obtain the log information of the BMC system during the time period when the fault occurred;

[0112] The fault location module is used to locate the fault of abnormal restart of the BMC system according to the log information within the time period when the fault occurs.

[0113] In the technical solution of the embodiment of the present application, when the BMC system is operating normally, the dog feeding operation will be performed regularly, but the dog feeding may be stopped after a fault occurs. At this time, there will be no timestamp that can be saved. Then, after restarting, the time period when the fault occurred can be determined based on the timestamp stored before the restart. Then, the fault of the abnormal restart can be located more accurately and comprehensively based on the log information recorded by the system during the time period.

[0114] Furthermore, the storage module includes:

[0115] A first storage unit is used to obtain a value of a preset cache flag, and if the value of the preset cache flag is a first preset value, set a first cache area in a pre-applied memory space as a preset storage location;

[0116] The second storage unit is used to set the second cache area in the pre-applied memory space to the preset storage position if the value of the preset cache flag is a second preset value.

[0117] Furthermore, the device also includes:

[0118] The flag bit update module is used to update the value of the preset cache flag bit after each abnormal restart of the BMC system.

[0119] Furthermore, the identification bit update module includes:

[0120] A flag value determination unit, used to determine the value of the current preset cache flag after each abnormal restart of the BMC system;

[0121] A first updating unit, configured to update the value of the preset cache flag to a second preset value if the current value of the preset cache flag is the first preset value;

[0122] The second updating unit is configured to update the value of the preset cache flag to the first preset value if the current value of the preset cache flag is the second preset value.

[0123] Furthermore, the device also includes:

[0124] The initialization module is used to determine whether it is the first time to store the timestamp. If it is the first time, the first cache area, the second cache area and the corresponding offset pointer in the pre-applied memory space are cleared, and the value of the preset cache identification bit is initialized.

[0125] Furthermore, the device also includes:

[0126] The identification bit value acquisition module is used to obtain the current value of the preset cache identification bit when receiving a timestamp read request;

[0127] A first reading module, configured to read a timestamp from a first cache area in a pre-applied memory space if a current value of the preset cache flag is a first preset value;

[0128] A second reading module is used to read the timestamp from the second cache area in the pre-applied memory space if the current value of the preset cache flag is a second preset value;

[0129] The file storage module is used to store the read timestamp in the form of a file in a pre-created file directory.

[0130] Furthermore, the device also includes:

[0131] The transfer module is used to transfer the files in the pre-created file directory to the non-volatile memory after each abnormal restart of the BMC system.

[0132] Embodiment 4

[0133] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present application is shown in FIG. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of the processor 410 in the electronic device can be one or more. Figure 4 A processor 410 is taken as an example; the processor 410, the memory 420, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0134] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the fault location method for abnormal BMC restart in the embodiment of the present invention (for example, the timestamp acquisition module 301, storage module 302, timestamp reading module 303, log acquisition module 304, and fault location module 305 in the fault location device for abnormal BMC restart). The processor 410 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 420, that is, implements the above-mentioned fault location method for abnormal BMC restart:

[0135] Monitor the dog feeding operation of the BMC system and obtain the current timestamp each time the BMC system performs the dog feeding operation;

[0136] Determine a preset storage location, and store the acquired timestamp in the preset storage location;

[0137] After each abnormal restart of the BMC system, obtain the timestamp stored before the restart, determine the time period when the fault occurs based on the timestamp stored before the restart, and obtain the log information of the BMC system during the time period when the fault occurs;

[0138] Locate the fault that caused the BMC system to restart abnormally based on the log information during the time period when the fault occurred.

[0139] The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0140] Embodiment 5

[0141] Embodiment 5 of the present application further provides a storage medium including computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute a fault location method for abnormal restart of a BMC. The method includes:

[0142] Monitor the dog feeding operation of the BMC system and obtain the current timestamp each time the BMC system performs the dog feeding operation;

[0143] Determine a preset storage location, and store the acquired timestamp in the preset storage location;

[0144] After each abnormal restart of the BMC system, obtain the timestamp stored before the restart, determine the time period when the fault occurs based on the timestamp stored before the restart, and obtain the log information of the BMC system during the time period when the fault occurs;

[0145] Locate the fault that caused the BMC system to restart abnormally based on the log information during the time period when the fault occurred.

[0146] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present application are not limited to the above method operations, and can also execute related operations in the fault locating method for abnormal BMC restart provided in any embodiment of the present application.

[0147] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0148] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0149] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for locating a fault when a BMC restarts abnormally, characterized in that: The method comprises: Monitoring the dog feeding operation of the BMC system, and obtaining a current timestamp each time the BMC system performs the dog feeding operation; Determine a preset storage location, and store the acquired timestamp in the preset storage location; After each abnormal restart of the BMC system, obtain the timestamp stored before the restart, determine the time period of the fault occurrence based on the timestamp stored before the restart, and obtain the log information of the BMC system in the time period of the fault occurrence; Locate the fault of abnormal restart of the BMC system according to the log information within the time period when the fault occurs; The step of determining a preset storage location includes: Obtaining a value of a preset cache flag, and if the value of the preset cache flag is a first preset value, setting a first cache area in a pre-applied memory space as a preset storage location; If the value of the preset cache flag is a second preset value, setting the second cache area in the pre-applied memory space as a preset storage location; The obtaining of the timestamp stored before the restart, and determining the time period in which the fault occurs based on the timestamp stored before the restart, includes: The latest timestamp before the restart is used as the starting time of the fault occurrence time period, and the current time is used as the ending time of the fault occurrence time period. The starting time and the ending time constitute the fault occurrence time period.

2. The method according to claim 1, characterized in that: The method further comprises: After each abnormal restart of the BMC system, the value of the preset cache flag is updated.

3. The method according to claim 2, characterized in that After each abnormal restart of the BMC system, updating the value of the preset cache flag bit includes: After each abnormal restart of the BMC system, determining the current value of the preset cache flag; If the current value of the preset cache flag is the first preset value, updating the value of the preset cache flag to a second preset value; If the current value of the preset cache flag is the second preset value, the value of the preset cache flag is updated to the first preset value.

4. The method according to claim 1, characterized in that: Before determining the preset storage location, the method further includes: It is determined whether it is the first time to store the timestamp. If it is the first time, the first cache area, the second cache area and the corresponding offset pointer in the pre-applied memory space are cleared, and the value of the preset cache flag is initialized.

5. The method according to claim 1, characterized in that The method further comprises: When receiving a timestamp read request, obtain the current value of the preset cache flag; If the current value of the preset cache flag is a first preset value, reading a timestamp from a first cache area in a pre-applied memory space; If the current value of the preset cache flag is a second preset value, reading a timestamp from a second cache area in the pre-applied memory space; The read timestamp is stored in the form of a file in a pre-created file directory.

6. The method according to claim 5, characterized in that The method further comprises: After each abnormal restart of the BMC system, the files in the pre-created file directory are transferred to the non-volatile memory.

7. A fault location device for abnormal BMC restart, characterized in that: The device comprises: A timestamp acquisition module is used to monitor the dog feeding operation of the BMC system and obtain the current timestamp each time the BMC system performs the dog feeding operation; A storage module, used to determine a preset storage location and store the acquired timestamp in the preset storage location; A timestamp reading module, used for obtaining the timestamp stored before the restart each time the BMC system restarts abnormally; A log acquisition module, used to determine the time period when the fault occurs based on the timestamp stored before the restart, and obtain log information of the BMC system during the time period when the fault occurs; A fault location module, used to locate the fault of abnormal restart of the BMC system according to the log information within the time period of the fault occurrence; The storage module is used to obtain a value of a preset cache identification bit, and if the value of the preset cache identification bit is a first preset value, set a first cache area in a pre-applied memory space as a preset storage location; If the value of the preset cache flag is a second preset value, setting the second cache area in the pre-applied memory space as a preset storage location; The log acquisition module is used to use the latest timestamp before the restart as the starting time of the fault occurrence time period and the current time as the ending time of the fault occurrence time period, and the starting time and the ending time constitute the fault occurrence time period.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the fault locating method for abnormal BMC restart as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the fault locating method for abnormal BMC restart as claimed in any one of claims 1 to 6 is implemented.