CN113010387A - Monitoring method and device - Google Patents
Monitoring method and device Download PDFInfo
- Publication number
- CN113010387A CN113010387A CN202110309502.2A CN202110309502A CN113010387A CN 113010387 A CN113010387 A CN 113010387A CN 202110309502 A CN202110309502 A CN 202110309502A CN 113010387 A CN113010387 A CN 113010387A
- Authority
- CN
- China
- Prior art keywords
- processor
- log file
- processing operation
- exception
- abnormal state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3024—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application provides a monitoring method and a monitoring device, wherein a first processor is determined to be in an abnormal state, and a second processor is controlled to send a log file generation instruction to the first processor in response to the first processor being in the abnormal state; responding to a log file generation instruction, generating a log file, and storing the log file in a storage medium of a second processor, wherein the log file is generated when the first processor is in an abnormal state, and the log file is used for indicating the reason of the abnormality of the first processor, so that the reason of the abnormality of the first processor can be captured when the first processor is in the abnormal state, the reason of the abnormality can also be captured if the first processor is in the abnormal state, the random abnormality is recovered through the reason of the abnormality, and the electronic equipment is repaired through the reason of the abnormality, so that the probability of the abnormality is reduced.
Description
Technical Field
The present application belongs to the field of monitoring technologies, and in particular, to a monitoring method and apparatus.
Background
In order to provide electronic equipment with reliable quality, the quality is guaranteed at a product design end, for example, the electronic equipment is subjected to multi-aspect performance test through multiple tests before the electronic equipment leaves a factory, but the performance test on the electronic equipment before the electronic equipment leaves the factory is limited, and random anomalies may occur along with the use of the electronic equipment, wherein the random anomalies are not generated in the performance test process.
Disclosure of Invention
The application provides a monitoring method and a monitoring device.
In one aspect, a monitoring method applied to an electronic device, the electronic device including a first processor and a second processor, includes:
determining that the first processor is in an exception state;
responding to the abnormal state of the first processor, and controlling the second processor to send a log file generation instruction to the first processor;
responding to the log file generation instruction, and generating a log file, wherein the log file is generated when the first processor is in the abnormal state, and the log file is used for indicating the reason of the abnormality of the first processor;
storing the log file in a storage medium of the second processor.
Optionally, the method further includes:
controlling the first processor to execute a first processing operation to restore the first processor from exception to normal using the first processing operation;
after the first processor is recovered to be normal, obtaining the log file from the storage medium of the second processor;
and controlling the first processor to execute a second processing operation corresponding to the log file so as to eliminate the exception existing in the first processor by using the second processing operation, wherein the exception existing in the first processor corresponds to the log file.
Optionally, the log file generation instruction is a restart instruction, where the restart instruction is used to instruct the first processor to generate the log file before restarting and send the log file to the second processor;
the generating a log file in response to the log file generation instruction comprises: responding to the restarting instruction, generating the log file, and responding to the restarting instruction, wherein the first processor is still in an abnormal state and does not execute power-off operation;
the method further comprises the following steps: responding to the restart instruction, controlling the first processor to send the log file to the second processor, wherein the first processor is still in an abnormal state and does not execute a power-off operation when the log file is sent;
and controlling the first processor to execute power-off to restart the first processor, and restoring the first processor from an exception to a normal state by using a restart operation.
Optionally, the determining that the first processor is in an abnormal state includes:
determining that the first processor is in an abnormal state if the target assembly is monitored to be touched;
or
Obtaining, by the second processor, a state parameter of the first processor, determining, by the second processor, that the first processor is in an exception state based on the state parameter.
Optionally, the controlling, in response to that the first processor is in an abnormal state, the second processor to send a log file generation instruction to the first processor includes:
and responding to the abnormal state of the first processor, controlling the second processor to send a level signal to a first pin in the first processor, wherein the level signal is used for indicating the first processor to generate a log file, and the level signal is sent to the first pin through a second pin of the second processor and a connecting line between the first pin and the second pin.
Optionally, the controlling, in response to that the first processor is in an abnormal state, the second processor to send a log file generation instruction to the first processor includes:
and responding to the abnormal state of the first processor, controlling the second processor to send an interface command to the first processor, wherein the interface command is used for instructing the first processor to generate a log file, and the interface command is transmitted by using an interface bus between the first processor and the second processor.
In another aspect, the present application provides a monitoring method, including:
the method comprises the steps of obtaining a log file generated by a first processor in the electronic equipment, wherein the log file is generated when the first processor is abnormal, and the log file is used for indicating the reason of the abnormality of the first processor;
and storing the log file into a second processor in the electronic equipment, wherein the first processor enables the first processor to obtain the log file from the second processor after the first processor is recovered from the abnormality to be normal through a first processing operation, the first processing operation is different from a second processing operation, and the second processing operation can eliminate the abnormality corresponding to the log file.
In yet another aspect, the present application provides an electronic device comprising a first processor and a second processor;
the second processor is used for determining that the first processor is in an abnormal state, responding to the abnormal state of the first processor, and sending a log file generation instruction to the first processor;
the first processor is configured to generate a log file in response to the log file generation instruction, where the log file is generated when the first processor is in the abnormal state, and the log file is used to indicate a reason why the first processor is abnormal;
the second processor is further configured to store the log file in a storage medium of the second processor.
Optionally, the first processor is further configured to execute a first processing operation to restore the first processor from an exception to a normal state by using the first processing operation, obtain the log file from the storage medium of the second processor after the first processor is restored to the normal state, and execute a second processing operation corresponding to the log file to eliminate an exception existing in the first processor by using the second processing operation, where the exception existing in the first processor corresponds to the log file.
In yet another aspect, the present application provides a second processor comprising a storage medium and a processing unit;
the processing unit is used for obtaining a log file generated by a first processor in the electronic equipment, and storing the log file into the storage medium, wherein the log file is generated when the first processor is abnormal, and the log file is used for indicating the reason of the abnormality of the first processor; the first processor enables the first processor to obtain the log file from the second processor after the first processor is recovered from the exception to be normal through a first processing operation, the first processing operation is different from a second processing operation, and the second processing operation can eliminate the exception corresponding to the log file.
In still another aspect, the present application provides a storage medium having computer program codes stored therein, where the computer program codes are executed to implement the monitoring method.
The monitoring method and the monitoring device determine that the first processor is in the abnormal state, respond that the first processor is in the abnormal state, and control the second processor to send a log file generation instruction to the first processor; responding to a log file generation instruction, generating a log file, and storing the log file in a storage medium of a second processor, wherein the log file is generated when the first processor is in an abnormal state, and the log file is used for indicating the reason of the abnormality of the first processor, so that the reason of the abnormality of the first processor can be captured when the first processor is in the abnormal state, the reason of the abnormality can also be captured if the first processor is in the abnormal state, the random abnormality is recovered through the reason of the abnormality, and the electronic equipment is repaired through the reason of the abnormality, so that the probability of the abnormality is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a monitoring method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a storage log file provided by an embodiment of the present application;
FIG. 6 is a flow chart of another monitoring method provided by an embodiment of the present application;
FIG. 7 is a flow chart of yet another monitoring method provided by an embodiment of the present application;
FIG. 8 is a flow chart of yet another monitoring method provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a second processor according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an alternative structure of an electronic device implementing the monitoring method is shown, the electronic device including: first processor 10 and second processor 20, first processor 10 and second processor 20 may communicate bi-directionally, and first processor 10 and second processor 20 may communicate bi-directionally, but not limited to, over an ESPI (Enhanced-SPI) bus.
The second processor 20 comprises a storage medium 30, and the storage medium 30 may be a non-volatile memory such as a flash memory, and the content stored by the storage medium 30 is not lost after the power of the electronic device, so that the electronic device can store some important content in the storage medium 30 and can obtain the important content from the storage medium 30 after the electronic device is powered off. For example, a log file of the first processor 10 is stored in the storage medium 10, where the log file is used to indicate a reason for an abnormality of the first processor 10, and after the electronic device is powered on, the first processor 10 may obtain the log file from the storage medium 30 to determine the reason for the abnormality of the first processor 10.
In the present embodiment, the first processor 10 includes: a CPU (Central Processing Unit) and a PCH (Platform Controller Hub), wherein the PCH includes a PMC (Production Material Control) component and an ESPI Control component, and the PMC component and the ESPI Control component can communicate with each other in two directions. The second processor 20 may be an EC (Embedded Controller), and the storage medium 30 may be a Flash memory of the EC.
The PCH is positioned between the CPU and the EC, the EC can carry out bidirectional communication with the PCH through an ESPI bus, and then the bidirectional communication with the CPU is realized by the PCH. The Flash of the EC can store the log file of the CPU and the log file of the PCH.
Based on the electronic device shown in fig. 1, an embodiment of the present application provides a monitoring method, an optional flow of which is shown in fig. 2, and the monitoring method may include the following steps:
101: it is determined that the first processor is in an exception state.
The first processor may be in an abnormal state, which is a state in which software of the first processor is in an abnormal state and a state in which hardware of the first processor is in an abnormal state, and various exceptions may occur in the running process of the first processor; such as the operating system of the first processor not responding, the application running in the first processor not responding, the temperature of the first processor exceeding a temperature threshold, and so forth.
When the first processor is determined to be in the abnormal state, capturing a log file in response to the first processor being in the abnormal state, wherein the log file is used for indicating the reason of the abnormality; or the electronic equipment sets the importance degree for the exception of the first processor, and responds that the first processor is in the exception state if the importance degree of the exception causing the first processor to be in the exception state is greater than the threshold value.
One way to determine the importance of an anomaly is based on the number of occurrences of the anomaly, which is determined to be higher if the number of occurrences of the anomaly is higher, and another way to determine the importance of the anomaly is: and determining that the importance degree of the exception is higher if the identification information of the exception indicates that the exception occurs for the first time or higher if the identification information of the exception indicates that the exception is a random exception, wherein the random exception refers to an exception which occurs randomly in the running process of the first processor and is difficult to restore through simulation of the first processor. The method of determining the importance of the corresponding abnormality is not limited in this embodiment.
In this embodiment, the manner of determining that the first processor is in the abnormal state includes, but is not limited to, the following manners:
one way is to determine that the first processor is in an abnormal state if it is detected that the target device is touched. The target component may be a hot key in the electronic device, such as a power key, a shortcut key in an input component (such as a keyboard), and the like. The target component may communicate with the second processor to monitor whether the target component is touched by the second processor, and determine that the first processor is in an abnormal state if the target component is monitored by the second processor to be touched. The touch manner of the target device may be clicked/pressed, etc., and if the power key is pressed, the power key is considered to be touched. As shown in fig. 3, a hot key in the electronic device is connected to the EC, and an operation for the hot key can be monitored by the EC. If the EC monitors that the power key, the hotkey, is pressed, it determines that the first processor is in an abnormal state.
The target component may also be a component associated with an operating system running in the first processor, for example the target component is a menu option in the operating system. If the target component related to the operating System is detected to be triggered, the target component is transmitted to the second processor through a Basic Input Output System (BIOS), and the second processor determines that the first processor is in an abnormal state.
In another mode, a state parameter of the first processor is obtained by the second processor, the first processor is determined to be in an abnormal state by the second processor based on the state parameter, where the state parameter corresponds to the first processor, and may be a state parameter of hardware that assists the first processor in running during the running of the first processor, a state parameter of an operating system and an application program running on the first processor, and the like, and whether the first processor is in the abnormal state is determined by obtaining the state parameter of the first processor in some aspects. The embodiment may determine whether the processor is in an abnormal state based on at least one state parameter, for example, during the operation of the first processor, the state parameter of the first processor may change along with the operation of the first processor, and if the parameter value of the state parameter of the first processor is greater than the parameter threshold value, determine that the first processor is in the abnormal state. Taking the temperature of the first processor as an example, if the temperature of the first processor is greater than the temperature threshold, it is determined that the first processor is in the abnormal state, but this embodiment may also be determined based on a plurality of state parameters, and the state parameters of the first processor and how to determine that the first processor is in the abnormal state are not limited in this embodiment.
102: and controlling the second processor to send a log file generation instruction to the first processor in response to the first processor being in the abnormal state.
In this embodiment, the first processor and the second processor may perform bidirectional communication, and when the second processor sends the log file generation instruction to the first processor, the log file generation instruction may be sent through an interface bus between the first processor and the second processor.
As shown in fig. 1, the first processor and the second processor perform bidirectional communication through an ESPI bus, which illustrates that an interface bus, such as an ESPI bus, is connected between the first processor and the second processor, and one way for the second processor to send a log file generation instruction to the first processor is to control the second processor to send an interface command to the first processor, where the interface command is used to instruct the first processor to generate a log file, and the interface command is transmitted through the interface bus between the first processor and the second processor. For example, the first processor sends an ESPI OOB command, which is an interface command to instruct the first processor to generate a log file, to the second processor.
In addition to sending the log file generation instruction in the interface bus manner, the embodiment may also send the log file generation instruction in another manner, where the another manner may be that, in response to that the first processor is in an abnormal state, the second processor is controlled to send a level signal to the first pin in the first processor, the level signal is used to instruct the first processor to generate the log file, and the level signal is sent to the first pin through the second pin of the second processor and a connection line between the first pin and the second pin.
Wherein the level signal is a manner of generating the log file, if the level signal of the first pin of the first processor changes, the first processor is determined to be instructed to generate the log file. For the electronic equipment, a free pin is selected or a pin is multiplexed in the first processor and the second processor respectively, and the transmission of the level signal is completed through the connection between the pin and the pin. As shown by the dotted line in fig. 4, it is shown that the first pin and the second pin in the first processor are connected together by a wire, and if the first processor is in an abnormal state, the second processor sends a level signal to the first pin through the wire between the second pin and the first pin, so that the level signal in the first pin changes, for example, one of a change from none to some, a change from high to low, and a change from low to high is presented, and it is determined that the first processor is in an abnormal state.
One point to be pointed out here is: the first processor is in an exception state and a portion of the first processor's functionality is in an available state, such that the first processor is capable of generating instructions in response to the log file and communicating with the second processor.
103: and responding to the log file generation instruction, and generating a log file, wherein the log file is generated when the first processor is in an abnormal state and is used for indicating the reason of the abnormality of the first processor.
In the process of responding to the log file generation instruction, the first processor is still in an abnormal state, so that the reason of the abnormality of the first processor can be captured, and the reason of the abnormality of the first processor is written into the log file, thereby generating the log file. The reason for the abnormality of the first processor may be captured by the first processor, the first processor generates a log file, and sends the log file to the second processor, and the first processor sends the log file to the second processor through a bus connected between the two processors, for example, sending the log file through an ESPI bus.
104: the log file is stored in a storage medium of the second processor. The storage medium of the second processor may be a non-volatile memory, such as a flash memory of the second processor, and the log file may be stored in the flash memory, so that the log file is not lost after the electronic device is powered off, and the log file may be obtained from the flash memory after the electronic device is powered on.
One way for the storage medium of the second processor to store the log file is that the storage medium of the second processor stores one log file, deletes the previously stored log file in each log file storage process, and writes the previously stored log file into the log file stored this time, which can shorten the storage time of the log file although reducing the storage space occupation, and may have a possibility that the log file has been deleted when the first processor acquires the log file; another way for the storage medium of the second processor to store the log files is that the storage medium of the second processor may store a plurality of log files, the log files are sequentially stored according to an obtaining order, and at least one log file stored before is deleted when the storage space of the storage medium is insufficient.
In this embodiment, the first processor may include a CPU and a PCH, the corresponding generated log files include a CPU log file and a PCH log file, and the CPU log file and the PCH log file may be stored in a storage medium of the second processor, such as but not limited to the storage of the CPU log file and the PCH log file in the manner shown in fig. 5, data collision may be avoided by storing the CPU log file and the PCH log file in the storage medium in different areas, and the reason why the CPU and the PCH are abnormal may be recorded at the same time.
The monitoring method comprises the steps of determining that a first processor is in an abnormal state, responding to the abnormal state of the first processor, and controlling a second processor to send a log file generation instruction to the first processor; responding to a log file generation instruction, generating a log file, and storing the log file in a storage medium of a second processor, wherein the log file is generated when the first processor is in an abnormal state, and the log file is used for indicating the reason of the abnormality of the first processor, so that the reason of the abnormality of the first processor can be captured when the first processor is in the abnormal state, the reason of the abnormality can also be captured if the first processor is in the abnormal state, the random abnormality is recovered through the reason of the abnormality, and the electronic equipment is repaired through the reason of the abnormality, so that the probability of the abnormality is reduced.
Referring to fig. 6, which shows an optional flow of another monitoring method provided in the embodiment of the present application, on the basis of fig. 2, the method may further include the following steps:
105: the first processor is controlled to execute the first processing operation to restore the first processor from the abnormal state to the normal state by the first processing operation, i.e. the first processor switches from being in the abnormal state to the normal state by executing the first processing operation, e.g. one way of the first processing operation is to restart the operation of the first processor, which is restored to the normal state by the first processor executing the restart operation.
In this embodiment, the restart operation may be triggered by a hot key in the electronic device, the second processor monitors the operation of the hot key in the electronic device, and if the second processor monitors that the hot key triggers the restart operation, the second processor sends a restart instruction to the first processor, so that the first processor responds to the restart instruction, and the first processor is recovered to be normal by restarting.
106: and after the first processor is recovered to be normal, obtaining the log file from the storage medium of the second processor. And after the first processor is recovered to be normal, sending a log file uploading instruction to the second processor, responding to the log file uploading instruction, and obtaining the log file from the storage medium of the second processor, or after the first processor is recovered to be normal, directly extracting the log file from the storage medium through the connection between the first processor and the second processor.
The storage medium of the second processor allocates a storage space to the log file when storing the log file, and the storage space is pointed to by an identification information, so that the log file can be obtained based on the identification information when obtaining the log file from the storage medium of the second processor.
In this embodiment, the storage medium of the second processor may open an access right item to the operation and maintenance staff in addition to the first processor, and the storage medium of the second processor may be accessed by the grasping tool, so that the operation and maintenance staff may obtain a log file from the storage medium, and adjust the other electronic devices by using the abnormality indicated in the log file, so as to reduce the probability of occurrence of such abnormality in the other electronic devices.
107: and controlling the first processor to execute a second processing operation corresponding to the log file so as to eliminate the exception existing in the first processor by using the second processing operation, wherein the exception existing in the first processor corresponds to the log file.
Although the first processor is restored to normal by executing the first processing operation, the reason that the first processor has the abnormality indicated by the log file is not eliminated yet, so that the first processor still has a situation that the abnormality indicated by the log file occurs again, and for this problem, the embodiment controls the first processor to execute the second processing operation corresponding to the log file, and the second processing operation can eliminate the abnormality corresponding to the log file, so that the second processor can reduce the probability that the abnormality indicated by the log file occurs again.
The second processing operation is based on the reason indicated by the log file, for example, the second processing operation may be updating a configuration parameter of the first processor, and the exception existing in the first processor is eliminated by the updating of the configuration parameter. The first processor is in an abnormal state, so that the possibility of restoring the first processor to be normal through updating the configuration parameters is low, the corresponding first processing operation and the second processing operation are different, after the first processor is restored to be normal by the first processing operation, the second processing operation is used for eliminating the abnormality existing in the first processor, and the probability that the first processor generates the abnormality indicated by the log file again is reduced.
The monitoring method controls the first processor to execute the first processing operation so as to enable the first processor to recover from the abnormality to the normal state by the first processing operation, obtains the log file from the storage medium of the second processor after the first processor recovers to the normal state, and controls the first processor to execute the second processing operation corresponding to the log file so as to eliminate the abnormality existing in the first processor by the second processing operation, wherein the abnormality existing in the first processor corresponds to the log file, so that the probability that the abnormality indicated by the log file occurs again in the first processor is reduced.
In this embodiment, the log file generation instruction may be a restart instruction, where the restart instruction is used to instruct the first processor to generate a log file before restarting and send the log file to the second processor, and an optional flow of the corresponding monitoring method is shown in fig. 7, and may include the following steps:
201: it is determined that the first processor is in an exception state.
202: and controlling the second processor to send a restart instruction to the first processor in response to the first processor being in the abnormal state.
203: and responding to the restart instruction, generating a log file, wherein the first processor is still in an abnormal state and does not execute the power-off operation when responding to the restart instruction.
204: and responding to the restart instruction, controlling the first processor to send the log file to the second processor, wherein the first processor is still in an abnormal state and does not execute the power-off operation when the log file is sent.
205: and controlling the first processor to execute power-off to restart the first processor, and recovering the first processor from the exception to the normal by using a restart operation.
The difference from the above embodiment is that: in the embodiment, in the process of responding to the restart instruction to restart the first processor, the generation of the log file and the sending of the log file are completed, and the restart instruction is adjusted, where the first processor is continuously in the abnormal state before responding to the restart instruction to control the first processor to power off, so that the first processor can capture the reason of the abnormality, and thus the log file is generated before the first processor is powered off. Since there is a possibility that the log file disappears after the first processor is powered off, the first processor is controlled to transmit the log file to the second processor to store the log file in a storage medium of the second processor, for example, to a nonvolatile memory, before the first processor is powered off.
206: the log file is stored in a storage medium of the second processor.
The monitoring method responds to the abnormal state of the first processor, controls the second processor to send a restart instruction to the first processor, responds to the restart instruction, generates a log file, controlling the first processor to send a log file to the second processor in response to the restart instruction while the first processor is still in an abnormal state and the first processor does not perform a power-off operation in response to the restart instruction, when the log file is sent, the first processor is still in an abnormal state and does not execute the power-off operation, the first processor is controlled to execute the power-off to restart the first processor, the first processor is recovered from the abnormality to the normal state by utilizing the restart operation, the log file is acquired in the process of recovering the first processor to the normal state, the first processor is controlled to recover to normal and obtain the log file, so that two purposes are achieved through one operation.
The points to be explained here are: if the restart instruction is only the restart operation of the first processor, and the log file is not acquired in the restart process of the first processor, the log file needs to be acquired before responding to the restart instruction. In the process of obtaining the log file, if it is monitored that the target component is triggered, it is determined that the first processor is in an abnormal state, and then a log file generation instruction is sent to the first processor in response to the first processor being in the abnormal state, wherein the target component may be a hot key in the electronic device, such as a power key. But the power key is also bound with the restart instruction, and if the log file generation instruction is sent to the first processor by monitoring a hot key such as the power key, a trigger operation aiming at the log file generation instruction is distinguished from a trigger operation aiming at the restart instruction so as to prevent the two from conflicting.
Referring to fig. 8, an alternative flow of another monitoring method provided in the embodiment of the present application is shown, which may include the following steps:
301: the method comprises the steps of obtaining a log file generated by a first processor in the electronic equipment, wherein the log file is generated when the first processor is abnormal, and the log file is used for indicating the reason of the abnormality of the first processor.
In this embodiment, a manner of obtaining the log file generated by the first processor by the second processor may be referred to in the above embodiment, and the second processor may send a log file generation instruction to the first processor in response to the first processor being in an abnormal state, so that the first processor generates the log file in response to the log file generation instruction. The log file generation instruction may be at least one of an interface command, a level signal, and a restart instruction, which is described with reference to the above embodiment.
302: the log file is stored in a second processor in the electronic equipment, the first processor enables the first processor to obtain the log file from the second processor after the first processor is recovered from the abnormality to be normal through a first processing operation, the first processing operation is different from a second processing operation, and the second processing operation can eliminate the abnormality corresponding to the log file.
Please refer to the above embodiment for the storage manner of the log file in the second processor. The first processor switches from the abnormal state to the normal state by executing the first processing operation, for example, one way of the first processing operation is to restart the operation of the first processor, the first processor performs the restart operation to restore the first processor to normal, and after the first processor restores to normal, the first processor sends a log file upload instruction to the second processor. And the second processor responds to the log file uploading instruction to obtain the log file from the storage medium of the second processor, or directly extracts the log file from the storage medium through the connection between the first processor and the second processor after the first processor is recovered to be normal.
The second processing operation is based on the reason indicated by the log file, for example, the second processing operation may be updating a configuration parameter of the first processor, and the exception existing in the first processor is eliminated by the updating of the configuration parameter. The first processor is in an abnormal state, so that the possibility of restoring the first processor to be normal through updating the configuration parameters is low, the corresponding first processing operation and the second processing operation are different, after the first processor is restored to be normal by the first processing operation, the second processing operation is used for eliminating the abnormality existing in the first processor, and the probability that the first processor generates the abnormality indicated by the log file again is reduced.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present application is not limited by the order of acts or acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
An alternative structure of the electronic device is shown in fig. 1, and the electronic device includes a first processor 10 and a second processor 20.
And the second processor 20 is configured to determine that the first processor 10 is in an abnormal state, and send a log file generation instruction to the first processor 10 in response to the first processor 10 being in the abnormal state. Wherein determining that the first processor 10 is in an exception state comprises:
if the target assembly is monitored to be touched, determining that the first processor is in an abnormal state; or obtaining the state parameter of the first processor through the second processor, and determining that the first processor is in an abnormal state through the second processor based on the state parameter.
In response to the first processor 10 being in the abnormal state, the manner of sending the log file generation instruction to the first processor 10 includes: and responding to the abnormal state of the first processor, controlling the second processor to send a level signal to a first pin in the first processor, wherein the level signal is used for indicating the first processor to generate a log file, and the level signal is sent to the first pin through a second pin of the second processor and a connection line between the first pin and the second pin. Or, in response to the first processor being in an abnormal state, controlling the second processor to send an interface command to the first processor, wherein the interface command is used for instructing the first processor to generate a log file, and the interface command is transmitted by using an interface bus between the first processor and the second processor.
The first processor 10 is configured to generate a log file in response to the log file generation instruction, where the log file is generated when the first processor 10 is in an abnormal state, and the log file is used to indicate a reason for the abnormality of the first processor 10.
The second processor 20 is further configured to store the log file in a storage medium of the second processor 20. The storage medium may be a non-volatile memory, which stores the log file in a manner as described in the above embodiments.
In this embodiment, the first processor 10 is further configured to execute a first processing operation to restore the first processor from the exception to normal by using the first processing operation, obtain a log file from a storage medium of the second processor after the first processor is restored to normal, and execute a second processing operation corresponding to the log file to eliminate the exception existing in the first processor by using the second processing operation, where the exception existing in the first processor corresponds to the log file.
Although the first processor is restored to normal by executing the first processing operation, the reason that the first processor has the abnormality indicated by the log file is not eliminated yet, so that the first processor still has a situation that the abnormality indicated by the log file occurs again, and for this problem, the embodiment controls the first processor to execute the second processing operation corresponding to the log file, and the second processing operation can eliminate the abnormality corresponding to the log file, so that the second processor can reduce the probability that the abnormality indicated by the log file occurs again.
The second processing operation is based on the reason indicated by the log file, for example, the second processing operation may be updating a configuration parameter of the first processor, and the exception existing in the first processor is eliminated by the updating of the configuration parameter. The first processor is in an abnormal state, so that the possibility of restoring the first processor to be normal through updating the configuration parameters is low, the corresponding first processing operation and the second processing operation are different, after the first processor is restored to be normal by the first processing operation, the second processing operation is used for eliminating the abnormality existing in the first processor, and the probability that the first processor generates the abnormality indicated by the log file again is reduced.
In this embodiment, the log file generation instruction may be a restart instruction, where the restart instruction is used to instruct the first processor to generate a log file before restarting and send the log file to the second processor; the corresponding second processor 20 responds to the restart instruction to generate a log file, and when responding to the restart instruction, the first processor is still in an abnormal state and does not execute the power-off operation; the first processor 10 is configured to, in response to a restart instruction, control the first processor to send a log file to the second processor, where the first processor is still in an abnormal state and the first processor does not perform a power-off operation when the log file is sent; and performing power-off to restart the first processor, and recovering the first processor from the exception to the normal by using a restart operation.
Referring to fig. 9, an alternative structure of a second processor provided in the embodiment of the present application is shown, where the second processor includes a storage medium 30 and a processing unit 40.
The processing unit 40 is configured to obtain a log file generated by a first processor in the electronic device, and store the log file in a storage medium, where the log file is generated when the first processor is abnormal, and the log file is used to indicate a reason for the abnormality of the first processor, the first processor can obtain the log file from a second processor after the first processor is recovered from the abnormality by a first processing operation, the first processing operation is different from the second processing operation, and the second processing operation can eliminate the abnormality corresponding to the log file.
The embodiment of the application also provides a storage medium, wherein a computer program code is stored in the storage medium, and when the computer program code is executed, the monitoring method is realized.
It should be noted that, various embodiments in this specification may be described in a progressive manner, and features described in various embodiments in this specification may be replaced with or combined with each other, each embodiment focuses on differences from other embodiments, and similar parts between various embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.
Claims (10)
1. A monitoring method is applied to an electronic device, the electronic device comprises a first processor and a second processor, and the method comprises the following steps:
determining that the first processor is in an exception state;
responding to the abnormal state of the first processor, and controlling the second processor to send a log file generation instruction to the first processor;
responding to the log file generation instruction, and generating a log file, wherein the log file is generated when the first processor is in the abnormal state, and the log file is used for indicating the reason of the abnormality of the first processor;
storing the log file in a storage medium of the second processor.
2. The method of claim 1, further comprising:
controlling the first processor to execute a first processing operation to restore the first processor from exception to normal using the first processing operation;
after the first processor is recovered to be normal, obtaining the log file from the storage medium of the second processor;
and controlling the first processor to execute a second processing operation corresponding to the log file so as to eliminate the exception existing in the first processor by using the second processing operation, wherein the exception existing in the first processor corresponds to the log file.
3. The method of claim 1, the log file generation instruction being a restart instruction to instruct the first processor to generate the log file and send the log file to the second processor prior to a restart;
the generating a log file in response to the log file generation instruction comprises: responding to the restarting instruction, generating the log file, and responding to the restarting instruction, wherein the first processor is still in an abnormal state and does not execute power-off operation;
the method further comprises the following steps: responding to the restart instruction, controlling the first processor to send the log file to the second processor, wherein the first processor is still in an abnormal state and does not execute a power-off operation when the log file is sent;
and controlling the first processor to execute power-off to restart the first processor, and restoring the first processor from an exception to a normal state by using a restart operation.
4. The method of claim 1, the determining that the first processor is in an exception state comprising:
determining that the first processor is in an abnormal state if the target assembly is monitored to be touched;
or
Obtaining, by the second processor, a state parameter of the first processor, determining, by the second processor, that the first processor is in an exception state based on the state parameter.
5. The method of claim 1, the controlling the second processor to send log file generation instructions to the first processor in response to the first processor being in an exception state comprising:
and responding to the abnormal state of the first processor, controlling the second processor to send a level signal to a first pin in the first processor, wherein the level signal is used for indicating the first processor to generate a log file, and the level signal is sent to the first pin through a second pin of the second processor and a connecting line between the first pin and the second pin.
6. The method of claim 1, the controlling the second processor to send log file generation instructions to the first processor in response to the first processor being in an exception state comprising:
and responding to the abnormal state of the first processor, controlling the second processor to send an interface command to the first processor, wherein the interface command is used for instructing the first processor to generate a log file, and the interface command is transmitted by using an interface bus between the first processor and the second processor.
7. A method of monitoring, the method comprising:
the method comprises the steps of obtaining a log file generated by a first processor in the electronic equipment, wherein the log file is generated when the first processor is abnormal, and the log file is used for indicating the reason of the abnormality of the first processor;
and storing the log file into a second processor in the electronic equipment, wherein the first processor enables the first processor to obtain the log file from the second processor after the first processor is recovered from the abnormality to be normal through a first processing operation, the first processing operation is different from a second processing operation, and the second processing operation can eliminate the abnormality corresponding to the log file.
8. An electronic device comprising a first processor and a second processor;
the second processor is used for determining that the first processor is in an abnormal state, responding to the abnormal state of the first processor, and sending a log file generation instruction to the first processor;
the first processor is configured to generate a log file in response to the log file generation instruction, where the log file is generated when the first processor is in the abnormal state, and the log file is used to indicate a reason why the first processor is abnormal;
the second processor is further configured to store the log file in a storage medium of the second processor.
9. The electronic device of claim 8, wherein the first processor is further configured to perform a first processing operation to restore the first processor from an exception to normal by using the first processing operation, obtain the log file from the storage medium of the second processor after the first processor is restored to normal, and perform a second processing operation corresponding to the log file to eliminate an exception existing in the first processor by using the second processing operation, where the exception existing in the first processor corresponds to the log file.
10. A second processor, the second processor comprising a storage medium and a processing unit;
the processing unit is used for obtaining a log file generated by a first processor in the electronic equipment, and storing the log file into the storage medium, wherein the log file is generated when the first processor is abnormal, and the log file is used for indicating the reason of the abnormality of the first processor; the first processor enables the first processor to obtain the log file from the second processor after the first processor is recovered from the exception to be normal through a first processing operation, the first processing operation is different from a second processing operation, and the second processing operation can eliminate the exception corresponding to the log file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110309502.2A CN113010387A (en) | 2021-03-23 | 2021-03-23 | Monitoring method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110309502.2A CN113010387A (en) | 2021-03-23 | 2021-03-23 | Monitoring method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113010387A true CN113010387A (en) | 2021-06-22 |
Family
ID=76405565
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110309502.2A Pending CN113010387A (en) | 2021-03-23 | 2021-03-23 | Monitoring method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113010387A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118413583A (en) * | 2024-07-02 | 2024-07-30 | 睿思芯科(深圳)技术有限公司 | IPMI protocol rapid transmission method and related equipment |
WO2024187838A1 (en) * | 2023-03-10 | 2024-09-19 | 华为技术有限公司 | Application performance analysis method and apparatus, computing device, system, and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008310567A (en) * | 2007-06-14 | 2008-12-25 | Nec Corp | Failure diagnostic method and electronic device failure diagnostic system |
CN105302768A (en) * | 2015-10-16 | 2016-02-03 | 浙江宇视科技有限公司 | Slave CPU exception processing method and apparatus |
CN110058999A (en) * | 2019-03-13 | 2019-07-26 | 平安普惠企业管理有限公司 | Electronic device, application exception localization method and storage medium |
CN111274059A (en) * | 2020-01-21 | 2020-06-12 | 浙江大华技术股份有限公司 | Software exception handling method and device for slave equipment |
-
2021
- 2021-03-23 CN CN202110309502.2A patent/CN113010387A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008310567A (en) * | 2007-06-14 | 2008-12-25 | Nec Corp | Failure diagnostic method and electronic device failure diagnostic system |
CN105302768A (en) * | 2015-10-16 | 2016-02-03 | 浙江宇视科技有限公司 | Slave CPU exception processing method and apparatus |
CN110058999A (en) * | 2019-03-13 | 2019-07-26 | 平安普惠企业管理有限公司 | Electronic device, application exception localization method and storage medium |
CN111274059A (en) * | 2020-01-21 | 2020-06-12 | 浙江大华技术股份有限公司 | Software exception handling method and device for slave equipment |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024187838A1 (en) * | 2023-03-10 | 2024-09-19 | 华为技术有限公司 | Application performance analysis method and apparatus, computing device, system, and storage medium |
CN118413583A (en) * | 2024-07-02 | 2024-07-30 | 睿思芯科(深圳)技术有限公司 | IPMI protocol rapid transmission method and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6285511B2 (en) | Method and system for monitoring virtual machine cluster | |
US11023302B2 (en) | Methods and systems for detecting and capturing host system hang events | |
CN102455950A (en) | Firmware recovery system and method of base board management controller | |
CN113010387A (en) | Monitoring method and device | |
CN105512000B (en) | Operating system abnormal information collection method and device and computer | |
CN111581021B (en) | Application program starting abnormality repairing method, device, equipment and storage medium | |
TWI808362B (en) | Computer system and method capable of self-monitoring and restoring an operation of operating system | |
CN114116280A (en) | Interactive BMC self-recovery method, system, terminal and storage medium | |
KR101974989B1 (en) | Method and apparatus for determining behavior information corresponding to a dangerous file | |
CN114138587B (en) | Method, device and equipment for verifying reliability of server power firmware upgrade | |
JP6919597B2 (en) | Computer and its control method | |
KR102194974B1 (en) | System for monitoring and controling electric power system for process verification | |
CN109741786A (en) | A kind of solid state hard disk monitoring method, device and equipment | |
KR20150116020A (en) | Apparatus for computer diagnostics and recovery using wireless network and method thereof | |
CN111367700A (en) | Forced recovery method, system and related components after BMC downtime | |
CN116382961A (en) | Method and device for positioning operating system fault, electronic equipment and storage medium | |
CN115080132A (en) | Information processing method, information processing apparatus, server, and storage medium | |
CN110427280B (en) | Cache management method, system, computer equipment and storage medium | |
CN110275797B (en) | Controller and data storage method | |
CN101866311A (en) | Method for monitoring and recovering by using external computer | |
CN111382009B (en) | Automatic system maintenance method and computer equipment with automatic maintenance function | |
JP2021006970A (en) | Information processing device, anomaly detection method and program | |
CN113641524B (en) | Reset method, device and equipment for single board starting overtime and readable storage medium | |
US20240311226A1 (en) | Stand-alone iot device for repairing failures on a computing device | |
CN113269893B (en) | VR rendering method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |