A method for determining server shutdown type, server and storage medium
By using complex programmable logic devices and the shutdown register of the CPU in the server, the server shutdown type can be quickly determined, which solves the problem of difficult troubleshooting in the existing technology and improves efficiency.
Patent Information
- Application Number
- CN202110468876.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-04-28
AI Technical Summary
In the prior art, it is difficult to troubleshoot the cause of server shutdown failure, resulting in a waste of time.
By using complex programmable logic devices and CPUs in the server, the shutdown register is used to store target data, and the shutdown type is quickly determined based on the data information of the CPU.
Quickly and accurately determine the server shutdown type, reducing troubleshooting time.
Smart Images

Figure CN113254304B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of servers, and in particular, relates to a method for determining a shutdown type of a server, a server, and a storage medium. Background Art
[0002] Servers run faster, carry higher loads, and are more expensive than ordinary computers. They provide computing or application services to other clients (e.g., PCs, smartphones, ATMs, and even large devices such as train systems) in the network.
[0003] When the server is running, it often needs to run uninterruptedly for a long time. If a shutdown failure occurs during the operation of the server, it will affect the user's use. At present, when the server shuts down, it often needs a lot of troubleshooting to find out the reason for the shutdown, which wastes time. Summary of the invention
[0004] The embodiments of the present application provide a method for determining a server shutdown type, a server, and a storage medium, which can solve the current problem of difficulty in troubleshooting the cause of a server shutdown failure.
[0005] In a first aspect, an embodiment of the present application provides a method for determining a shutdown type of a server, which is applied to a server, wherein the server includes a complex programmable logic device and a CPU, and the complex programmable logic device includes a shutdown register;
[0006] The determination methods include:
[0007] The complex programmable logic device obtains data information of the CPU;
[0008] When the data information meets a preset data update condition, the complex programmable logic device stores target data in a target area in the shutdown register based on the data information, wherein the target data represents a shutdown type of the CPU.
[0009] In a second aspect, an embodiment of the present application provides a server, comprising a complex programmable logic device, a CPU and a memory, and a computer program stored in the memory and executable on the complex programmable logic device, wherein the complex programmable logic device comprises a shutdown register, and when the complex programmable logic device executes the computer program, the method for determining the server shutdown type described in any one of the first aspects above is implemented.
[0010] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the method for determining a server shutdown type described in any one of the first aspects above is implemented.
[0011] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device executes the method for determining a server shutdown type described in any one of the first aspects above.
[0012] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the complex programmable logic device of the present application first obtains data information of the CPU. When the data information meets the preset data update condition, the complex programmable logic device stores target data in the target area of the shutdown register based on the data information, and the shutdown type of the CPU can be characterized by the target data; the present application changes the data in the target area of the shutdown register according to the obtained data information, and the shutdown type of the CPU can be quickly obtained according to the target data. Compared with the current method of obtaining the CPU shutdown type through a large number of checks, the present application can quickly and accurately obtain the shutdown type of the CPU. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0014] Figure 1 This is a schematic diagram of an application scenario of a method for determining a server shutdown type provided in an embodiment of the present application;
[0015] Figure 2 It is a flowchart of a method for determining a server shutdown type provided in an embodiment of the present application;
[0016] Figure 3 is a flow chart of a method for determining a server shutdown type provided by another embodiment of the present application;
[0017] Figure 4 It is a structural diagram of a complex editable logic device provided by an embodiment of the present application;
[0018] Figure 5 It is a schematic diagram of the structure of a server provided in one embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0020] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0021] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0022] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0023] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0025] Figure 1The present invention provides an application scenario diagram of the method for determining the shutdown type of a server provided in an embodiment of the present invention. The method for determining the shutdown type of a server can be used to obtain the shutdown type of a CPU. The server includes a complex programmable logic device 20, a CPU 10, and a baseboard management controller 30, and the complex programmable logic device 20 includes a shutdown register. Among them, the CPU 10 can send a first update instruction to the complex programmable logic device 20 (Complex Programming logic device-CPLD) before executing the shutdown of its own program. After receiving the first update instruction, the complex programmable logic device 20 stores the first data in the target area of the shutdown register, and the first data indicates that the shutdown type of the CPU 10 is the shutdown of the CPU 10 running the program normally. The complex programmable logic device 20 detects the power supply voltage of the CPU 10. When the power supply voltage is less than a preset threshold, the second data is stored in the target area of the shutdown register. The second data indicates that the shutdown type of the CPU 10 is abnormal power shutdown. The complex programmable logic device 20 detects the key state of the CPU 10. When the key state is the shutdown state, the third data is stored in the target area of the shutdown register. The third data indicates that the shutdown type of the CPU is key shutdown. Before sending the second shutdown instruction to the CPU 10, the baseboard management controller 30 sends a second update instruction to the complex programmable logic device 20. After receiving the second update instruction, the complex programmable logic device 20 stores fourth data in the target area of the shutdown register. The fourth data indicates that the shutdown type of the CPU is that the baseboard management controller controls the CPU to shut down.
[0026] The following combination Figure 1 A method for determining a server shutdown type in an embodiment of the present application is described in detail.
[0027] Figure 2 A schematic flow chart of a method for determining a server shutdown type provided by the present application is shown, referring to Figure 2 , the method is described in detail as follows:
[0028] S101, the complex programmable logic device obtains data information of the CPU.
[0029] In this embodiment, the complex programmable logic device and the CPU are both devices set in the server. The CPLD and the CPU communicate through a computer bus (Low pin count Bus-LPC bus). The CPLD is provided with a shutdown register.
[0030] In this embodiment, the data information of the CPU may include at least one of the power supply voltage of the CPU, the key status of the CPU, and the data sent by the CPU to the complex programmable logic device.
[0031] In this embodiment, the data information may be obtained by the CPLD receiving data sent from the CPU, or may be obtained by the CPLD actively detecting data from the CPU.
[0032] S102, when the data information meets the preset data update condition, the complex programmable logic device stores target data in the target area of the shutdown register based on the data information, wherein the target data represents the shutdown type of the CPU.
[0033] In this embodiment, the data update condition can be set according to the CPU shutdown condition, that is, under what circumstances will the CPU be shut down, and this situation is set as one of the data update conditions.
[0034] In this embodiment, the data corresponding to the bytes in the shutdown register can be defined in advance, and different data in the shutdown register corresponds to different shutdown types. After the bytes in the shutdown register are defined, different data information can be associated with the corresponding data, so that when the data information meets the data update condition, the initial data in the shutdown register is updated to the corresponding data, which is recorded as target data in this application.
[0035] For example, when the 7th byte in the shutdown register is 1, the shutdown type of the CPU is defined as shutdown of the CPU normal running program. When the 4th byte in the shutdown register is 1, the shutdown type of the CPU is defined as shutdown due to abnormal power supply of the CPU. When the 5th byte in the shutdown register is 1, the shutdown type of the CPU is defined as shutdown by key.
[0036] Specifically, each time the server is powered on, the shutdown register needs to be cleared, that is, all bytes in the shutdown register are restored to the initial data, for example, all are 0. After the complex programmable logic device obtains the data information, it needs to determine whether the data information meets the data update conditions, that is, it needs to determine whether the CPU is about to shut down. If the data information meets the data update conditions, it is determined that the CPU is about to shut down. If the CPU is about to shut down, the data in the shutdown register needs to be updated so that the data stored in the shutdown register is the data for this CPU shutdown and corresponds to the data information, that is, the data corresponding to the shutdown type. Finally, the shutdown type of the CPU can be determined through the data in the shutdown register.
[0037] In this embodiment, the target area can be set as needed. The data corresponding to each specific data information can be set as needed.
[0038] In an embodiment of the present application, a complex programmable logic device first obtains data information of a CPU. When the data information satisfies a preset data update condition, the complex programmable logic device stores target data in a target area of a shutdown register based on the data information. The shutdown type of the CPU can be characterized by the target data. The present application changes the data in the target area of the shutdown register according to the acquired data information. The shutdown type of the CPU can be quickly obtained according to the target data. Compared with the current method of obtaining the shutdown type of the CPU through a large number of checks, the present application can quickly and accurately obtain the shutdown type of the CPU.
[0039] In a possible implementation, the implementation process of step S101 may include:
[0040] Before executing the first shutdown instruction, the CPU sends a first update instruction to the complex programmable logic device. The complex programmable logic device receives the first update instruction, and the data information includes the first update instruction.
[0041] In this embodiment, one of the conditions for shutting down the CPU is the shutdown of the CPU's normal operating program. In order to record the shutdown of the CPU's normal operating condition, the program stored in the CPU is in the normal operating process, before running to the shutdown program, which is recorded as the first shutdown instruction in this application, and the CPU can first send an update instruction to the CPLD, which is recorded as the first update instruction in this application. The first update instruction is used to instruct the CPLD to update the initial data in the shutdown register.
[0042] The first update instruction may include data that the CPLD needs to store, which is referred to as first data in this application.
[0043] In a possible implementation, the implementation process of step S101 may include:
[0044] The complex programmable logic device detects the power supply voltage of the CPU, and the data information includes the power supply voltage.
[0045] In this embodiment, one situation in which the CPU is shut down is that the power supply voltage is abnormal, for example, the AC power supply is powered off. In order to record the situation in which the CPU is shut down due to the abnormal power supply voltage of the CPU, the CPLD needs to detect the power supply voltage of the CPU in real time to obtain the power supply voltage of the CPU, for example, the voltage of the AC / DC power supply.
[0046] In a possible implementation, the implementation process of step S101 may include:
[0047] The complex programmable logic device detects the key status of the control key of the CPU, and the data information includes the key status.
[0048] In this embodiment, since one situation of CPU shutdown is that the user controls the CPU to shut down through the shutdown button of the CPU, in order to record the situation of CPU shutdown caused by the control button that triggers the control of CPU shutdown, the CPLD needs to detect the key state of the CPU control button in real time.
[0049] In a possible implementation, after step S101, the following may also be included:
[0050] Determine whether the data information meets the preset data update conditions.
[0051] Specifically, when the data information includes the first update instruction, the data update condition includes receiving the first update instruction. Therefore, after the CPLD receives the first update instruction sent by the CPU, it determines that the data information meets the data update condition.
[0052] Specifically, when the data information includes the power supply voltage, the data update condition includes that the power supply voltage is less than a preset threshold value. When the power supply voltage detected by the CPLD is less than the preset threshold value, it is determined that the data information meets the data update condition.
[0053] Specifically, when the data information includes the key state, the data update condition includes that the key state is the power-off state. When the key state detected by the CPLD is the power-off state, it is determined that the data information meets the data update condition.
[0054] In a possible implementation manner, when the data information includes the first update instruction and the CPLD receives the first update instruction, the implementation process of step S102 may include:
[0055] The complex programmable logic device stores first data in a target area of the shutdown register, the target data includes first data, and the first data indicates that the shutdown type of the CPU is the shutdown of the CPU running the program normally.
[0056] In this embodiment, the first update instruction may include first data, and the first data is data that needs to be stored in the shutdown register.
[0057] If the CPLD receives the first update instruction, the CPLD can parse the first update instruction to obtain the first data, and store the first data in the target area. The first data can be obtained by reading the data in the shutdown register. Since the shutdown type corresponding to the first data is the shutdown of the CPU normal running program, it can be determined that the CPU shutdown this time is the shutdown of the CPU normal running program.
[0058] For example, if the first data in the first update instruction is 0001, the CPLD may store 0001 after receiving the first update instruction.
[0059] In a possible implementation, when the data information includes the power supply voltage, and the power supply voltage detected by the CPLD is less than a preset threshold, the implementation process of step S102 may include:
[0060] The complex programmable logic device stores second data in a target area in the shutdown register, the target data includes the second data, and the second data indicates that the shutdown type of the CPU is abnormal power supply shutdown.
[0061] In this embodiment, if the power supply voltage detected by the CPLD is less than the preset threshold, the CPLD writes the shutdown register and writes the second data into the shutdown register. The second data is the data corresponding to when the power supply voltage is less than the preset threshold.
[0062] In this embodiment, the preset threshold value can be set as needed, for example, 12V, 11V, 10V, etc.
[0063] For example, if the power supply voltage detected by the CPLD is 5V, the preset threshold of the power supply voltage is 12V, and the second data is 00001. If the detected power supply voltage is less than the preset threshold, the CPLD directly writes 00001 into the shutdown register.
[0064] In a possible implementation, when the data information includes the key state, and the key state detected by the CPLD is a shutdown state, the implementation process of step S102 may include:
[0065] The complex programmable logic device stores third data in a target area in the shutdown register, the target data includes the third data, and the third data indicates that the shutdown type of the CPU is key shutdown.
[0066] In this embodiment, when the CPU is operating normally, the key state of the control key is the power-on state. If the CPLD detects that the key state of the control key is the power-off state, the CPLD writes the power-off register and writes the third data into the power-off register. The third data is the data corresponding to the power-off state.
[0067] For example, if the third data is 000001, and the CPLD detects that the key state of the control key is the shutdown state, the CPLD writes 000001 into the shutdown register.
[0068] It should be noted that the first data, the second data and the third data are different data.
[0069] In a possible implementation, the server includes a baseboard management controller, and the BMC can control the CPU to shut down, that is, the BMC can send a shutdown instruction to the CPU to control the CPU to shut down, which is recorded as the second shutdown instruction in this application. Therefore, it is also necessary to record the CPU shutdown controlled by the BMC.
[0070] like Figure 3 Specifically, the above method may further include:
[0071] S201: Before sending a second shutdown instruction to the CPU, the baseboard management controller sends a second update instruction to the complex programmable logic device.
[0072] In this embodiment, the BMC, CPU and CPLD communicate via the LPC bus.
[0073] In this embodiment, the second shutdown instruction is used to instruct the CPU to shut down.
[0074] S202: After the complex programmable logic device receives the second update instruction, the complex programmable logic device stores fourth data in a target area of the shutdown register, wherein the fourth data indicates that the shutdown type of the CPU is that the baseboard management controller controls the CPU to shut down.
[0075] In this embodiment, the second update instruction may include fourth data. The fourth data may be set as required. The first data, the second data, the third data and the fourth data are different data.
[0076] In this embodiment, after receiving the second update instruction, the CPLD stores the fourth data in the target area of the shutdown register.
[0077] In a possible implementation, since the shutdown register only stores data temporarily, that is, the shutdown register can only store the data corresponding to the current shutdown of the CPU, and cannot store it for a long time, in order to save the data corresponding to the shutdown of the CPU at various times, the BMC needs to read the data in the shutdown register and save the data in the shutdown register at various times in the BMC. The BMC can read the data in the shutdown register at a preset time interval or in real time, and store the data in the shutdown register in the form of a log in the BMC.
[0078] Specifically, after step S102, the method may further include:
[0079] The baseboard management controller acquires target data in the complex programmable logic device; the baseboard management controller stores the target data.
[0080] In this embodiment, the BMC may read the target data from the shutdown register of the CPLD, and store the target data in the form of a log.
[0081] For example, if you need to find the shutdown type of the CPU on March 10, you can read the BMC log. After searching, you will find that the data stored in the BMC log on March 10 is 0001, and the shutdown type corresponding to 0001 is the shutdown of the CPU running the normal program.
[0082] In an embodiment of the present application, the target data in the shutdown register is stored through the BMC, and the BMC log can be directly read when the CPU shutdown type at a certain time is subsequently queried. The target data in the shutdown register at that time can be obtained from the BMC log, and then the shutdown type corresponding to the target data can be obtained.
[0083] Specifically, after step S202, the above method may further include:
[0084] The baseboard management controller obtains fourth data in the complex programmable logic device; the baseboard management controller stores the fourth data.
[0085] In a possible implementation, the shutdown type of the CPU can also be shutdown due to abnormal CPU operation. If the shutdown of the CPU is caused by abnormal CPU operation, the data in the shutdown register is still the initial data. The data in the shutdown register at the moment when the shutdown is caused by abnormal CPU operation read by the BMC is the initial data. When the shutdown type of the CPU at that moment is queried later, if the log stored in the BMC is the initial data, it can be determined that the shutdown type of the CPU at that moment is shutdown due to abnormal CPU operation.
[0086] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0087] Corresponding to the method for determining the server shutdown type described in the above embodiment, Figure 4 A structural block diagram of a server provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0088] Reference Figure 4 The server may include: a complex programmable logic device 300 and a CPU, and the complex programmable logic device 300 includes a shutdown register.
[0089] The complex programmable logic device 300 may include:
[0090] A data acquisition module 310, used for the complex programmable logic device to acquire data information of the CPU;
[0091] The data update module 320 is used for storing target data in a target area of the shutdown register based on the data information when the data information meets a preset data update condition, wherein the target data represents the shutdown type of the CPU.
[0092] In a possible implementation, the data acquisition module 310 may be used to:
[0093] Before the CPU executes the first shutdown instruction, the CPU sends a first update instruction to the complex programmable logic device;
[0094] The complex programmable logic device receives the first update instruction, and the data information includes the first update instruction;
[0095] and / or,
[0096] The complex programmable logic device detects the power supply voltage of the CPU, and the data information includes the power supply voltage;
[0097] and / or,
[0098] The complex programmable logic device detects the key status of the control key of the CPU, and the data information includes the key status.
[0099] In a possible implementation, when the data information includes the first update instruction, the data update condition includes: upon receiving the first update instruction, the data update module 320 may be specifically configured to:
[0100] The complex programmable logic device stores first data in a target area of the shutdown register, the target data includes the first data, and the first data indicates that the shutdown type of the CPU is a shutdown in which the CPU runs a normal program.
[0101] In a possible implementation, when the data information includes the power supply voltage, the data update condition includes: the power supply voltage is less than a preset threshold, and the data update module 320 may be specifically configured to:
[0102] The complex programmable logic device stores second data in a target area of the shutdown register, the target data includes the second data, and the second data indicates that the shutdown type of the CPU is abnormal power supply shutdown.
[0103] In a possible implementation, when the data information includes the button state, the data update condition includes: the button state is a power-off state, and the data update module 320 can be specifically used to:
[0104] The complex programmable logic device stores third data in a target area of the shutdown register, the target data includes the third data, and the third data indicates that the shutdown type of the CPU is key shutdown.
[0105] In a possible implementation, the server includes a baseboard management controller, and the baseboard management controller can be specifically used for:
[0106] Before the baseboard management controller sends the second shutdown instruction to the CPU, the baseboard management controller sends a second update instruction to the complex programmable logic device;
[0107] After the complex programmable logic device receives the second update instruction, the complex programmable logic device stores fourth data in the target area of the shutdown register, wherein the fourth data represents that the shutdown type of the CPU is that the baseboard management controller controls the CPU to shut down.
[0108] In a possible implementation, the baseboard management controller may be specifically used for:
[0109] The baseboard management controller obtains the target data in the complex programmable logic device;
[0110] The baseboard management controller stores the target data.
[0111] In a possible implementation, the baseboard management controller may be specifically used for:
[0112] The baseboard management controller obtains the fourth data in the complex programmable logic device;
[0113] The baseboard management controller stores the fourth data.
[0114] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0115] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0116] The present application also provides a server. Figure 5 The server 400 may include: a complex programmable logic device 410, a memory 420 and a CPU 430, and a computer program stored in the memory 420 and executable on the complex programmable logic device 410. When the complex programmable logic device 410 executes the computer program, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 2 Steps S101 to S102 in the illustrated embodiment. Alternatively, when the complex programmable logic device 410 executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, for example Figure 4 The functions of modules 310 to 320 are shown.
[0117] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 420, and are executed by the complex programmable logic device 410 to complete the present application. The one or more modules / units may be a series of computer program segments that can complete specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 400.
[0118] Those skilled in the art will understand that Figure 5 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.
[0119] The memory 420 may be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 420 is used to store the computer program and other programs and data required by the terminal device. The memory 420 may also be used to temporarily store data that has been output or is to be output.
[0120] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0121] The method for determining the server shutdown type provided in the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, laptops, netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device.
[0122] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each embodiment of the method for determining a shutdown type of a server can be implemented.
[0123] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal implements the steps in each embodiment of the method for determining the server shutdown type when executing the computer program product.
[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0125] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0126] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0127] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining a server shutdown type, characterized in that: Applied to a server, the server comprising a complex programmable logic device and a CPU, the complex programmable logic device comprising a shutdown register; Wherein, the determination method includes: The complex programmable logic device obtains data information of the CPU, wherein the data information includes a first update instruction, a power supply voltage, and a key state of a control key; When the data information meets a preset data update condition, the complex programmable logic device stores target data in a target area in the shutdown register based on the data information, wherein the target data represents a shutdown type of the CPU, and the data update condition includes receiving the first update instruction, the power supply voltage is less than a preset threshold, and the key state is a shutdown state; When the data information meets a preset data update condition, the complex programmable logic device stores target data in a target area in the shutdown register based on the data information, including: When the data information satisfies the reception of the first update instruction, the complex programmable logic device stores first data in a target area of the shutdown register, the target data includes the first data, and the first data indicates that the shutdown type of the CPU is a shutdown of the CPU running a normal program; When the data information satisfies that the power supply voltage is less than a preset threshold, the complex programmable logic device stores second data in a target area of the shutdown register, the target data includes the second data, and the second data indicates that the shutdown type of the CPU is abnormal power supply shutdown; When the data information satisfies that the key state is a shutdown state, the complex programmable logic device stores third data in a target area in the shutdown register, the target data includes the third data, and the third data indicates that the shutdown type of the CPU is key shutdown.
2. The method for determining the server shutdown type according to claim 1, characterized in that: The complex programmable logic device obtains data information of the CPU, including: Before the CPU executes the first shutdown instruction, the CPU sends a first update instruction to the complex programmable logic device; The complex programmable logic device receives the first update instruction, and the data information includes the first update instruction; or, The complex programmable logic device detects the power supply voltage of the CPU, and the data information includes the power supply voltage; or, The complex programmable logic device detects the key status of the control key of the CPU, and the data information includes the key status.
3. The method for determining the server shutdown type according to claim 1, characterized in that: The server includes a baseboard management controller, and the method further includes: Before the baseboard management controller sends the second shutdown instruction to the CPU, the baseboard management controller sends a second update instruction to the complex programmable logic device; After the complex programmable logic device receives the second update instruction, the complex programmable logic device stores fourth data in the target area of the shutdown register, wherein the fourth data represents that the shutdown type of the CPU is that the baseboard management controller controls the CPU to shut down.
4. The method for determining the server shutdown type according to any one of claims 1 to 3, characterized in that: The server includes a baseboard management controller, and after storing target data in the target area of the shutdown register, includes: The baseboard management controller obtains the target data in the complex programmable logic device; The baseboard management controller stores the target data.
5. The method for determining the server shutdown type according to claim 3, characterized in that: After the complex programmable logic device stores fourth data in the target area of the shutdown register, the method includes: The baseboard management controller obtains the fourth data in the complex programmable logic device; The baseboard management controller stores the fourth data.
6. A server, characterized in that: The invention comprises a complex programmable logic device, a CPU and a memory, and a computer program stored in the memory and executable on the complex programmable logic device, wherein the complex programmable logic device comprises a shutdown register, and the complex programmable logic device implements the method for determining the server shutdown type as described in any one of claims 1 to 5 when executing the computer program.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for determining a server shutdown type according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Abnormal running monitoring method and device
CN104199766A
Computer equipment and method for switching on and switching off computer equipment
CN106445046A
