Screen saver method and computing device
By modifying Bash command execution logic to implement screen protection and identity verification in character user interfaces, the method addresses the security gap in existing Linux server interfaces, enhancing security through screen saver activation and verification.
Patent Information
- Application Number
- CN202211712599.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-12-29
AI Technical Summary
The existing screen protection mechanism cannot be applied to the character user interface of the Linux operating system, resulting in insufficient security of the server.
By changing the timeout exit logic of Bash, screen protection and password verification of the character user interface are realized, including detecting that there is no command input to enter the screen save state, and displaying the authentication interface after the operation is triggered.
It realizes independent screen protection and password verification of the character user interface, improves server security and prevents information leakage.
Smart Images

Figure CN116010007B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of servers, and in particular to a screen protection method and a computing device. Background Art
[0002] With the development of information technology, computers have been widely used. The normal operation of computers is inseparable from the operating system. The operating system can be divided into two types according to the interface: graphical user interface and character user interface. Graphical user interface is usually used in personal computers, and character user interface is usually used in servers. In order to prevent security risks such as unauthorized access, the operating system needs to provide a screen protection mechanism. Graphical user interfaces generally have a complete screen protection mechanism. For example, the screen protection mechanism of the graphical user interface in the Windows operating system and the screen protection mechanism of the graphical user interface in the Linux operating system mainly rely on the installed graphics system, while in the server, the character user interface of the Linux operating system is usually used. The existing screen protection mechanism cannot be applied to the character user interface of the Linux operating system, so how to implement the screen protection mechanism of the character user interface to improve the security of the server has become an urgent problem to be solved. Summary of the invention
[0003] The embodiments of the present application provide a screen saver method and a computing device, which can modify the command execution logic in Bash to implement a screen saver for a character user interface.
[0004] In a first aspect, an embodiment of the present application provides a screen protection method, comprising:
[0005] Display the first character user interface based on Bash;
[0006] Detecting command input of the first character interface;
[0007] If there is no command input in the first character user interface within a first preset time period, controlling the first character user interface to enter a screen saver interface;
[0008] In response to a triggering operation on the screen saver interface, an identity authentication interface is displayed.
[0009] By implementing the method, when the character user interface is detected to have no command input within a preset time period, the character user interface is controlled to enter a screen saver state. The present application can realize a screen saver for the character user interface.
[0010] In a possible implementation manner, before controlling the first character user interface to enter a screen saver state, the method further includes:
[0011] Registering a callback function with the operating system through the Bash;
[0012] Controlling the first character user interface to enter the screensaver interface includes:
[0013] Calling the callback function through the Bash to control the first character user interface to enter the screensaver interface.
[0014] Implementing this method, registering a callback function with the operating system, so that the first character user interface can be controlled to enter the screensaver interface through the callback function.
[0015] In a possible implementation, the controlling the first character user interface to enter the screensaver state by calling the callback function through the Bash includes:
[0016] Calling the callback function through the Bash, executing the screen saver verification command in the callback function, and controlling the first character user interface to enter the screensaver interface.
[0017] Implementing this method, controlling the character user interface to enter the screensaver interface through the screen saver verification command in the callback function, that is, by changing the logic of the callback function, the screensaver of the character user interface is realized.
[0018] In a possible implementation, before executing the screen saver verification command in the callback function to control the first character user interface to enter the screensaver state, the method further includes:
[0019] Judging whether the screen saver verification command is included in the callback function;
[0020] The executing the screen saver verification command in the callback function to control the first character user interface to enter the screensaver state includes:
[0021] If the screen saver verification command is included in the callback function, execute the screen saver verification command to control the first character user interface to enter the screensaver interface.
[0022] Implementing this method, when the screen saver verification command is included in the callback function, execute the screen saver verification command in the callback function to realize the screensaver of the character user interface.
[0023] In a possible implementation, the method further includes:
[0024] If the screen saver verification command is not included in the callback function, exit the session corresponding to the first character user interface.
[0025] Implementing this method, when the callback function does not include the screen saver verification command, exit the session corresponding to the character user interface, so as to be compatible with the existing Bash timeout exit logic.
[0026] In a possible design, the method further includes:
[0027] When a user interface switching command is detected, determine a second character user interface to be displayed;
[0028] Determine whether the second character user interface enters the screensaver interface;
[0029] If the second character user interface does not enter the screensaver interface, display the second character user interface;
[0030] If the second character user interface enters the screensaver interface, display the screensaver interface.
[0031] Implementing this method can switch and display each character user interface, and can independently implement a screensaver for each character user interface.
[0032] In a possible design, the display interface includes a first session and a second session; wherein, the first session corresponds to the first character user interface; the second session corresponds to the second character user interface;
[0033] If it is determined that there is no command input in the second character user interface within a second preset duration, control the second character user interface to enter the screensaver interface.
[0034] Implementing this method, when the display interface includes a first session and a second session, a screensaver can be independently implemented for the first character user interface corresponding to the first session and the second character user interface corresponding to the second session on the display interface.
[0035] In a possible design, the first session and the second session are created by the same user; or, the first session and the second session are created by different users.
[0036] Implementing this method, the first session and the second session of the display interface can be created by the same user or different users, so that a screensaver can be independently implemented for the character user interfaces of different sessions of the same user, or a screensaver can be independently implemented for the character user interfaces of the sessions created by different users.
[0037] In a possible design, before controlling the first character user interface to enter the screensaver interface, the method further includes:
[0038] After executing the command input in the first character user interface, start a timer, and the timing duration of the timer is the first preset duration;
[0039] If no command input in the first character user interface is detected during the running of the timer, determine that there is no command input in the first character user interface within the preset duration.
[0040] Implement this method to determine that there is no command input in the character user interface within a preset duration through a timer.
[0041] In a second aspect, an embodiment of the present application further provides a computing device, including: a processor and a memory, the memory is coupled to the processor; the memory is used to store computer instructions; the processor is used to call the computer instructions to perform the following operations:
[0042] Display a first character user interface based on Bash;
[0043] Detect command input to the first character interface;
[0044] If there is no command input to the first character user interface within a first preset duration, control the first character user interface to enter the screensaver interface;
[0045] In response to a trigger operation on the screensaver interface, display an authentication interface.
[0046] In some possible implementations, the processor is further used to execute the steps in any possible implementation of the first aspect above, which will not be elaborated here.
[0047] In a third aspect, an embodiment of the present application provides a screen protection device, including units for performing any possible implementation method in the first aspect above.
[0048] In a fourth aspect, an embodiment of the present application further provides a computer storage medium, including computer instructions, when the computer instructions run on a server, causing the server to execute the method described in the first aspect or any possible implementation in the first aspect.
[0049] In a fifth aspect, an embodiment of the present application further provides a computer program product, when the computer program product runs on a server, causing the server to execute the method described in the first aspect or any possible implementation in the first aspect. Description of the Drawings
[0050] Figure 1 is a schematic diagram of the system architecture of a computing device provided by an embodiment of the present application;
[0051] Figure 2 is a flowchart of the execution of the timeout exit TMOUT of Bash provided by an embodiment of the present application;
[0052] Figure 3 is a schematic diagram of Bash displaying a character user interface provided by an embodiment of the present application;
[0053] Figure 4It is a schematic flowchart of a screen protection method provided by an embodiment of the present application;
[0054] Figure 5 It is a schematic flowchart of another screen protection method provided by an embodiment of the present application;
[0055] Figure 6 It is a schematic diagram of the display of a character user interface provided by an embodiment of the present application;
[0056] Figure 7 It is a schematic diagram of the display of another character user interface provided by an embodiment of the present application;
[0057] Figure 8 It is a schematic structural diagram of a screen protection device provided by an embodiment of the present application;
[0058] Figure 9 It is a schematic structural diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners
[0059] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described below with reference to the accompanying drawings.
[0060] Terms such as "first" and "second" in the specification, claims and drawings of the present application are only used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device etc. that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices etc.
[0061] The phrase "in an embodiment" mentioned herein means that a specific feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0062] In this application, "at least one (item)" means one or more, "a plurality" means two or more, "at least two (items)" means two, three or more, and "and / or" is used to describe the relationship between related objects and indicates that three relationships may exist. For example, "A and / or B" may represent: only A exists, only B exists, and both A and B exist at the same time. Here, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the related objects before and after. "At least one (item) of the following" or its similar expression means any combination of these items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a, b, and c".
[0063] As Figure 1 shown, it is an example diagram of the system architecture of a computing device provided by an embodiment of this application. The computing device can be a server, or a gateway device or network device such as a base station or a router, or a terminal device such as a laptop computer, a desktop computer, a tablet computer, or a mobile phone. Among them, the server can be a file server, a domain server, a database server, a mail server, a web server, a multimedia server, a communication server, a terminal server, an infrastructure server, a virtualization server, etc. The server can be tower-type, rack-type, blade-type, etc. The computing device can, but is not limited to, adopt architectures such as X86, reduced instruction set computer (RISC), and advanced RISC machine (ARM).
[0064] As Figure 1As shown in the figure, the first layer of the system architecture of the computing device includes hardware, which mainly provides hardware resources. For example, it includes one or more central processing units (CPUs), one or more memories, an application processor (AP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a modem processor, an image signal processor (ISP), a memory, a video codec, a digital signal processor (DSP), a baseband processor, etc. Among them, the memory can be a Dynamic Random Access Memory (DRAM), a synchronous dynamic random-access memory (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), etc.
[0065] The second layer of the system architecture of the computing device includes an operating system kernel, which can control all hardware and computing device activities, such as hard disk access, network card transmission, and keyboard startup. After booting, the kernel program will reside in the protected memory.
[0066] The third layer of the system architecture of the computing device includes a shell program Shell. Shell is a program in the operating system used to access the services provided by the kernel. Shell connects the kernel mode and user operations of the operating system. Shell can be understood as a command language interpreter, which is an interface program between the user and the operating system (Linux) kernel. Each command input by the user is first translated by Shell and then passed to the operating system kernel, and the processed result is output to the screen. Among them, the process of being first translated by Shell and then passed to the operating system kernel can be understood as realizing the functions it wants to achieve by calling the kernel interface.
[0067] Shell can include a graphical user interface and a character user interface, and usually specifically refers to the character user interface.
[0068] Graphical User Interface (GUI): It is a computer operation interface displayed in a graphical way. Rich graphical interaction components can be displayed on this interface, such as windows, menus, buttons, checkboxes, etc. Input devices include not only keyboards but also mice, touchpads, etc.
[0069] Character User Interface (CUI): It is the most widely used user interface before the popularity of the graphical user interface. It usually only has character display, and the input device generally only has a keyboard without a mouse. Some people also call the character user interface the Command Line Interface (CLI). In some scenarios, the character user interface is usually applied to servers.
[0070] The fourth layer of the system architecture of the computing device includes application programs, which provide various application services for users.
[0071] It should also be understood that it is not limited to Figure 1 the computing device referred to. The computing device may also include more or fewer units.
[0072] It can be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the computing device. In other embodiments of the present application, the computing device may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0073] Before introducing the screen saver method of the present application, Bash involved in the embodiments of the present application is described:
[0074] Bash is a kind of Shell, short for Bourne Again Shell, and is usually the default Shell of the Linux operating system. Bash can provide a character user interface. Bash in the embodiments of the present application can work in the third layer (i.e., the Shell layer) of the system architecture as shown in Figure 1 the figure, and Bash can also work in the fourth layer (i.e., the application layer).
[0075] If Bash works in the fourth layer, then Bash is an application. For example, in the graphical user interface of the Windows operating system, this Bash runs as an application on top of the Shell, and the graphical system of the Shell can simulate a window for displaying the character user interface. It can be understood that if Bash works in the fourth layer, multiple windows can be opened on the same display device, and each window is a character user interface for a session.
[0076] If Bash works in the third layer, then the character user interface provided by Bash is provided by the operating system kernel. It can be understood that if Bash works in the third layer, only the character user interface of one session can be displayed on the display device. If it is necessary to display the character user interface of other sessions, switching needs to be performed through the input device (such as keyboard shortcuts).
[0077] The above session can be understood as follows: a session is established when logging in to an account, and there is a corresponding character user interface for this session. In the character user interface, the same account can log in multiple times and create multiple sessions, or one account can log in once to create one session.
[0078] In the embodiments of this application, in order to implement screen protection and password verification for the character user interface of Bash, the execution logic of the timeout exit TMOUT of Bash is changed, so as to implement screen protection and password verification for the character user interface of Bash. For specific details, please refer to the description of the subsequent embodiments and will not be elaborated here.
[0079] Before introducing the embodiments of this application, first introduce the execution logic of the timeout exit TMOUT of Bash, as Figure 2 shown, is the flowchart of the execution of the timeout exit TMOUT of Bash. As Figure 2 shown, this flowchart includes the following steps:
[0080] 101. Bash determines whether TMOUT is greater than 0. If the determination result is yes, step 102 is executed; if the determination result is no, step 104 is executed.
[0081] As Figure 3 shown, is a schematic diagram of the character user interface displayed by Bash, and the user can input commands through this character user interface.
[0082] Before Bash finishes executing the previous command entered in the character user interface and is about to read the next command, Bash determines whether TMOUT is greater than 0. Among them, if TMOUT is greater than 0, it can be understood that the function of configurable timeout exit is enabled; if TMOUT is less than or equal to 0, it can be understood that the function of timeout exit is not configured, and step 104 is executed, waiting to read the next command all the time until a command input by the user is read, and then the command is executed.
[0083] 102. Bash registers a callback function.
[0084] Among them, registering a callback function can be understood as registering a callback function with the operating system. The functions of the callback function include Bash exiting. Bash exiting can be understood as exiting the session of this character user interface, or it can also be understood as ending the session of this character user interface.
[0085] 103. Bash starts a timer.
[0086] The timing duration of this timer is TMOUT seconds.
[0087] 104. Bash waits to read a command.
[0088] Bash waits for the user to input commands through the character user interface. If the timer times out, that is, no command is received from the user within TMOUT seconds, step 105 is executed, that is, the callback function is executed. If the timer does not time out, the waiting continues. It should be noted that before the timer times out, if a command is received from the user through the character user interface, step 106 is executed.
[0089] 105, Bash exits.
[0090] The exit of Bash can be understood as exiting the session of the character user interface, or it can also be understood as ending the session of the character user interface.
[0091] 106, Bash reads the command.
[0092] Before the timer times out, if a command is received from the user through the character user interface, the input command is read, and step 107 is executed.
[0093] 107, Bash cancels the timer.
[0094] Among them, Bash canceling the timer can be understood as turning off the timer and executing step 108.
[0095] 108, Bash executes the command.
[0096] Among them, Bash executing the command can be understood as converting the command into a kernel-executable command and sending it to the kernel for execution. After Bash finishes executing the command, the timer can be restarted.
[0097] Next, the screen saver method provided in this application will be described. It should be noted that the screen saver method in this application includes screen saver and password verification.
[0098] As Figure 4 shown, it is a schematic flowchart of a screen saver method provided by an embodiment of this application. As Figure 4 shown, the flowchart of this screen saver method includes but is not limited to the following steps:
[0099] 201, Bash displays the character user interface.
[0100] The character user interface is usually used for servers. Users can input commands in the character user interface to operate the server. Exemplarily, the user logs in to the server through an account and password, and then the character user interface is displayed. After logging in, the user has the permission to input commands to operate the server.
[0101] After a user logs in, a session can be established. In a character user interface, an account (which can also be referred to as a user) can log in to the server multiple times simultaneously. Each time a login occurs, a session is created. In other words, an account can create multiple sessions, and each session corresponds to a character user interface. It is also possible for multiple accounts to log in to the server simultaneously, and multiple sessions can be created for the currently logged-in multiple accounts.
[0102] If Bash operates at the third layer and the character user interface is provided by the operating system, the display device can only display the character user interface of one session at a time. The user can switch between the character user interfaces of multiple sessions through an input device (such as keyboard shortcuts). As Figure 6 shown, it is a schematic diagram of the display of the character user interfaces of each session when Bash operates at the third layer. As Figure 6 shown, the display device is currently displaying the character user interface 1. If it is necessary for the display device to display the character user interface 2, a triggering operation needs to be performed through the input device to trigger the switch from the character user interface 1 to the character user interface 2.
[0103] If Bash operates at the fourth layer, that is, Bash runs as an application on top of the Shell, the character user interface of a session can be displayed through a window simulated by the Shell graphics system. In this scenario, the display device can simultaneously display the character user interfaces of multiple sessions on the graphical user interface. As Figure 7 shown, it is a schematic diagram of the display of the character user interfaces of each session when Bash operates at the fourth layer. As Figure 7 shown, this graphical user interface includes 3 windows, and each window corresponds to a character user interface.
[0104] 202, when Bash determines that there is no command input in the character user interface within the preset duration, Bash controls the character user interface to enter the screensaver state.
[0105] Bash determines whether there is an input command in the character user interface within the preset duration. In other words, Bash judges whether the idle duration of the character user interface reaches the preset duration. If a command input by the user is detected before the idle duration of the character user interface reaches the preset duration (i.e., a command input by the user is detected before reaching the preset duration), the command is read and executed, and at the same time, the idle duration calculation is restarted.
[0106] If Bash determines that the idle duration of the character user interface reaches a preset duration, Bash can control the character user interface to enter the screensaver state. It should be noted that the screensaver state in this application includes displaying the screensaver content and, when a trigger operation is detected, switching from the screensaver content to the password verification interface, which can also be referred to as the identity verification interface. Among them, the screensaver content can be composed of characters and is a random and constantly changing pattern. The trigger operation can be a click operation on the keyboard keys. Further, if the verification password entered in the password verification interface matches the preset password, the character user interface before entering the screensaver state can be continued to be displayed.
[0107] It can be understood that in the embodiments of this application, each character user interface entering the screensaver state is independent. Continuing with Figure 6 the display of the character user interface when Bash works at the third layer as an example, as Figure 6 shown, if the idle duration of character user interface 1 reaches the preset duration (i.e., no user command input is detected in character user interface 1 within the preset duration), this character user interface 1 enters the screensaver state. When a trigger operation to switch to character user interface 2 is detected, Bash needs to determine whether the idle duration of character user interface 2 reaches the preset duration (i.e., no user command input is detected in character user interface 2 within the preset duration). If the idle duration of character user interface 2 does not reach the preset duration, character user interface 2 can be directly displayed, although character user interface 1 has already entered the screensaver state at this time. If the idle duration of character user interface 2 exceeds the preset duration, after the switch, the screensaver content can be displayed. If a trigger operation of the user is further detected, it switches from the screensaver content to the password verification interface. If the verification password entered by the user matches the preset password, character user interface 2 can be displayed. It can be understood that the verification passwords of character user interface 1 and character user interface 2 can be the same or different, and the screensaver contents of character user interface 1 and character user interface 2 can also be the same or different, which is not limited in this application.
[0108] Similarly, if Bash works at the fourth layer, the character user interface display is as Figure 7 shown, that is, the character user interface of a session exists in the form of a window, as Figure 7 shown. If the idle duration of the character user interface 1 in window 1 reaches the preset duration (i.e., no user command input is detected in character user interface 1 within the preset duration), then window 1 enters the screensaver state. If the idle duration of the character user interface 2 in window 2 does not reach the preset duration, window 2 still displays the character user interface 2. If the idle duration of the character user interface 3 in window 3 reaches the preset duration (i.e., no user command input is detected in character user interface 3 within the preset duration), then window 3 enters the screensaver state. In other words, whether each window enters the screensaver state does not affect each other.
[0109] In the embodiments of the present application, when Bash detects that there is no command input in the character user interface within a preset duration, it controls the character user interface to enter the screensaver state. In other words, the present application changes the command execution logic in Bash to implement the screensaver for the character user interface.
[0110] In Figure 4 step 202 of [], Bash can control the character user interface to enter the screensaver state by calling the screen saver verification command in the callback function. For specific reference, please refer to Figure 5 the description of [].
[0111] Please refer to Figure 5 , which is a schematic flowchart of another screen saver method provided by the embodiments of the present application. The flowchart of this screen saver method includes but is not limited to the following steps:
[0112] 301, Bash displays the character user interface.
[0113] Among them, for the specific description of step 301, please refer to Figure 4 step 201 of [], which will not be elaborated here.
[0114] 302, Bash determines whether TMOUT is greater than 0. If the determination result is yes, step 303 is executed; if the determination result is no, step 305 is executed.
[0115] Before Bash finishes executing the previous command input in the character user interface and is about to read the next command, Bash determines whether TMOUT is greater than 0. Among them, the value of TMOUT can be preset in advance. If TMOUT is greater than 0, it can be understood as a function of configurable timeout judgment. If TMOUT is less than or equal to 0, it can be understood as a function without configurable timeout judgment, and step 305 is executed, that is, waiting to read the command all the time until a command input by the user is read, and then the command is executed, without detecting the idle time of the character user interface.
[0116] 303, Bash registers a callback function.
[0117] Among them, registering the callback function can be understood as registering the callback function with the operating system. The functions of the callback function can include determining whether a screen saver verification command is configured. If the screen saver verification command is configured, the character user interface enters the screensaver state. If not, Bash exits the session of the character user interface. As Figure 5 shown by the dotted line process in [], it is the callback function.
[0118] 304, Bash starts (restarts) the timer.
[0119] The timing duration of this timer is TMOUT seconds. For example, if TMOUT is 300, the timing duration of the timer is 300 seconds.
[0120] 305, Bash waits to read a command.
[0121] Bash waits for the user to input a command through the character user interface. If no input command from the character user interface is detected during the operation of the timer, step 306 is executed. If an input command from the character user interface is detected during the operation of the timer, step 310 is executed. Among them, if no input command from the character user interface is detected during the operation of the timer, step 306 can be executed when the timer times out.
[0122] 306, If no input command from the character user interface is detected during the operation of the timer, Bash calls a callback function.
[0123] 307, Bash determines whether a screen saver verification command is configured in the callback function. If the determination result is no, step 309 is executed. If the determination result is yes, step 308 is executed.
[0124] 308, Bash executes the screen saver verification command to control the character user interface to enter the screen saver state.
[0125] Bash further determines whether a screen saver verification command is configured in the callback function. Exemplarily, the screen saver verification command TMOUT_CMD may include a screen saver command pipes.sh and a password verification command vlock, that is, TMOUT_CMD = "pipes.sh&&vlock". Among them, the pipes.sh command is used to generate a random and constantly changing pattern composed of characters as the screen saver content. vlock is used to lock the current input window after execution, and the input verification password is required to unlock it. The execution of vlock can be triggered when a user input operation is detected, for example, the user clicks the keyboard. In this application, when executing the screen saver verification command TMOUT_CMD, pipes.sh is first executed for screen saver and the screen saver content is displayed. After pipes.sh exits, vlock is executed for password verification, realizing both the screen saver and password verification functions.
[0126] Bash controls the character user interface to enter the screen saver state by executing the screen saver verification command TMOUT_CMD.
[0127] 309, Bash exits the session corresponding to the character user interface.
[0128] In the case where the screen saver verification command TMOUT_CMD is not configured in the callback function, Bash times out and exits, and Bash exits the session of the current character user interface.
[0129] 310. If an input command of the character user interface is detected during the operation of the timer, Bash reads the command.
[0130] Bash reads the command input by the user through the character user interface.
[0131] 311. Bash cancels the timer.
[0132] Among them, canceling the timer can be understood as turning off the timer.
[0133] 312. Bash executes the command.
[0134] Bash executing the command can be understood as Bash converting the command input by the user into a kernel execution command and sending it to the kernel, so as to implement the function corresponding to the command.
[0135] After Bash finishes executing the command, the timer can be restarted.
[0136] In the embodiment of the present application, when implementing the screen saver and password verification functions for the character user interface, it does not need to rely on the graphics system. Instead, by changing the timeout exit logic of Bash, when the character user interface of Bash times out, the screen saver and password verification functions are executed, improving the security of the character user interface and preventing the leakage of information on the character user interface.
[0137] In the embodiment of this application, different from the graphical user interface, in the display of the character user interface of the server, in order to facilitate the user to input commands through the character user interface to operate the server, one account can log in to the server multiple times, and these multiple logins can be in the logged-in state at the same time. Or, multiple users can log in to the server, and these multiple users can be in the logged-in state at the same time. For the same account, one login of this account can create one session, and multiple logins of this account can create multiple sessions. In the scenario where multiple different accounts can also log in to the server at the same time, one login of one account can create one session, and if multiple accounts log in to the server respectively, multiple sessions can be created.
[0138] If Bash works at the third layer and the character user interface is provided by the kernel, usually the display device can only display the character user interface of one session at a time. As Figure 6 shown, taking the five logins of the same user as an example, each login session among these five logins corresponds to a character user interface. The sessions of these five logins correspond to character user interface 1 - character user interface 5 respectively. Since the display device usually can only display the character user interface of one session at the same time, as Figure 6As shown, the character user interface 1 currently displayed on the display device can be the user interface of session 1. The user can switch between the character user interfaces of multiple sessions through an input device (such as the shortcut keys of a keyboard). For example, it can be switched to display the character user interface 2. It can be understood that Figure 6 the character user interfaces 1-5 in Figure 6 can also be sessions created by different users logging in.
[0139] In the embodiments of the present application, by changing the implementation logic of Bash, the functions of screen protection and password verification can be respectively implemented for the character user interfaces of multiple created sessions, that is, the functions of screen protection and password verification can be respectively implemented for multiple character user interfaces of Bash. For example, as Figure 6 shown, when the same user logs in five times, the character user interface 1 is currently displayed on the display device. If the idle duration of the character user interface 2 reaches a preset duration (that is, no command is input in the character user interface 2 for more than the preset duration), the character user interface 2 enters the screen saver state. When the user switches to the character user interface 2 through an input device (such as the shortcut keys of a keyboard), since the character user interface 2 is in the screen saver state, the screen saver content is displayed after switching, and a password needs to be entered for verification. Similarly, if the idle duration of the character user interface 3 reaches a preset duration (that is, no command is input in the character user interface 3 for more than the preset duration), the character user interface 3 enters the screen saver state. When the user switches to the character user interface 3 through an input device (such as the shortcut keys of a keyboard), since the character user interface 3 is in the screen saver state, the screen saver content is displayed after switching, and a password needs to be entered for verification. It can be understood that if the idle duration of the character user interface 3 does not reach the preset duration (that is, switch to the character user interface 3 before exceeding the preset duration), the character user interface 3 does not enter the screen saver state. When the user switches to the character user interface 3 through an input device (such as the shortcut keys of a keyboard), the character user interface 3 is displayed, and the user can directly input commands in the character user interface 3 for operation without password verification. It can be understood that the start time of the preset duration of each of the above character user interfaces is based on the completion of the previous command input in the character user interface as the start time. The start times of different character user interfaces can be different.
[0140] In some implementations, the screensaver content and / or verification password of the character user interfaces of the sessions created by different users in the above embodiments are different, while the screensaver content and / or verification password of the character user interfaces of the sessions created by the same user are the same. For example, if the above character user interface 1 and character user interface 2 are created by user 1, and character user interface 3 is created by user 2, then the screensaver content and / or verification password of character user interface 1 and character user interface 2 are the same. The screensaver content and / or verification password of character user interface 3 are different from those of character user interface 1 and character user interface 2.
[0141] In some implementations, the screensaver content and / or verification password of the character user interfaces of different sessions created by the same user in the above embodiments can also be different. For example, the above character user interface 1, character user interface 2, and character user interface 3 are all created by user 1, but the screensaver content and / or verification password among these three character user interfaces are all different.
[0142] It can be seen that by changing the implementation logic of Bash, the present application can implement independent screen protection and password verification for the character user interfaces of multiple sessions. For example, as Figure 6 shown, the screen protection and password verification of character user interface 3 do not affect character user interface 2. Although character user interface 3 enters the screen saver state, as long as character user interface 2 is switched and displayed before the preset duration, there is no need to perform password verification, and instead, the character user interface for entering commands can be directly displayed, and the display content of this character user interface is the content displayed by character user interface 2 before the switch. This is significantly different from the screen protection and password verification of the graphical user interface. For example, for the graphical user interface of a personal computer, as long as the screen saver is entered, all the windows opened in the computer enter the screen saver state.
[0143] Exemplarily, when Bash operates at the third layer, Bash displays a first character user interface, and the first character user interface can be Figure 6 any one of the character user interfaces shown, for example, the first character user interface is character user interface 1. If no command is input to the first character user interface within the preset duration, the first character user interface enters the screen saver state.
[0144] When an interface switching command is received, Bash determines the second character user interface to be displayed. It can be understood that the interface switching command can be received when Bash displays the first character user interface, or can be received after the first character user interface enters the screen saver state. The second character user interface can be, for example, Figure 6The character user interface 2 in it. Further determine whether the second character user interface enters the screensaver state. If the second character user interface enters the screensaver state, the screensaver content needs to be displayed. If the second character user interface does not enter the screensaver state, Bash displays the second character user interface. For example, display the second character user interface.
[0145] If Bash works at the fourth layer, that is, the character user interface of a session is a window simulated by the Shell graphics system, the display device can display the character user interfaces of multiple sessions simultaneously, and the character user interface of one session corresponds to one window. As Figure 7 shown, the display device can display 3 windows, namely Window 1 - Window 3. One window can correspond to the character user interface of one session. For example, Window 1 displays the character user interface 1 of Session 1, Window 2 displays the character user interface 2 of Session 2, and Window 3 displays the character user interface 3 of Session 3.
[0146] In the embodiments of the present application, by changing the implementation logic of Bash, the functions of screen protection and password verification can be respectively implemented for the character user interfaces of multiple created sessions. For example, as Figure 7 shown, if the idle duration of the character user interface 2 reaches the preset duration, the character user interface 2 enters the screensaver state. For the character user interface 1, before the idle duration of the character user interface 1 exceeds the preset duration, the character user interface 1 does not enter the screensaver state. Implementing the present application can independently perform screen protection on the windows of each character user interface. It can be understood that the start time of the preset duration of each of the above character user interfaces is based on the completion of the previous command input in the character user interface as the start time. The start times of different character user interfaces can be different.
[0147] In some implementation manners, the screensaver content and / or verification password of the character user interfaces of the sessions created by different users in the above embodiments are different, while the screensaver content and / or verification password of the character user interfaces of the sessions created by the same user are the same. For example, the above character user interface 1 and character user interface 2 are created by user 1, and the character user interface 3 is created by user 2. Then the screensaver content and / or verification password of the character user interface 1 and character user interface 2 are the same. And the screensaver content and / or verification password of the character user interface 3 are different from those of the character user interface 1 and character user interface 2.
[0148] In some implementation manners, the screensaver content and / or verification password of different sessions of the character user interfaces created by the same user in the above embodiments can also be different. For example, the above character user interface 1, character user interface 2, and character user interface 3 are all created by user 1, but the screensaver content and / or verification password among the 3 character user interfaces are all different.
[0149] Each character user interface as shown in Figure 7 performs screen saver independently, which is significantly different from the graphical user interface. Usually, for the graphical user interface, the entire display device enters the screen saver, rather than performing screen saver independently for each window.
[0150] Exemplarily, when Bash works at the fourth layer, Bash displays the first character user interface of the first session. The first character user interface corresponds to the first window in the graphical user interface. For example, it can be Figure 7 any one of the 3 windows as shown, such as window 1. If there is no command input in the first character user interface of the first session within the first preset duration, the first window enters the screen saver state. For example, window 1 enters the screen saver state, that is, the first character user interface enters the screen saver state.
[0151] Furthermore, the graphical user interface further includes a second window, which corresponds to the second character user interface of the second session. For example, it can be Figure 7 a window other than the first window in , such as window 2. If there is no command input in the second character user interface of the second session within the second preset duration, the second window enters the screen saver state. For example, window 2 enters the screen saver state, that is, the second character user interface enters the screen saver state.
[0152] It should be noted that the above first preset duration and second preset duration can be equal or unequal. If they are unequal, it can be understood that the preset durations of the character user interfaces of different sessions are unequal.
[0153] It should be noted that each technical solution (or each embodiment) of the present application can be implemented independently or can also be implemented in combination based on certain internal connections. The present application does not make any limitations. And various terms and definitions between each embodiment can be mutually referred to. In each embodiment of the present application, different implementation manners can also be implemented in combination or independently.
[0154] Please refer to Figure 8 , which is a schematic structural diagram of a screen saver device provided by an embodiment of the present application. As shown in the figure, the screen saver device includes:
[0155] A display unit 110, configured to display a first character user interface;
[0156] A control unit 120, configured to control the first character user interface to enter the screen saver state when it is determined that there is no command input in the first character user interface within the preset duration;
[0157] Wherein, the screen saver state includes: displaying screen saver content, and switching from the screen saver content to a password verification interface when a trigger operation is detected.
[0158] In a possible implementation, the device further includes:
[0159] A registration unit 130, configured to register a callback function with the operating system;
[0160] A control unit 120, specifically configured to control the first character user interface to enter the screensaver state by invoking the callback function.
[0161] In a possible implementation, the control unit 120 is specifically configured to invoke the callback function and execute the screensaver verification command in the callback function to control the first character user interface to enter the screensaver state.
[0162] In a possible implementation, the device further includes:
[0163] A determination unit 140, configured to determine whether a screensaver verification command is configured in the callback function;
[0164] The control unit 120 is specifically configured to execute the screensaver verification command in the callback function to control the first character user interface to enter the screensaver state when the screensaver verification command is configured in the callback function.
[0165] In a possible implementation, the control unit 120 is further configured to exit the session corresponding to the first character user interface when the screensaver verification command is not configured in the callback function.
[0166] In a possible implementation, if Bash runs at the Shell layer, the device further includes:
[0167] A display unit 110, further configured to determine the second character user interface to be displayed when detecting an interface switching command;
[0168] Determine whether the second character user interface enters the screensaver state;
[0169] If the second character user interface does not enter the screensaver state, display the second character user interface;
[0170] If the second character user interface enters the screensaver state, display the screensaver content.
[0171] In a possible implementation, if Bash runs at the application layer, the first character user interface corresponds to the first window in the graphical user interface;
[0172] The control unit 120 is specifically configured to control the first window to enter the screensaver state.
[0173] In a possible implementation, the graphical user interface further includes a second window, and the second window corresponds to the second character user interface;
[0174] The control unit 120 is further configured to control the second window to enter the screensaver state when Bash determines that there is no command input in the second character user interface within a preset duration.
[0175] In a possible implementation, the first character user interface corresponds to a first session, and the second character user interface corresponds to a second session;
[0176] wherein, the first session and the second session are created by the same user, or the first session and the second session are created by different users.
[0177] In a possible implementation, the device further includes:
[0178] The control unit 120 is further configured to start a timer when the previous command input in the first character user interface is executed, and the timing duration of the timer is a preset duration;
[0179] If no input command is detected in the first character user interface during the running of the timer, it is determined that there is no command input in the first character user interface within the preset duration.
[0180] Please refer to Figure 9 , which is a schematic structural diagram of a computing device provided in an embodiment of the present application. The computing device may include a processor 210 and a memory 220. Among them, the processor 210 is coupled to the memory 220.
[0181] The memory 220 is used to store computer instructions, such as storing screensaver instructions. When the processor 210 executes the computer instructions stored in the memory 220, the steps executed by Bash in the above Figures 4 - 7 embodiment of the screensaver method can be implemented. Details are not described herein again.
[0182] It should be understood that Bash can use an embedded system, such as a Linux system, etc., or can also use a Windows system. The present application does not make a limitation.
[0183] The present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, part or all of the steps described in any one of the above method embodiments can be implemented.
[0184] An embodiment of the present invention further provides a computer program, which includes instructions. When the computer program is executed by a computer, the computer can execute part or all of the steps of any one of the methods for screensaver.
[0185] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0186] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence, because according to this application, certain steps may be able to be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0187] The terms used in the above embodiments are only for the purpose of describing specific embodiments and are not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular forms "a", "an", "the", "above", "said", "this" are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to and includes any and all possible combinations of one or more of the listed items.
[0188] As used in the above embodiments, depending on the context, the term "when..." can be interpreted to mean "if...", or "after...", or "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining...", or "in response to determining...", or "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0189] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0190] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by a computer program instructing relevant hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes: various media that can store program codes such as ROM or random access memory RAM, magnetic disks, or optical discs.
Claims
1. A screen saver method for a character interface, characterized in that Including: Display a first character user interface corresponding to a first session based on Bash; Detect command input in the first character interface; If there is no command input in the first character user interface within a first preset duration, call a callback function through the Bash, and determine whether the callback function includes a screen saver verification command; If the callback function includes the screen saver verification command, execute the screen saver verification command in the callback function to control the first character user interface to enter the screen saver interface; wherein, the callback function is registered with the operating system through the Bash; the callback function is used to determine that the computing device enters the screen saver interface or exits the first session; In response to a trigger operation on the screen saver interface, display an authentication interface; If the callback function does not include the screen saver verification command, exit the session corresponding to the first character user interface.
2. The method according to claim 1, characterized in that The method further includes: When a user interface switching command is detected, determine a second character user interface to be displayed; Determine whether the second character user interface enters the screen saver interface; If the second character user interface does not enter the screen saver interface, display the second character user interface; If the second character user interface enters the screen saver interface, display the screen saver interface.
3. The method according to claim 1, characterized in that The display interface includes a first session and a second session; wherein, the first session corresponds to the first character user interface; the second session corresponds to the second character user interface; If it is determined that there is no command input in the second character user interface within a second preset duration, control the second character user interface to enter the screen saver interface.
4. The method according to claim 3, wherein The first session and the second session are created by the same user; or, the first session and the second session are created by different users.
5. The method according to any one of claims 1-4, characterized in that, Before controlling the first character user interface to enter the screen saver interface, the method further includes: After executing the command input in the first character user interface, start a timer, and the timing duration of the timer is the first preset duration; If no command input in the first character user interface is detected during the running of the timer, determine that there is no command input in the first character user interface within the preset duration.
6. A computing device, characterized in that, The computing device includes a processor and a memory, the processor is coupled to the memory; the memory is used to store a computer program, the computer program includes program instructions, and the processor calls the program instructions to make the computing device execute the method according to any one of claims 1-5.
Citation Information
Patent Citations
Screen protection setting method, intelligent television and computer readable storage medium
CN108900912A
Desktop screen locking method and device, storage medium and computer equipment
CN114265660A