Terminal shutdown prompt method, terminal and readable storage medium
By setting a shutdown prompt light on the terminal and dynamically adjusting its display status according to the type of startup program, the problem of users being unable to determine when to shut down safely is solved, and the security and stability of terminal operation are improved.
Patent Information
- Application Number
- CN201810847584.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-27
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2038-07-27
AI Technical Summary
When the terminal does not have an input terminal and a corresponding display interface, the user cannot know under what circumstances can the shutdown button be pressed to cause the terminal to lose power, which may cause power to fall during the system startup or kernel startup stages, which may easily lead to damage to the terminal system and hard disk files, affecting the security and stability of the terminal operation.
By setting a shutdown prompt light on the terminal and executing the preset startup program in sequence according to the received startup signal, determining the type of startup program to be executed, and setting the shutdown prompt light to the corresponding display state to prompt the user whether the shutdown operation can be performed. Specifically, when the boot program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to the first display state, and the shutdown prompt is prompted to prohibit shutdown; when the boot program to be executed is other boot programs other than the kernel loader and operating system loader, the shutdown prompt light is set to the second display state, and the shutdown prompt is prompted to shut down.
Through the display status of the shutdown prompt light, users can clarify whether the shutdown button can be pressed to shut down the terminal, thereby avoiding shutdown operations in the inaccurate period, reducing the risk of damage to terminal system and hard disk files, and improving the security and stability of terminal operation.
Smart Images

Figure CN110764828B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a computer technology, and in particular to a shutdown prompt method for a terminal, a terminal and a readable storage medium. Background Art
[0002] With the rapid development of information technology, terminals with only basic computing and processing functions are needed in many special application fields.
[0003] In the prior art, since the terminal does not have an input terminal and a corresponding display interface, when shutting down the terminal, the user directly presses a shutdown button of the terminal to directly power off the terminal and shut down the terminal.
[0004] However, in the case where the terminal does not have an input terminal and a corresponding display interface, the user cannot know under what circumstances to press the shutdown button to power off the terminal. In particular, when the terminal is in the system startup or kernel startup stage, the terminal power failure can easily cause damage to the terminal system and hard disk files, affecting the security and stability of the terminal operation. Summary of the invention
[0005] In view of the technical problem that when shutting down a terminal, the user cannot know the current terminal status and is prone to directly pressing the shutdown button of the terminal, which may cause damage to the terminal system and hard disk files, affecting the security and stability of the terminal operation, the present invention provides a terminal shutdown prompt method, a terminal and a readable storage medium.
[0006] In one aspect, the present invention provides a shutdown prompt method for a terminal, wherein the terminal includes a shutdown prompt light, and the prompt method includes:
[0007] Execute preset power-on procedures in sequence according to the received power-on signal;
[0008] When the boot program to be executed is a kernel loader or an operating system loader, setting the shutdown prompt light to a first display state;
[0009] When the boot program to be executed is a boot program other than the kernel loader and the operating system loader, the shutdown prompt light is set to the second display state.
[0010] In one optional implementation manner, the terminal shutdown prompt method further includes:
[0011] After the preset startup procedure is executed, the shutdown prompt light is set to the second display state.
[0012] In one optional implementation manner, the second display state includes a first sub-state and a second sub-state;
[0013] When the boot program to be executed is a boot program other than the kernel loader and the operating system loader, setting the shutdown prompt light to the second display state includes:
[0014] If the boot program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, the shutdown prompt light is set to the first sub-state in the second display state;
[0015] Otherwise, the shutdown prompt light is set to the second sub-state in the second display state.
[0016] In one optional implementation manner, when the shutdown prompt light is set to the second display state, the method further includes:
[0017] When a shutdown signal is received, the pre-stored shutdown function is called;
[0018] The shutdown operation is performed according to the shutdown function and the shutdown prompt light is turned off.
[0019] In one optional implementation manner, after receiving the power-on signal, the method further includes:
[0020] Periodically executing a preset polling function, wherein the polling function is used to obtain a set state of a status register;
[0021] Correspondingly, after receiving the shutdown signal and before calling the pre-stored shutdown function, the method further includes:
[0022] The state register is set to a preset state according to the shutdown signal, so that the polling function executes the step of calling a pre-stored shutdown function after acquiring that the set state of the state register is the preset state.
[0023] In one optional implementation manner, the execution period of the polling function is 1 second.
[0024] In another aspect, the present invention provides a terminal, the terminal including a shutdown prompt light, including:
[0025] A signal triggering unit, used to receive a power-on signal triggered by a user;
[0026] An execution unit is used to execute preset startup programs in sequence; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state.
[0027] In one optional implementation manner, the terminal further includes:
[0028] After executing the preset startup program, the execution unit sets the shutdown prompt light to the second display state.
[0029] In one optional implementation manner, the second display state includes a first sub-state and a second sub-state;
[0030] The execution unit is specifically used to: if the startup program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, then the shutdown prompt light is set to the first sub-state in the second display state; otherwise, the shutdown prompt light is set to the second sub-state in the second display state.
[0031] In one optional implementation manner, when the shutdown prompt light is set to the second display state, when the signal triggering unit receives a shutdown signal, the execution unit calls a pre-stored shutdown function;
[0032] The shutdown operation is performed according to the shutdown function and the shutdown prompt light is turned off.
[0033] In one optional implementation, after the signal trigger unit receives the power-on signal, the execution unit is further configured to periodically execute a preset polling function, wherein the polling function is configured to obtain a set state of a status register;
[0034] Correspondingly, after the signal trigger unit receives a shutdown signal, the execution unit sets the status register to a preset state according to the shutdown signal before calling the pre-stored shutdown function. After obtaining the result that the set state of the status register is the preset state according to the polling function, the execution unit executes the step of calling the pre-stored shutdown function.
[0035] In one optional implementation manner, the execution period of the polling function is 1 second.
[0036] In another aspect, the present invention provides a terminal, comprising: a shutdown prompt light, a memory, a processor, and a computer program;
[0037] Wherein, the shutdown prompt light is arranged on the surface of the terminal shell and connected to the processor;
[0038] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in any one of the preceding items.
[0039] In a final aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the computer program is processed and executed to implement the method as described in any one of the preceding items.
[0040] The present invention provides a shutdown prompt method for a terminal, a terminal and a readable storage medium, which execute preset startup programs in sequence according to a received startup signal; when the startup program to be executed is a kernel loader or an operating system loader, a shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, so that the display state of the shutdown prompt light can be used to prompt the user whether to press the shutdown button to execute the terminal shutdown, thereby avoiding affecting the safety and stability of the terminal operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0042] Figure 1 A schematic diagram of a process flow of a method for prompting a shutdown of a terminal provided in the first embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a process flow of a terminal shutdown prompt method provided in Embodiment 2 of the present invention;
[0044] Figure 3 A schematic diagram of the architecture of a terminal provided in Embodiment 3 of the present invention;
[0045] Figure 4 A schematic diagram of the hardware structure of a terminal provided in Embodiment 4 of the present invention.
[0046] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0048] With the rapid development of information technology, terminals with only basic computing and processing functions are needed in many special application fields. Since these terminals do not have input terminals and corresponding display interfaces, when users shut down these terminals, they can only directly press the shutdown button of the terminal to power off the terminal.
[0049] However, in the case where the terminal does not have an input terminal and a corresponding display interface, the user cannot know under what circumstances to press the shutdown button to power off the terminal. In particular, when the terminal is in the system startup or kernel startup stage, the terminal power failure can easily cause damage to the terminal system and hard disk files, affecting the security and stability of the terminal operation.
[0050] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0051] Figure 1 A schematic flow chart of a method for prompting a shutdown of a terminal provided in Embodiment 1 of the present invention.
[0052] like Figure 1 As shown, the terminal shutdown prompt method is applied to a terminal without an input terminal and a corresponding display interface, and the method includes:
[0053] Step 101: Execute preset startup programs in sequence according to the received startup signal, and determine whether the startup program to be executed is a kernel loader or an operating system loader;
[0054] If yes, execute step 102 ; otherwise, execute step 130 .
[0055] Step 102: Set the shutdown indicator light to a first display state.
[0056] Step 103: Set the shutdown indicator light to the second display state.
[0057] It should be noted that the execution subject of the terminal shutdown prompt method provided in the first embodiment of the present invention is the terminal, which can be an electronic product installed with various operating systems. The electronic product can be a terminal without input devices and display devices, such as industrial electronic equipment and mobile electronic equipment. The input device refers to a mouse, keyboard, touch screen and other devices that can be used for users to interact with the terminal; and the display device refers to a display screen, display, display area and other devices used to display the terminal operation interface, operation status or operation interface to the user. In addition, the program loaded in the terminal can be written in languages such as C / C++, Java, Shell or Python.
[0058] In this embodiment, similar to the prior art, after the user triggers the power button on the terminal, the terminal will execute the preset power-on program in sequence according to the received power-on signal. For example, the preset power-on program generally includes but is not limited to CPU power-on, memory initialization program, north and south bridge initialization program, process monitoring command line setting program, kernel loader, operating system loader, etc. Among them, in the process of executing the kernel loader and the operating system loader, there are a large number of data interaction behaviors between the service process of the terminal system and the hard disk file. Once the user triggers the switch button in these two stages, the terminal will directly cut off the power supply to the CPU according to the received shutdown signal to power off the CPU. At this time, since the data interaction behavior is still going on between the terminal system and the hard disk file, the power failure will cause the abnormal interruption of the interaction behavior, and the terminal system and the hard disk file are prone to damage, affecting the safety and stability of the terminal operation. Therefore, different from the prior art, in this embodiment, when it is determined that the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light of the terminal is set to the first display state to prompt the user that the shutdown operation is prohibited at this time, that is, it is not appropriate to trigger the terminal power button; and when it is determined that the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light of the terminal is set to the second display state to prompt the user that the shutdown operation can be performed at this time, that is, the terminal power button is triggered.
[0059] Among them, the terminal of this embodiment is provided with a switch button, and the user can trigger the switch button according to his own needs. At the same time, the terminal is also provided with a shutdown reminder light for issuing a corresponding shutdown reminder to the user. Among them, the shutdown reminder light can be added on the surface of the terminal shell, or it can be a display light already in the terminal itself, such as a fault display light. In addition, the shutdown reminder light needs to have multiple display states to issue a corresponding shutdown reminder to the user through the change of the display state. For example, a two-color LED light with red and green can be used as the shutdown reminder light; a single color or multi-color light with multiple flashing displays can also be used as the shutdown reminder light. Of course, in this application, when the shutdown reminder light is set to the first display state, it is used as a reminder signal to prompt the user to prohibit triggering the switch button, and when the shutdown reminder light is set to the second display state, it is used as a reminder signal to prompt the user to trigger the switch button.
[0060] Preferably, in this embodiment, in order to further improve the operation stability of the terminal, the second display state shown includes a first sub-state and a second sub-state; when the boot program to be executed is a boot program other than the kernel loader and the operating system loader, the shutdown prompt light is set to the second display state, including: if the boot program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, the shutdown prompt light is set to the first sub-state in the second display state; otherwise, the shutdown prompt light is set to the second sub-state in the second display state. That is to say, if the three stages of the boot program of CPU power-on, memory initialization program, and north and south bridge initialization program are to be executed, the shutdown prompt light can be set to the first sub-state to prompt the user that it is not recommended to trigger the switch button at this time, and when the boot program other than the kernel loader or the operating system loader and the three stages of the boot program is to be executed, the shutdown prompt light is set to the second sub-state to prompt the user that the switch button can be triggered at this time. Among them, the first sub-state and the second sub-state of the second display state can be distinguished by the strobing frequency, color, etc. of the shutdown prompt light, and this embodiment does not limit this.
[0061] The terminal shutdown prompt method provided in the first embodiment of the present invention executes preset startup programs in sequence according to the received startup signal; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, so that the user is prompted whether to press the shutdown button to execute the terminal shutdown through the display state of the shutdown prompt light, thereby avoiding affecting the security and stability of the terminal operation.
[0062] On the basis of the above-mentioned embodiment 1, in order to further illustrate the shutdown prompt method of the terminal provided by the present invention, Figure 2 The flowchart of a method for prompting a terminal to shut down is provided in the second embodiment of the present invention. Figure 2 As shown, the prompt method includes:
[0063] Step 201, execute the preset startup programs in sequence according to the received startup signal. When the startup program to be executed is a kernel loader or an operating system loader, set the shutdown prompt light to the first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, set the shutdown prompt light to the second display state.
[0064] Step 202: After executing the preset startup procedure, the shutdown indicator light is set to the second display state.
[0065] It should be noted that, similar to the first embodiment, the execution subject of the terminal shutdown prompt method provided in the second embodiment of the present invention is a terminal, and the terminal can be an electronic product installed with various operating systems. The electronic product can be a terminal that does not have an input device and a display device, such as an industrial electronic device and a mobile electronic device. The input device refers to a device such as a mouse, a keyboard, a touch screen, etc. that can be used for the user to interact with the terminal; and the display device refers to a display screen, a display, a display area, etc., which is used to display the terminal operation interface, operation status or operation interface to the user. In addition, the program loaded in the terminal can be written in languages such as C / C++, Java, Shell or Python.
[0066] At the same time, after the user triggers the power-on button on the terminal, the terminal will execute the preset power-on program in sequence according to the received power-on signal. At the same time, once the terminal determines that the power-on program to be executed is a kernel loader or an operating system loader, the terminal's shutdown prompt light is set to the first display state to prompt the user that the shutdown operation is prohibited at this time, that is, it is not appropriate to trigger the terminal switch button; and when it is determined that the power-on program to be executed is a power-on program other than the kernel loader and the operating system loader, the terminal's shutdown prompt light is set to the second display state to prompt the user that the shutdown operation can be performed at this time, that is, the user can trigger the terminal switch button. The terminal of this embodiment is provided with a switch button, and the user can trigger the switch button according to his own needs. At the same time, the terminal is also provided with a shutdown prompt light for issuing a corresponding shutdown prompt to the user. Among them, the shutdown prompt light can be added on the surface of the terminal shell, or it can be a display light already in the terminal itself, such as a fault display light. In addition, the shutdown reminder light needs to have multiple display states to send a corresponding shutdown reminder to the user through the change of the display state. For example, a two-color LED light with red and green can be used as the shutdown reminder light; a single color or multi-color light with multiple flashing displays can also be used as the shutdown reminder light. Of course, in this application, when the shutdown reminder light is set to the first display state, it is used as a reminder signal to remind the user not to trigger the switch button, and when the shutdown reminder light is set to the second display state, it is used as a reminder signal to remind the user that the switch button can be triggered.
[0067] Preferably, in this embodiment, in order to further improve the operating stability of the terminal, when executing the three-stage startup program of CPU power-on, memory initialization program and north and south bridge initialization program, the shutdown prompt light can also be set to the second sub-state to prompt the user that it is not recommended to trigger the switch button at this time.
[0068] Different from the first embodiment, in the second embodiment, after the terminal executes the preset startup program, the terminal sets the shutdown prompt light to the second display state. Specifically, after the preset startup program is executed, the terminal enters the normal operation stage, at which time the terminal can execute the preset task program to achieve its corresponding function. When the terminal is in the normal operation stage, since its system operation is relatively stable, the shutdown prompt light can be set to the second display state to prompt the user to trigger the switch button at this time to shut down the terminal.
[0069] Of course, in order to further improve the terminal operation stability in this embodiment, after the user presses the switch button according to the display state of the shutdown prompt light so that the terminal receives the corresponding shutdown display, the terminal can call the pre-stored shutdown function, and use the shutdown function to perform the shutdown operation, extinguish the shutdown prompt light, and thus achieve safe shutdown of the terminal. Specifically, for some terminals with display and input functions, the user can realize the shutdown operation of the terminal by operating the corresponding shutdown program or inputting the corresponding shutdown command, while the terminal based on the present invention does not have input and display functions. In the prior art, in order to shut it down, the user can only press the switch button to directly power it off. Such a shutdown method is also prone to cause system service errors and affect the operation stability. However, this embodiment adopts the method of calling the pre-stored shutdown function so that the terminal of this embodiment can be shut down in a safer shutdown method like other terminals with display and input functions. It should be noted that the shutdown function can specifically adopt an existing function function, which is not limited in this embodiment. However, the shutdown function should implement the following functions in sequence: shut down the system service process to prevent data loss or damage; turn off the shutdown indicator light; and power off. It should be noted that the process of calling the shutdown function to shut down can be used in the normal operation stage after the terminal executes the preset startup program, and can also be used in the stage when the terminal executes other startup programs except the kernel loader and the operating system loader; that is, when the startup program to be executed is the kernel loader or the operating system loader, the terminal cannot call the shutdown function.
[0070] Further, as mentioned above, for the terminal of the present application, it can only obtain the user's shutdown demand by detecting whether the user presses the switch button. Therefore, as a terminal, it needs to pay attention to whether the shutdown signal is received at all times in order to call the shutdown function, but such an operation mode of paying attention to the shutdown signal at all times to call the shutdown function at any time will cause the system overhead of the terminal to increase sharply and not utilize the normal operation of the terminal. Therefore, in order not to affect the normal operation of the terminal and reduce the system overhead, in this embodiment, a polling function can be set to obtain the set state of the status register of the terminal by the user; and after the terminal receives the power-on signal, the polling function will be periodically executed to periodically obtain the set state of the status register. When the terminal receives the shutdown signal, the status register is set to a preset state by hardware triggering. At this time, when the polling function obtains the set state of the status register as a preset state during the execution process, the terminal can execute the step of calling the pre-stored shutdown function, and finally realize the shutdown of the terminal. The aforementioned state register is set to a preset state by hardware triggering, which can be implemented by a complex programmable logic device CPLD (Complex Programmable Logic Device, referred to as CPLD) in the terminal, and its implementation method and the implemented logic circuit can be set by those skilled in the art. In addition, the polling cycle of the polling function can be 1 second to further ensure the normal operation of the terminal and reduce the system overhead to 0.01%.
[0071] The terminal shutdown prompt method provided in the second embodiment is based on the above-mentioned embodiment one, and further sets the shutdown prompt light to the second display state after the terminal executes the preset startup program, so as to prompt the user that the switch button can be triggered at this stage to shut down the terminal, thereby further prompting the user whether to press the shutdown button to shut down the terminal through the display state of the shutdown prompt light, thereby avoiding affecting the security and stability of the terminal operation.
[0072] Figure 3 A schematic diagram of the architecture of a terminal provided in Embodiment 3 of the present invention is shown as follows: Figure 3 As shown, the terminal includes:
[0073] A signal triggering unit 10, used to receive a power-on signal triggered by a user;
[0074] The execution unit 20 is used to execute preset startup programs in sequence; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state.
[0075] It should be noted that the terminal provided in the third embodiment of the present invention can be an electronic product installed with various operating systems. The electronic product can be a terminal without input devices and display devices, such as industrial electronic equipment and mobile electronic equipment. The input device refers to a mouse, keyboard, touch screen, etc. that can be used for users to interact with the terminal; and the display device refers to a display screen, display, display area, etc. that is used to display the terminal operation interface, operation status or operation interface to the user. In addition, the program loaded in the terminal can be written in languages such as C / C++, Java, Shell or Python.
[0076] In this embodiment, similar to the prior art, after the user triggers the power button on the terminal, the signal trigger unit 10 can receive the power-on signal so that the execution unit 20 executes the preset power-on program in sequence. For example, the preset power-on program generally includes but is not limited to CPU power-on, memory initialization program, north and south bridge initialization program, process monitoring command line setting program, kernel loader, operating system loader, etc. Among them, in the process of executing the kernel loader and the operating system loader, there are a large number of data interaction behaviors between the service process of the terminal system and the hard disk file. Once the user triggers the switch button in these two stages, the execution unit 20 will directly cut off the power supply to the CPU according to the received shutdown signal to power off the CPU. At this time, since the terminal system and the hard disk are still performing data interaction, the power failure will cause the abnormal terminal of the interaction behavior, and the terminal system and hard disk files are prone to damage, affecting the safety and stability of the terminal operation. Therefore, different from the prior art, in this embodiment, when the execution unit 20 determines that the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to the first display state to prompt the user that the shutdown operation is prohibited at this time, that is, it is not appropriate to trigger the terminal switch button; and when the execution unit 20 determines that the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to the second display state to prompt the user that the shutdown operation can be performed at this time, that is, the terminal switch button can be triggered.
[0077] Among them, the terminal of this embodiment is provided with a switch button, and the user can activate the switch button according to his own needs. At the same time, the terminal is also provided with a shutdown reminder light for issuing a corresponding shutdown reminder to the user. Among them, the shutdown reminder light can be added on the surface of the terminal shell, or it can be a display light already in the terminal itself, such as a fault display light. In addition, the shutdown reminder light needs to have multiple display states to issue a corresponding shutdown reminder to the user through the change of the display state. For example, a two-color LED light with red and green can be used as the shutdown reminder light; a single color or multi-color light with multiple flashing displays can also be used as the shutdown reminder light. Of course, in this application, when the shutdown reminder light is set to the first display state, it is used as a reminder signal to prompt the user to prohibit triggering the switch button, and when the shutdown reminder light is set to the second display state, it is used as a reminder signal to prompt the user to trigger the switch button.
[0078] In one optional implementation manner, the terminal further includes:
[0079] After executing the preset startup program, the execution unit 20 sets the shutdown prompt light to the second display state.
[0080] In one of the optional embodiments, the second display state includes a first sub-state and a second sub-state; the execution unit 20 is specifically used to: if the startup program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, then the shutdown prompt light is set to the first sub-state in the second display state; otherwise, the shutdown prompt light is set to the second sub-state in the second display state.
[0081] In one optional implementation, when the shutdown prompt light is set to the second display state, when the signal trigger unit 10 receives a shutdown signal, the execution unit 20 calls a pre-stored shutdown function;
[0082] The shutdown operation is performed according to the shutdown function and the shutdown prompt light is turned off.
[0083] In one optional implementation, after the signal trigger unit 10 receives the power-on signal, the execution unit 20 is further configured to periodically execute a preset polling function, wherein the polling function is configured to obtain a set state of a status register;
[0084] Correspondingly, when the signal trigger unit 10 receives a shutdown signal, the execution unit 20 sets the status register to a preset state according to the shutdown signal. When the execution unit 20 obtains the result that the set state of the status register is the preset state according to the polling function, it executes the step of calling the pre-stored shutdown function.
[0085] In one optional implementation manner, the execution period of the polling function is 1 second.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above and the corresponding beneficial effects can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0087] The terminal provided in the third embodiment of the present invention executes preset startup programs in sequence according to the received startup signals; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, so that the display state of the shutdown prompt light can be used to prompt the user whether to press the shutdown button to execute the terminal shutdown, thereby avoiding affecting the security and stability of the terminal operation.
[0088] Figure 4 This is a schematic diagram of the hardware structure of a terminal provided in Embodiment 4 of the present invention. Figure 4 As shown, the terminal includes: a shutdown indicator light 41, a memory 43, a processor 42 and a computer program;
[0089] The shutdown prompt light 41 is arranged on the surface of the terminal housing and is connected to the processor 42;
[0090] The computer program is stored in the memory 43 and is configured to be executed by the processor 42 to implement the method as described in any of the above.
[0091] The memory 43 may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage terminal, etc. The processor 42 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processor architectures (DSPs), digital signal processing terminals (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessor architectures, or other electronic components. The computer program may be written in languages such as C / C++, Java, Shell, or Python, and this embodiment does not limit this.
[0092] The terminal provided in the fourth embodiment of the present invention executes preset startup programs in sequence according to the received startup signals; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, so that the display state of the shutdown prompt light can be used to prompt the user whether to press the shutdown button to execute the terminal shutdown, thereby avoiding affecting the security and stability of the terminal operation.
[0093] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer program is processed and executed to implement the method described in any of the above embodiments.
[0094] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0095] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for prompting a shutdown of a terminal, characterized in that: The terminal is provided with a shutdown reminder light, the shutdown reminder light is used to send a corresponding shutdown reminder to the user, the terminal does not have an input terminal and a display interface, and the method includes: Execute preset power-on procedures in sequence according to the received power-on signal; When the boot program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state, wherein the first display state is used to prompt that it is forbidden to trigger the switch button to perform a shutdown operation at this time; When the boot program to be executed is a boot program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, and the second display state is used to prompt that the switch button can be triggered to perform a shutdown operation at this time to protect the terminal system and hard disk files; Also includes: After executing the preset startup procedure, setting the shutdown prompt light to the second display state; When the shutdown prompt light is set to the second display state, the method further includes: When a shutdown signal is received, the pre-stored shutdown function is called; Execute the shutdown operation according to the shutdown function and turn off the shutdown prompt light; the shutdown function sequentially implements the following functions: shut down the system service process to prevent data loss or damage, turn off the shutdown prompt light, and power off; The second display state includes a first sub-state for prompting that triggering the switch button is not recommended; if the startup program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, the shutdown prompt light is set to the first sub-state.
2. The shutdown prompt method according to claim 1, characterized in that: The second display state also includes a second sub-state, and the second sub-state is used to prompt that the switch button can be triggered at this time; If the startup program to be executed is other startup programs except CPU power-on, memory initialization, north and south bridge initialization, kernel loader and operating system loader, the shutdown prompt light is set to the second sub-state.
3. The shutdown prompt method according to claim 1, characterized in that: After receiving the power-on signal, the method further includes: Periodically executing a preset polling function, wherein the polling function is used to obtain a set state of a status register; After receiving the shutdown signal, the method further includes: The state register is set to a preset state according to the shutdown signal, so that when the polling function obtains that the set state of the state register is the preset state, it executes the step of calling a pre-stored shutdown function.
4. The shutdown prompt method according to claim 3, characterized in that: The execution cycle of the polling function is 1 second.
5. A terminal, characterized in that: The terminal is provided with a shutdown reminder light, and the shutdown reminder light is used to send a corresponding shutdown reminder to the user. The terminal does not have an input terminal and a display interface, and includes: A signal triggering unit, used to receive a power-on signal triggered by a user; An execution unit is used to execute preset startup programs in sequence; when the startup program to be executed is a kernel loader or an operating system loader, the shutdown prompt light is set to a first display state, and the first display state is used to prompt that it is forbidden to trigger the switch button to perform a shutdown operation at this time; when the startup program to be executed is a startup program other than the kernel loader and the operating system loader, the shutdown prompt light is set to a second display state, and the second display state is used to prompt that the switch button can be triggered to perform a shutdown operation at this time to protect the terminal system and hard disk files; Also includes: After executing the preset startup program, the execution unit sets the shutdown prompt light to the second display state; In the case where the shutdown prompt light is set to the second display state, when the signal triggering unit receives a shutdown signal, the execution unit calls a pre-stored shutdown function; Execute the shutdown operation according to the shutdown function and turn off the shutdown prompt light; the shutdown function sequentially implements the following functions: shut down the system service process to prevent data loss or damage, turn off the shutdown prompt light, and power off; The second display state includes a first sub-state for prompting that triggering the switch button is not recommended; if the startup program to be executed is CPU power-on, memory initialization, and north and south bridge initialization, the execution unit is specifically used to set the shutdown prompt light to the first sub-state.
6. The terminal according to claim 5, characterized in that: The second display state also includes a second sub-state, and the second sub-state is used to prompt that the switch button can be triggered at this time; If the startup program to be executed is other startup programs except CPU power-on, memory initialization, north and south bridge initialization, kernel loader and operating system loader, the shutdown prompt light is set to the second sub-state.
7. The terminal according to claim 5, characterized in that: After the signal trigger unit receives the power-on signal, the execution unit is further used to periodically execute a preset polling function, wherein the polling function is used to obtain the set state of the status register; After the signal trigger unit receives a shutdown signal, the execution unit also sets the status register to a preset state according to the shutdown signal. When the execution unit obtains the result that the set state of the status register is the preset state according to the polling function, it executes the step of calling a pre-stored shutdown function.
8. The terminal according to claim 7, characterized in that: The execution cycle of the polling function is 1 second.
9. A terminal, characterized in that: include: Shutdown indicator light, memory, processor and computer program; Wherein, the shutdown prompt light is arranged on the surface of the terminal shell and connected to the processor; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 4.
10. A readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is processed and executed to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method for displaying starting up progress of embedded device
CN101526905A
Switching method of projection TV set
CN1794797A