State change reason determination method and device, CPU, system and medium

By recording and analyzing physical keystrokes or abnormal power-off events in the computer's programmable logic device, the problem of difficulty in determining the cause of computer status changes is solved, achieving rapid troubleshooting and cost reduction.

CN120653468APending Publication Date: 2025-09-16SUGON INFORMATION IND +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410275018.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

If the computer is not connected to an external monitoring device or system, it is impossible to record the operating status and status change events, resulting in inefficient troubleshooting and high hardware costs.

Method used

By storing state change events caused by physical key actions or abnormal power failures in the computer's programmable logic device, the cause of the computer's state change, including normal operations and abnormal operations, is obtained and determined, reducing hardware dependence and improving troubleshooting efficiency.

Benefits of technology

Without external monitoring equipment or systems, the cause of computer abnormalities can be quickly located, reducing hardware costs and improving troubleshooting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653468A_ABST
    Figure CN120653468A_ABST
Patent Text Reader

Abstract

The invention relates to a state change reason determination method and device, a CPU, a system and a medium. The method comprises the steps that when the computer system is converted into a second state from a first state, a first action event stored in a programmable logic device is obtained, the first state comprises at least one of a shutdown state, a sleep state and a dormant state, and the second state comprises at least one of a power-off state, a sleep state and a dormant state; the second state comprises at least one of a power-on state, a restart state, a sleep awakening state and a sleep awakening state; the first action event is an event of computer state change caused by physical key action or abnormal power failure; based on the first action event, determining a reason causing the computer state change; the reasons for changing the state of the computer comprise conventional operation and abnormal operation. The method is not externally connected with monitoring equipment or a system, the running state and the state change event of the computer are recorded, the hardware cost for determining the state change reason is reduced, meanwhile, the computer abnormity reason can be rapidly positioned, and then the fault removal efficiency of the computer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, CPU, system, and medium for determining a cause of a state change. Background Art

[0002] With the rapid development of computer technology and information network technology, computers (desktops, servers, etc.) have provided numerous conveniences for our daily lives and production, and their production and usage have continued to increase. However, various computer anomalies are unavoidable during use, and troubleshooting them requires locating the cause.

[0003] Conventional technology typically requires the use of external monitoring devices or systems to record the computer's operating status and related events of state changes. This allows for locating the cause of any anomalies and troubleshooting. However, without an external monitoring device or system, the computer's operating status and related events of state changes cannot be recorded, making it impossible to locate the cause of the anomaly. Furthermore, the addition of external monitoring devices increases hardware costs, resulting in high hardware costs and inefficient computer troubleshooting. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, device, CPU, system and medium for determining the cause of state change in response to the above technical problems, which can quickly locate the cause of computer abnormality without connecting the computer to an external monitoring device or system, thereby improving the efficiency of computer troubleshooting.

[0005] In a first aspect, the present application provides a method for determining a cause of a computer state change, the method being applied to a central processing unit, the method comprising:

[0006] When the computer system transitions from a first state to a second state, obtaining a first action event stored in a programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event that causes a computer state change due to a physical key action or an abnormal power failure;

[0007] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0008] In an embodiment of the present application, the programmable logic device can store events that cause computer state changes due to physical button actions or abnormal power failures, namely first action events. Therefore, when the computer system is converted from the first state to the second state, the first action event stored in the programmable logic device can be obtained, and based on the first action event, the cause of the computer state change can be determined; the first state includes at least one of the shutdown state, the sleep state and the hibernation state, and the second state includes at least one of the power-on state, the restart state, the sleep-wake-up state and the hibernation-wake-up state. The causes of the computer state change include normal operations and abnormal operations. In this way, when an abnormality occurs in the computer, the cause of the computer abnormality can be directly determined based on the first action event stored in the programmable logic device of the computer itself, rather than in an external device. This achieves the ability to record the computer's operating status and related events of the state change without an external monitoring device or system, reducing the hardware cost of determining the cause of the state change, and at the same time quickly locating the cause of the computer abnormality, thereby improving the efficiency of computer troubleshooting.

[0009] In one embodiment, determining the cause of the computer state change based on the first action event includes:

[0010] If the first action event is not empty, the cause of the computer state change is determined based on the first action event; if the first action event is empty, the second action event stored in the central processing unit is obtained, and the cause of the computer state change is determined based on the second action event; wherein, the second action event is an event in which the computer state change is caused by a system software action.

[0011] In an embodiment of the present application, in the process of determining the cause of the computer status change, priority is given to determining whether the computer status change is caused by a physical key action or an abnormal power outage; after excluding the computer status change caused by a physical key action or an abnormal power outage, further determination is made whether the computer status change is caused by a system software action. This not only allows the cause of the computer status change to be determined more quickly, but also allows the cause of the computer status change to be analyzed more comprehensively, making the process of determining the cause of the computer status change more comprehensive and efficient.

[0012] In one embodiment, if the first action event is not empty, determining the cause of the computer state change based on the first action event includes:

[0013] If the first action event is not empty and the first action event is an event caused by abnormal power failure, it is determined that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; if the first action event is not empty and the first action event is not an event caused by abnormal power failure, it is determined that the cause of the computer state change is a normal operation.

[0014] In an embodiment of the present application, an implementation method is provided for determining whether the cause of a computer status change is an abnormal operation or a normal operation based on a first action event. When a computer fails, the cause of the failure can be quickly located, thereby improving troubleshooting efficiency.

[0015] In one embodiment, determining the cause of the computer state change based on the second action event includes:

[0016] If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0017] In an embodiment of the present application, another implementation method for determining the cause of a computer status change is provided. On the basis of excluding computer status changes caused by physical key actions and abnormal power failures, computer status changes caused by system software are also excluded. It can be considered that the cause of the computer status change is the second abnormal sub-operation in the abnormal operation. The second abnormal sub-operation is used to distinguish from the first abnormal sub-operation. After determining that the cause of the computer status change is the second abnormal sub-operation, when locating the cause of the computer failure, it is possible to avoid repeatedly determining whether it is the first abnormal sub-operation, thereby speeding up the efficiency of troubleshooting.

[0018] In one embodiment, the first action event is an event recorded by the programmable logic device when the computer system transitions from the second state to the first state.

[0019] In an embodiment of the present application, when a user triggers a physical key to cause the computer system to transition from the second state to the first state, or when the computer system transitions from the second state to the first state due to an abnormal power outage, the programmable logic device will record a first action event. The next time the computer transitions from the first state to the second state, the CPU will obtain the first action event recorded in the programmable logic device to determine whether the last time the computer transitioned from the second state to the first state was due to a physical key action or an abnormal power outage. Furthermore, after the CPU has read the recorded first action event, the programmable logic device clears the first action event record so that the first action event can be recorded the next time the computer system transitions from the second state to the first state. This allows the computer's operating status and state change-related events to be recorded without an external monitoring device or system, allowing the cause of the computer anomaly to be quickly located, thereby improving computer troubleshooting efficiency.

[0020] In a second aspect, the present application further provides a device for determining a cause of a computer state change, the device being applied to a central processing unit, the device comprising:

[0021] an acquisition module, configured to acquire a first action event stored in a programmable logic device when a computer system transitions from a first state to a second state, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a computer state change due to a physical key press or an abnormal power failure;

[0022] The determination module is configured to determine a cause of a computer status change based on the first action event; the cause of the computer status change includes a normal operation and an abnormal operation.

[0023] In a third aspect, the present application further provides a CPU, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0024] When the computer system transitions from a first state to a second state, obtaining a first action event stored in a programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event that causes a computer state change due to a physical key action or an abnormal power failure;

[0025] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0026] In a fourth aspect, the present application further provides a system for determining the cause of a computer status change, the system comprising:

[0027] A programmable logic device, a physical button, and a CPU; wherein the CPU is the CPU described in the third aspect, and the CPU is communicatively connected to the programmable logic device;

[0028] The programmable logic device is used to store a first action event caused by a physical key action or abnormal power failure that causes a computer state change.

[0029] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the following steps:

[0030] When the computer system transitions from a first state to a second state, obtaining a first action event stored in a programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event that causes a computer state change due to a physical key action or an abnormal power failure;

[0031] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0032] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0033] When the computer system transitions from a first state to a second state, obtaining a first action event stored in a programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event that causes a computer state change due to a physical key action or an abnormal power failure;

[0034] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0035] In the above-mentioned method, device, CPU, system and medium for determining the cause of a state change, a programmable logic device can store an event, namely a first action event, which is an event caused by a physical key action or an abnormal power failure to change the computer state. Therefore, when the computer system switches from the first state to the second state, the first action event stored in the programmable logic device can be obtained, and based on the first action event, the cause of the computer state change can be determined; the first state includes at least one of the shutdown state, the sleep state and the hibernation state, and the second state includes at least one of the power-on state, the restart state, the sleep-wake-up state and the hibernation-wake-up state. The causes of the computer state change include normal operations and abnormal operations. In this way, when an abnormality occurs in the computer, the cause of the computer abnormality can be directly determined based on the first action event stored in the programmable logic device of the computer itself, rather than in an external device. This achieves the goal of recording the computer's operating state and related events of the state change without an external monitoring device or system, reducing the hardware cost of determining the cause of the state change, and at the same time, quickly locating the cause of the computer abnormality, thereby improving the efficiency of computer troubleshooting. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a diagram of an application environment of a method for determining a cause of a computer state change in one embodiment;

[0037] Figure 2 1 is a flow chart of a method for determining a cause of a computer status change in one embodiment;

[0038] Figure 3 1 is a flow chart of a method for determining a cause of a computer status change in another embodiment;

[0039] Figure 4 A structural block diagram of a device for determining a cause of a computer state change in one embodiment;

[0040] Figure 5 This is a diagram of the internal structure of a CPU in one embodiment;

[0041] Figure 6 A schematic diagram of a system structure for determining the cause of a computer status change in one embodiment. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0043] The method for determining the cause of a computer status change provided in the embodiment of the present application can be applied to the application scenario of computer failure analysis. For example, Figure 1This is an application environment diagram of a method for determining the cause of a computer state change provided in an embodiment of the present application. A programmable logic device (PLD) is communicatively connected to a central processing unit (CPU), for example, via an external interface. External buses include, but are not limited to, communication interfaces such as an Inter-Integrated Circuit (I2C) bus, a Low Pin Count (LPC) bus, a General-Purpose Input / Output Ports (GPIO) bus, a Serial Peripheral Interface (SPI) bus, and a Universal Asynchronous Receiver / Transmitter (UART) bus. For example, after the computer is powered on, the CPU obtains a first action event stored in the PLD via the external interface and, based on the first action event, determines the cause of the computer state change. Computers include, but are not limited to, desktop computers, servers, all-in-one computers, and workstations.

[0044] In one embodiment, Figure 2 As shown, a method for determining the cause of a computer status change is provided, and the method is applied to Figure 1 The CPU in the example is used to illustrate the process, which includes the following steps:

[0045] S201 , when a computer system is converted from a first state to a second state, obtaining a first action event stored in a programmable logic device.

[0046] It is understandable that during the use of the computer, some low-probability problems will inevitably occur, causing the computer to turn on and off abnormally or the screen to go black. Common reasons are as follows:

[0047] First, the computer may start or stop abnormally due to a single defect in the motherboard, memory, graphics card or other hardware components used in the computer.

[0048] Second, compatibility issues between the software installed by the user and the system cause the computer to start and stop abnormally.

[0049] Third, abnormal computer startup and shutdown caused by external environmental anomalies (such as abnormal power outages, overheating, or overcooling). When the computer status changes, the action events that caused the computer status change can be recorded. This allows the CPU to determine the cause of the computer status change based on the recorded action events. This allows the cause of the computer failure to be quickly located, improving troubleshooting efficiency.

[0050] It should be understood that the programmable logic device stores events that cause computer state changes due to physical key actions or abnormal power failures, namely, first action events. The first state includes at least one of the shutdown state, sleep state, and hibernation state, and the second state includes at least one of the startup state, restart state, sleep wake-up state, and hibernation wake-up state; the first action event is an event that causes computer state changes due to physical key actions or abnormal power failures, wherein the physical key can be understood as a button on the computer host, which is used to manually control the computer state change. When the computer system is converted from the first state to the second state, the CPU can obtain the first action event stored in the programmable logic device through the external bus. For example, when the computer is turned on, the CPU obtains the first action event stored in the programmable logic device. The first action event includes but is not limited to key-press power on, key-press shutdown, key-press restart, key-press sleep, key-press sleep wake-up, key-press sleep, key-press sleep wake-up, and abnormal power failure.

[0051] S202: Determine a cause of the computer state change based on the first action event.

[0052] Based on the first action event, the cause of the computer state change can be determined. Causes of computer state change include normal operations and abnormal operations. For example, if the first action event is a key press to shut down the computer, the cause of the computer state change is determined to be a normal operation; if the first action event is an abnormal power failure, the cause of the computer state change is determined to be an abnormal operation.

[0053] In order to help users determine the cause of computer failure more quickly, the reasons for computer status changes, action events and computer status can be displayed in the form of text, tables, charts or pictures to improve readability, so as to determine the cause of computer failure more quickly.

[0054] In the above-mentioned method for determining the cause of a state change, a programmable logic device can store an event in which a physical key action or an abnormal power failure causes a computer state change, namely a first action event. Therefore, when the computer system is converted from the first state to the second state, the first action event stored in the programmable logic device can be obtained, and based on the first action event, the cause of the computer state change can be determined; the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state. The causes of the computer state change include normal operations and abnormal operations. In this way, when an abnormality occurs in the computer, the cause of the computer abnormality can be directly determined based on the first action event stored in the programmable logic device of the computer itself, rather than in an external device. This achieves the goal of recording the computer's operating state and related events of the state change without an external monitoring device or system, reducing the hardware cost of determining the cause of the state change, and at the same time quickly locating the cause of the computer abnormality, thereby improving the efficiency of computer troubleshooting.

[0055] In some optional embodiments, in the process of determining the cause of the computer state change, it can be first determined whether the computer state change is caused by a physical key action. Therefore, the embodiment of the present application provides a specific implementation method for determining the cause of the computer state change based on the first action event. The specific process is as follows:

[0056] If the first action event is not empty, it means that the computer state change was caused by a physical key press or an abnormal power failure. The cause of the computer state change can be determined based on the first action event. For example, if the first action event is not empty and is a key sleep event, the cause of the computer state change is determined to be a normal operation.

[0057] If the first action event is empty, which means that the computer status change is not caused by a physical key action or an abnormal power failure, then the second action event stored in the CPU is obtained, and the cause of the computer status change is determined based on the second action event; wherein the second action event is an event in which the computer status change is caused by a system software action, and the second action event includes but is not limited to system software startup, system software shutdown, system software restart, system software sleep, system software sleep wake-up, system software hibernation, and system software sleep wake-up, wherein the second action event can be an action event triggered directly by the user on the system software side, or an action event triggered by the user on the system software side through a remote network. For example, if the second action event is a system software restart, then the cause of the computer status change is determined to be a routine operation.

[0058] In an embodiment of the present application, in the process of determining the cause of the computer status change, priority is given to determining whether the computer status change is caused by a physical key action or an abnormal power outage; after excluding the computer status change caused by a physical key action or an abnormal power outage, further determination is made whether the computer status change is caused by a system software action. This not only allows the cause of the computer status change to be determined more quickly, but also allows the cause of the computer status change to be analyzed more comprehensively, making the process of determining the cause of the computer status change more comprehensive and efficient.

[0059] Furthermore, based on the above embodiment, in the process of determining whether the computer state change is caused by a physical key action or an abnormal power failure, the cause of the computer state change may be a normal operation or an abnormal operation. The embodiment of the present application provides another specific implementation method for determining whether the cause of the computer state change is a normal operation or an abnormal operation based on the first action event. The specific process is as follows:

[0060] If the first action event is not empty and the first action event is an event caused by abnormal power failure, the cause of the computer state change is determined to be the first abnormal sub-operation in the abnormal operation. It can be understood that the first abnormal sub-operation corresponds to the event cause of the computer state change caused by abnormal power failure.

[0061] If the first action event is not empty and the first action event is not caused by an abnormal power failure, then it is determined that the cause of the computer state change is a normal operation. It can be understood that if the first action event is not empty and is not caused by an abnormal power failure, then the computer state change is caused by a normal physical key action, that is, a normal operation.

[0062] In an embodiment of the present application, an implementation method is provided for determining whether the cause of a computer status change is an abnormal operation or a normal operation based on a first action event. When a computer fails, the cause of the failure can be quickly located, thereby improving troubleshooting efficiency.

[0063] Furthermore, the embodiment of the present application provides an implementation method for determining the cause of the computer state change based on the second action event. The specific implementation process is as follows:

[0064] If the second action event is empty, the cause of the computer state change is determined to be the second abnormal sub-operation in the abnormal operation. It is understandable that in the embodiment of the present application, when determining the cause of the computer state change, it is first determined whether the state change is caused by a physical key action or an abnormal power failure. On the basis of excluding the state change caused by a physical key action or an abnormal power failure, if the second action event is also empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0065] In an embodiment of the present application, another implementation method for determining the cause of a computer status change is provided. On the basis of excluding computer status changes caused by physical key actions and abnormal power failures, computer status changes caused by system software are also excluded. It can be considered that the cause of the computer status change is the second abnormal sub-operation in the abnormal operation. The second abnormal sub-operation is used to distinguish from the first abnormal sub-operation. After determining that the cause of the computer status change is the second abnormal sub-operation, when locating the cause of the computer failure, it is possible to avoid repeatedly determining whether it is the first abnormal sub-operation, thereby speeding up the efficiency of troubleshooting.

[0066] In some optional implementations, an embodiment of the present application provides an implementation method for a programmable logic device to record a first action event. The specific implementation process is as follows:

[0067] It is understood that the first action event is an event recorded by the programmable logic device when the computer system transitions from the second state to the first state. For example, if the computer system transitions from the on state to the off state due to a user triggering the shutdown button, the programmable logic device will record this event, i.e., the first action event. Alternatively, if the computer system experiences an abnormal power outage, for example, if the computer transitions from the on state to the off state, the programmable logic device will record this event, i.e., the first action event.

[0068] It should be noted that the programmable logic device is connected to physical buttons and is used to monitor the triggering actions of the physical buttons, including the power button, the restart button, and the computer power button. When a user triggers a physical button, causing the computer system to transition from the second state to the first state, the programmable logic device will record this event, namely, the first action event. However, if the computer system transitions from the second state to the first state due to a system software action, the programmable logic device will not record this event.

[0069] For example, the programmable logic device can comprehensively determine whether the computer is currently in the power-on state, power-off state, restart state, sleep state or hibernation state based on the current working state of the CPU and the working state of the external power supply, and record the relevant first action event and save it in the internal register in combination with the action event that triggers the physical key or the abnormal power-off event.

[0070] Specifically, the following introduces the basis for judging whether a computer is in different states. For example, the power-on state refers to the state in which the computer is working normally. In the power-on state, the computer can run various applications normally and perform various operations. All functions of the computer in the power-on state are normal, and users can perform various operations at any time. The power-off state refers to the state in which all functions of the computer are unavailable. In this state, the power consumption of the device is very small, which can greatly extend the use time of the computer. The sleep state refers to the state that the computer enters when not in use. In the sleep state, the screen of the device will be turned off, but the computer is still in a low-power working state and can be awakened at any time. The power consumption of the computer in the sleep state is low, which can save power and extend the use time of the device. The hibernation state refers to the state that the computer enters when it is not used for a long time. In this state, the device will close all applications and processes, save all data on the hard disk, and can be restored to the state before entering hibernation after being awakened.

[0071] In an embodiment of the present application, when a user triggers a physical button to cause the computer system to transition from the second state to the first state, or when the computer system transitions from the second state to the first state due to an abnormal power outage, the programmable logic device will record a first action event. The next time the computer transitions from the first state to the second state, the CPU will obtain the first action event recorded in the programmable logic device to determine whether the last time the computer transitioned from the second state to the first state was due to a physical button action or an abnormal power outage. After the CPU has read the recorded first action event, the programmable logic device will clear the first action event record so that the first action event can be recorded the next time the computer system transitions from the second state to the first state. This allows the computer's operating status and state change-related events to be recorded without an external monitoring device or system, allowing the cause of the computer anomaly to be quickly located, thereby improving computer troubleshooting efficiency.

[0072] In some optional embodiments, see Figure 3 , Figure 3 A flowchart of another method for determining the cause of a computer status change is provided. This method uses the example of a computer status change from a shutdown state to a power-on state. The method specifically includes the following steps:

[0073] S301 , when the computer system switches from a shutdown state to a startup state, obtaining a first action event stored in a programmable logic device.

[0074] S302, determine whether the first action event is empty, if not, execute S303, if so, execute S306.

[0075] S303, determining whether the first action event is caused by abnormal power failure, if so, executing S304, if not, executing S305.

[0076] S304: Determine that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation.

[0077] S305: Determine that the cause of the computer status change is a normal operation.

[0078] S306, obtaining the second action event stored in the central processing unit, and determining whether the second action event stored in the central processing unit is empty, if not, executing S307, and if so, executing S308.

[0079] S307: Determine the cause of the computer state change based on the second action event.

[0080] S308: Determine that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0081] S309: Convert the cause of the computer status change into a file in a preset format for display.

[0082] The specific processes of S301 to S309 can be found in the description of the above method embodiment. The implementation principles and technical effects are similar and will not be repeated here.

[0083] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0084] Based on the same inventive concept, embodiments of the present application also provide a computer state change cause determination device for implementing the aforementioned computer state change cause determination method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the computer state change cause determination device provided below can be found in the aforementioned limitations of the computer state change cause determination method and will not be further elaborated here.

[0085] In one embodiment, Figure 4 As shown, a device for determining the cause of a computer state change is provided, which is applied to a central processing unit and includes:

[0086] An acquisition module 10 is configured to acquire a first action event stored in a programmable logic device when the computer system transitions from a first state to a second state, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a computer state change due to a physical key press or an abnormal power failure.

[0087] The determination module 20 is configured to determine a cause of a computer status change based on the first action event; the cause of a computer status change includes a normal operation and an abnormal operation.

[0088] In the above-mentioned state change cause determination device, the programmable logic device can store events that cause computer state changes due to physical button actions or abnormal power failures, namely first action events. Therefore, when the computer system is converted from the first state to the second state, the first action event stored in the programmable logic device can be obtained, and based on the first action event, the cause of the computer state change can be determined; the first state includes at least one of the shutdown state, the sleep state and the hibernation state, and the second state includes at least one of the power-on state, the restart state, the sleep-wake-up state and the hibernation-wake-up state. The causes of the computer state change include normal operations and abnormal operations. In this way, when an abnormality occurs in the computer, the cause of the computer abnormality can be directly determined based on the first action event stored in the programmable logic device of the computer itself, rather than in an external device. This achieves the ability to record the computer's operating state and related events of state changes without an external monitoring device or system, reducing the hardware cost of determining the cause of the state change, and at the same time quickly locating the cause of the computer abnormality, thereby improving the efficiency of computer troubleshooting.

[0089] In an optional embodiment, the determining module 20 specifically includes:

[0090] a first determining unit, configured to determine a cause of the computer state change based on the first action event if the first action event is not empty;

[0091] The second determination unit is used to obtain the second action event stored in the central processing unit if the first action event is empty, and determine the cause of the computer state change based on the second action event; wherein the second action event is an event in which the computer state change is caused by a system software action.

[0092] In an optional embodiment, the first determining unit is specifically configured to:

[0093] If the first action event is not empty and the first action event is an event caused by abnormal power failure, then it is determined that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; if the first action event is not empty and the first action event is not an event caused by abnormal power failure, then it is determined that the cause of the computer state change is a normal operation.

[0094] In an optional embodiment, the second determining unit is specifically configured to:

[0095] If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0096] In an optional embodiment, the first action event is an event recorded by the programmable logic device when the computer system switches from the second state to the first state.

[0097] Each module in the above-mentioned state change cause determination device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the CPU in hardware form, or can be stored in the memory of the CPU in software form, so that the processor can call and execute the corresponding operations of each module.

[0098] In one embodiment, a CPU is provided, whose internal structure diagram can be as follows: Figure 5 As shown. The CPU includes a processor, a memory and a network interface connected via a system bus. The processor of the CPU is used to provide computing and control capabilities. The memory of the CPU includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the CPU is used to store data such as computer status data, second action events, and reasons for computer status changes. The network interface of the CPU is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements any one of the state change cause determination methods provided in the embodiments of the present application.

[0099] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the CPU to which the solution of the present application is applied. The specific CPU may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0100] In one embodiment, a CPU is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0101] When the computer system transitions from a first state to a second state, obtaining a first action event stored in the programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a change in the computer state due to a physical key action or an abnormal power failure;

[0102] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0103] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0104] If the first action event is not empty, the cause of the computer state change is determined based on the first action event; if the first action event is empty, the second action event stored in the central processing unit is obtained, and the cause of the computer state change is determined based on the second action event; wherein the second action event is an event in which the computer state change is caused by a system software action.

[0105] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0106] If the first action event is not empty and the first action event is an event caused by abnormal power failure, then it is determined that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; if the first action event is not empty and the first action event is not an event caused by abnormal power failure, then it is determined that the cause of the computer state change is a normal operation.

[0107] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0108] If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0109] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0110] The first action event is an event recorded by the programmable logic device when the computer system switches from the second state to the first state.

[0111] The present application also provides a computer status change cause determination system, see Figure 6 , the system comprises:

[0112] Programmable logic devices, physical buttons and Figure 5 The CPU shown; wherein the CPU is communicatively connected to a programmable logic device; wherein the programmable logic device is used to store a first action event causing a computer state change caused by a physical key action or an abnormal power failure; wherein the physical keys include a power on / off button, a restart button, and a computer power button.

[0113] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0114] When the computer system transitions from a first state to a second state, obtaining a first action event stored in the programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a change in the computer state due to a physical key action or an abnormal power failure;

[0115] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0116] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0117] If the first action event is not empty, the cause of the computer state change is determined based on the first action event; if the first action event is empty, the second action event stored in the central processing unit is obtained, and the cause of the computer state change is determined based on the second action event; wherein the second action event is an event in which the computer state change is caused by a system software action.

[0118] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0119] If the first action event is not empty and the first action event is an event caused by abnormal power failure, then it is determined that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; if the first action event is not empty and the first action event is not an event caused by abnormal power failure, then it is determined that the cause of the computer state change is a normal operation.

[0120] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0121] If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0122] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0123] The first action event is an event recorded by the programmable logic device when the computer system switches from the second state to the first state.

[0124] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0125] When the computer system transitions from a first state to a second state, obtaining a first action event stored in the programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a change in the computer state due to a physical key action or an abnormal power failure;

[0126] Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

[0127] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0128] If the first action event is not empty, the cause of the computer state change is determined based on the first action event; if the first action event is empty, the second action event stored in the central processing unit is obtained, and the cause of the computer state change is determined based on the second action event; wherein the second action event is an event in which the computer state change is caused by a system software action.

[0129] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0130] If the first action event is not empty and the first action event is an event caused by abnormal power failure, then it is determined that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; if the first action event is not empty and the first action event is not an event caused by abnormal power failure, then it is determined that the cause of the computer state change is a normal operation.

[0131] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0132] If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

[0133] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0134] The first action event is an event recorded by the programmable logic device when the computer system switches from the second state to the first state.

[0135] It should be noted that the data involved in this application (including but not limited to computer status data, action event data and status change reason data, etc.) are all authorized by the user or fully authorized by all parties.

[0136] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0137] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0138] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for determining the cause of a computer status change, characterized in that: The method is applied to a central processing unit (CPU), and comprises: When the computer system transitions from a first state to a second state, obtaining a first action event stored in a programmable logic device, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event that causes a computer state change due to a physical key action or an abnormal power failure; Based on the first action event, a reason causing the computer state change is determined; the reason causing the computer state change includes a normal operation and an abnormal operation.

2. The method according to claim 1, characterized in that The determining, based on the first action event, a cause of the computer state change includes: If the first action event is not empty, determining a cause of the computer state change based on the first action event; If the first action event is empty, the second action event stored in the central processing unit is obtained, and the cause of the computer state change is determined based on the second action event; wherein the second action event is an event in which the computer state change is caused by a system software action.

3. The method according to claim 2, characterized in that If the first action event is not empty, determining a cause of the computer state change based on the first action event includes: If the first action event is not empty, and the first action event is an event caused by abnormal power failure, determining that the cause of the computer state change is the first abnormal sub-operation in the abnormal operation; If the first action event is not empty, and the first action event is not an event caused by abnormal power failure, it is determined that the cause of the computer state change is a normal operation.

4. The method according to claim 2, characterized in that Determining the cause of the computer state change based on the second action event includes: If the second action event is empty, it is determined that the cause of the computer state change is the second abnormal sub-operation in the abnormal operation.

5. The method according to claim 1, wherein The first action event is an event recorded by the programmable logic device when the computer system transitions from the second state to the first state.

6. A device for determining the cause of a computer status change, characterized in that: The device is applied to a central processing unit (CPU), and comprises: an acquisition module, configured to acquire a first action event stored in a programmable logic device when a computer system transitions from a first state to a second state, wherein the first state includes at least one of a shutdown state, a sleep state, and a hibernation state, and the second state includes at least one of a power-on state, a restart state, a sleep-wake-up state, and a hibernation-wake-up state; and the first action event is an event causing a computer state change due to a physical key press or an abnormal power failure; The determination module is used to determine the cause of the computer state change based on the first action event; the cause of the computer state change includes a normal operation and an abnormal operation.

7. A CPU comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A system for determining the cause of a computer status change, characterized in that: The system comprises: A programmable logic device, a physical button, and a CPU; wherein the CPU is the CPU according to claim 7, and the CPU is communicatively connected to the programmable logic device; The programmable logic device is used to store a first action event caused by a physical key action or abnormal power failure that causes a computer state change.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.