Display device and background application management methods
By setting a preset detection cycle in the display device, the probability of application usage and the proportion of system resources are calculated to determine whether to keep the application running in the background. This solves the problem of long restart time after switching applications, and improves user experience and system efficiency.
Patent Information
- Application Number
- CN202411102627.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In existing technologies, display devices take a long time to restart after an application is switched from the foreground to the background, which affects the user experience.
By setting a preset detection cycle in the display device, the probability of application usage and the proportion of system resources are calculated to determine whether the application should be kept running in the background, thus avoiding unnecessary cold starts.
It reduces application cold start time, improves user experience, and optimizes system resource utilization.
Smart Images

Figure CN119182962B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display device technology, and in particular to a display device and a method for managing background applications. Background Technology
[0002] Display devices are intelligent devices capable of presenting a user interface and supporting user interaction. Taking smart TVs as an example, smart TVs are television products based on Internet application technology, possessing an open operating system and chip, an open application platform, and enabling two-way human-computer interaction. They integrate multiple functions such as audio-visual entertainment and data to meet diverse and personalized user needs. Applications can be installed and run on display devices. Users can control the display device to launch and run applications in the foreground by selecting applications of interest.
[0003] When an application is running in the foreground on the display device, the user can control the device to switch the currently displayed interface to the home screen or another interface. At this time, the running application switches from foreground to background running state. When the application is running in the background, the application process will automatically exit.
[0004] However, since the application process has already exited, if the user restarts the application after switching the control display device to another interface, it will increase the startup time and reduce the user experience. Summary of the Invention
[0005] This application provides a display device and background application management method to solve the problem of high time consumption when restarting an application after it has been exited from the display device.
[0006] In a first aspect, some embodiments of this application provide a display device, including: a display, a memory, and a controller.
[0007] The display is configured to display a user interface; the memory is configured to store application runtime information; and the controller is configured to:
[0008] In response to user input commands to switch interfaces, the application that is currently running in the foreground is switched to running in the background.
[0009] Obtain the switching time point and the preset detection period, wherein the preset detection period includes a preset number of detection time points;
[0010] The number of times the application runs in the foreground running state at the detection time point is traversed within the preset detection period;
[0011] Calculate the application usage probability; wherein, the application usage probability is equal to the ratio of the number of times the foreground runs to the preset number;
[0012] If the application's usage probability is less than or equal to a first threshold, then the application will stop running.
[0013] If the application usage probability is greater than a first threshold, then the system resource ratio of the display device and the memory usage value of the application are obtained; and when the system resource ratio is greater than a second threshold or the memory usage value of the application is greater than a third threshold, the application is stopped from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, the application is controlled to maintain the background running state; wherein, the system resource ratio is the ratio of the system memory value used by the display device to the total system memory value.
[0014] Secondly, some embodiments of this application also provide a background application management method, applied to the display device provided in the first aspect, wherein the display device includes: a display, a memory, and a controller. The method includes:
[0015] In response to user input commands to switch interfaces, the application that is currently running in the foreground is switched to running in the background.
[0016] Obtain the switching time point and the preset detection period, wherein the preset detection period includes a preset number of detection time points;
[0017] The number of times the application runs in the foreground running state at the detection time point is traversed within the preset detection period;
[0018] Calculate the application usage probability; wherein, the application usage probability is equal to the ratio of the number of times the foreground runs to the preset number;
[0019] If the application's usage probability is less than or equal to a first threshold, then the application will stop running.
[0020] If the application usage probability is greater than a first threshold, then the system resource ratio of the display device and the memory usage value of the application are obtained; and when the system resource ratio is greater than a second threshold or the memory usage value of the application is greater than a third threshold, the application is stopped from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, the application is controlled to maintain the background running state; wherein, the system resource ratio is the ratio of the system memory value used by the display device to the total system memory value.
[0021] As can be seen from the above technical solutions, some embodiments of this application provide a display device and background application management method. The method can respond to a user-inputted interface switching command to switch an application currently running in the foreground to running in the background. It obtains the switching time point and a preset detection period. It iterates through the number of times the application runs in the foreground at the detection time point within the preset detection period. It also calculates the application usage probability. If the application usage probability is less than or equal to a first threshold, the application stops running; if the application usage probability is greater than the first threshold, it obtains the system resource ratio of the display device and the application's memory usage value. When the system resource ratio is greater than a second threshold or the application's memory usage value is greater than a third threshold, the application stops running; when the system resource ratio is less than or equal to the second threshold and the application's memory usage value is less than or equal to the third threshold, the application is kept running in the background. This method, by jointly judging the application usage probability and resource usage, determines whether to stop the application when it switches to the background running state, thus solving the problem of high time consumption when restarting an application after it has exited a currently running application on the display device. Attached Figure Description
[0022] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application;
[0024] Figure 2 This is a schematic diagram of the hardware configuration of a display device provided in some embodiments of this application;
[0025] Figure 3 This is a schematic diagram of the software configuration of a display device provided in some embodiments of this application;
[0026] Figure 4 This application provides schematic diagrams illustrating user interface switching for some embodiments.
[0027] Figure 5 This is a schematic diagram of the display device interface switching process provided in some embodiments of this application;
[0028] Figure 6 Schematic diagram of a background application management method provided in some embodiments of this application;
[0029] Figure 7 Timing diagrams of background application management methods provided in some embodiments of this application;
[0030] Figure 8 This application provides a schematic diagram illustrating a method for obtaining the foreground runtime of an application using a display device, as illustrated in some embodiments of the present application.
[0031] Figure 9 A schematic diagram of the foreground running time period of a first application provided for some embodiments of this application;
[0032] Figure 10 A schematic diagram illustrating a method for traversing the number of foreground runs within a preset detection period, as provided in some embodiments of this application;
[0033] Figure 11 A schematic diagram illustrating a method for determining whether to maintain the background running state of an application based on the proportion of system resources and the memory usage value of the application, provided in some embodiments of this application;
[0034] Figure 12 This is an overall flowchart of a background application management method for a display device provided in some embodiments of this application. Detailed Implementation
[0035] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0036] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0037] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0038] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0039] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0040] In this embodiment, the display device 200 generally refers to a device with screen display and data processing capabilities. For example, the display device 200 includes, but is not limited to, smart TVs, mobile terminals, computers, monitors, advertising screens, wearable devices, virtual reality devices, augmented reality devices, etc.
[0041] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application. For example... Figure 1 As shown, a user can operate the display device 200 via touch operation, a mobile terminal 300, and a control device 100. The control device 100 receives user input commands and converts them into control commands that the display device 200 can recognize and respond to. For example, the control device 100 can be a remote control, a stylus, a gamepad, etc.
[0042] The mobile terminal 300 can function as a control device for human-computer interaction between the user and the display device 200. It can also function as a communication device for establishing a communication connection with the display device 200 and exchanging data. In some embodiments, the mobile terminal 300 can have software applications installed on it and communicate with the display device 200 via network communication protocols to achieve one-to-one control and data communication. Furthermore, it can transmit audio and video content displayed on the mobile terminal 300 to the display device 200 for synchronized display.
[0043] In some embodiments, the mobile terminal 300 or other electronic devices may also simulate the functions of the control device 100 by running an application that controls the display device 200.
[0044] like Figure 1 The diagram also shows that the display device 200 communicates with the server 400 via various communication methods. This allows the display device 200 to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0045] Display device 200 can provide broadcast television reception function, and can also be equipped with intelligent network television function that provides computer support, including but not limited to network television, smart television, Internet Protocol television (IPTV), etc.
[0046] Figure 2 Provided for some embodiments of this application Figure 1 Hardware configuration block diagram of display device 200.
[0047] In some embodiments, the display device 200 may include at least one of a tuner 210, a communication device 220, a detector 230, a device interface 240, a controller 250, a display 260, an audio output device 270, a memory, a power supply, and a user input interface.
[0048] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0049] In some embodiments, the display 260 includes display function components for presenting images and driving components for driving image display. The display 260 is used to receive and display image signals output from the controller 250. For example, the display 260 can be used to display video content, image content, menu control interface components, and user control UI interfaces, etc.
[0050] In some embodiments, the communication device 220 is a component used to communicate with external devices or the server 400 according to various communication protocol types. The display device 200 may have multiple communication devices 220 depending on the supported communication methods. For example, when the display device 200 supports wireless network communication, it may have a communication device 220 with WiFi functionality. When the display device 200 supports Bluetooth connectivity, it needs to have a communication device 220 with Bluetooth functionality.
[0051] The communication device 220 enables the display device 200 to communicate with external devices or the server 400 via wireless or wired connections. Wired connections utilize data cables, interfaces, or other components to connect the display device 200 to external devices. Wireless connections utilize wireless signals or wireless networks. The display device 200 can directly establish a connection with external devices or indirectly through gateways, routers, or other connection devices.
[0052] In some embodiments, the controller 250 may include at least one of a central processing unit, a video processor, an audio processor, a graphics processor, and a power processor, and a first to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200.
[0053] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0054] In some embodiments, a user can input user commands through a graphical user interface (GUI) displayed on a display 260, and the user input interface receives user input commands through the graphical user interface (GUI).
[0055] In some embodiments, the audio output device 270 can be a built-in speaker of the display device 200 or an external audio output device connected to the display device 200. For the external audio output device connected to the display device 200, the display device 200 may also be provided with an external audio output terminal, through which the audio output device can be connected to the display device 200 to output sound from the display device 200.
[0056] In some embodiments, the user input interface 280 can be used to receive instructions from user input.
[0057] In some embodiments, to enable user interaction, the display device 200 may run an operating system. The operating system is a computer program used to manage and control the hardware and software resources of the display device 200. The operating system can control the display device 200 to provide a user interface; for example, the operating system can directly control the display device 200 to provide a user interface, or it can provide a user interface by running an application. The operating system also allows users to interact with the display device 200.
[0058] It should be noted that the operating system can be a native operating system based on a specific operating platform, a third-party operating system that is deeply customized based on a specific operating platform, or an independent operating system specifically developed for the display device 200.
[0059] An operating system can be divided into different modules or levels based on the functions it implements, for example... Figure 3 As shown, in some embodiments, the system is divided into four layers, from top to bottom: the Applications layer (referred to as the "Application Layer"), the Application Framework layer (referred to as the "Framework Layer"), the System Library layer, and the Kernel layer.
[0060] In some embodiments, the application layer provides services and interfaces for applications, enabling the display device 200 to run applications and interact with the user based on the applications. The application layer may contain at least one application, which may be a built-in Windows program, system settings program, or clock program of the operating system; or it may be an application developed by a third-party developer. In specific implementations, the application packages in the application layer are not limited to the examples above.
[0061] The framework layer provides application programming interfaces (APIs) and a programming framework for applications. The application framework layer includes predefined functions. It acts as a central processing unit, determining the actions taken by applications within the application layer. Through the API, applications can access system resources and obtain system services during execution.
[0062] like Figure 3 As shown, the application framework layer in this embodiment includes a view system, managers, and content providers. The view system designs and implements the application's interface and interactions, and includes lists, grids, text boxes, and buttons. The managers include at least one of the following modules: an activity manager for interacting with all running activities in the system; a location manager for providing system services or applications with access to system location services; a package manager for retrieving various information related to application packages currently installed on the device; a notification manager for controlling the display and clearing of notification messages; and a window manager for managing icons, windows, toolbars, wallpapers, and desktop widgets on the user interface.
[0063] In some embodiments, the Activity Manager manages the lifecycle of individual applications and common navigation and back functions, such as controlling application exit, opening, and back actions. The Window Manager manages all window programs, such as obtaining the screen size, determining if a status bar is present, locking the screen, capturing the screen, and controlling changes to the display window, such as shrinking the display window, shaking the display, or distorting the display.
[0064] In some embodiments, the system runtime library layer can provide support for the framework layer. When the framework layer is used, the operating system runs the instruction library contained in the system runtime library layer, such as the C / C++ instruction library, to implement the functions to be performed by the framework layer.
[0065] In some embodiments, the kernel layer is a functional layer situated between the hardware and software of the display device 200. The kernel layer can implement functions such as hardware abstraction, multitasking, and memory management. For example, ... Figure 3 As shown, hardware drivers can be configured in the kernel layer. The drivers included in the kernel layer can be at least one of the following: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0066] It should be noted that the above examples are merely a simple division of operating system functions and do not limit the specific form of the operating system of the display device 200 in this application embodiment. Depending on the function of the display device, the type of operating system, and other factors, the number of levels and the specific level type of the operating system may be expressed in other forms.
[0067] In some embodiments, the display device 200 can be equipped with various applications with different functions. These applications can interact with the user via remote control, voice, touch operation, etc., enabling the display device 200 to provide functions such as audiovisual entertainment, information retrieval, life services, and education. For example, a user can send an interaction command to the display device 200 through the control device 100. During the input of the interaction command, the user first presses a button on the control device 100. The control device 100 then generates a key command containing the key value for the pressed button and sends the key command to the display device 200 via wireless transmission methods such as Bluetooth or infrared. The display device 200 responds to the received key command by parsing the key value from the key command, querying the corresponding control command according to the control system's key configuration table, and then executing the queried control command to perform the command response, thereby realizing the interaction between the control device 100 and the applications installed on the display device 200.
[0068] For example, a user can issue interactive commands to the display device 200 via voice. When the user speaks an interactive command, such as "Open application A" or "Fast forward to the current program," the microphone of the display device 200 converts the sound signal into an electrical signal, which is then processed and transmitted to the control system of the display device 200. The control system executes the corresponding operation according to the interactive command, such as opening application A or performing a fast forward operation on the current application interface, thereby realizing the interaction between the user and the applications installed on the display device 200.
[0069] In some embodiments, applications installed on the display device 200 exist in two states: started and not started. Users can control the display device 200 to launch the corresponding application by sending an application launch command. For example, a user can move the focus cursor to the "Music Application" icon on the control device 100 and press the confirmation button on the control device 100 to select the "Music Application" and send a command to launch it. At this time, the display device 200 controls the "Music Application" process to start and generates the "Music Application" interface. The display 260 shows the "Music Application" interface, indicating that the "Music Application" has been launched.
[0070] In some embodiments, the applications launched on the display device 200 include foreground running states and background running states, i.e., foreground applications and background applications. It should be understood that the display 260 can display a single user interface. When the user interface displayed on the display 260 is an application interface, it indicates that the application is in the foreground running state and is a foreground application; while among the several applications launched on the display device 200, those whose application interfaces are not displayed on the display 260 are in the background running state and are background applications. For example, if there are three launched applications on the display device 200, namely "First Application," "Second Application," and "Third Application," and the user interface displayed on the display 260 is the running interface of "First Application," then "First Application" is a foreground application, and "Second Application" and "Third Application" are background applications.
[0071] In some embodiments, the startup methods for applications installed on the display device 200 include cold start and warm start. Cold start means that the display device 200 controls the application to start and initiate the application process when the application is not running; that is, the display device 200 needs to load all configuration files and data required for the application to start. Warm start means that the display device 200 switches the application from a background running state to a foreground running state while retaining some of the application's configuration files and data. It should be understood that because cold start requires loading all of the application's configuration files and data, cold start takes longer than warm start.
[0072] Based on the aforementioned display device 200, the display device 200 can respond to control commands input by the user to perform corresponding operations. For example, the display device 200 can respond to an interface switching command to switch the interface currently displayed on the monitor 260 to another interface indicated by the interface switching command. Figure 4 As shown, the initial interface displayed on the monitor 260 is the running interface of the "first application". When the user inputs an interface switching command to the display device 200 through the control device 100 to return to the home page interface, the user interface displayed on the monitor 260 switches from the running interface of the "first application" to the home page interface.
[0073] In some embodiments, after the display device 200 performs an interface switching operation, the switched interface is displayed on the monitor 260, while the application that was displaying a running interface on the monitor 260 before the interface switching operation is switched to a background application. To reduce the resource consumption of background applications on the system memory of the display device 200, the display device 200 can control the background application to terminate its process, that is, switch it to an unstarted state.
[0074] In some embodiments, such as Figure 5 As shown, the process by which the user controls the display device 200 to switch the foreground application to a background application and to terminate the background application's process is as follows: If the user interface displayed on the monitor 260 is the running interface of the "first application," then the "first application" is the foreground application. At this time, the user inputs an interface switching command, and the display device 200 responds by controlling the monitor 260 to switch the interface and terminating the "first application's" process, switching the "first application" to an inactive state. When the user inputs the "first application" start command again, the display device 200 receives the command and controls the "first application" to start again. However, since the display device 200 has already terminated the "first application's" process when it first receives the user's interface switching command, if the user immediately controls the display device 200 to restart the "first application" via the control device 100 after exiting the "first application," then the "first application" will start in a cold start mode. Cold start mode takes a long time and affects the user experience.
[0075] In some embodiments, the display device 200 can also manage applications that have been switched to the background running state according to the background application management method described below. This method determines, through specific conditions, that an application does not need to immediately terminate its process when switched to the background running state, thereby solving the problem of high time consumption when restarting an application after it has exited the application currently running on the display device 200. To implement the background application management method, the display device 200 should include at least a display 260, a memory, and a controller 250. The display 260 is configured to display the user interface; the memory is configured to store application running information; such as... Figure 6 As shown, controller 250 is configured to execute the program steps corresponding to the background application management method, including the following:
[0076] S100: In response to the user's input interface switching command, switch the application currently running in the foreground to running in the background.
[0077] In some embodiments, the display device 200 can respond to a user-inputted interface switching command, switch the foreground application to a background application, and manage the background application. A timing diagram of the display device 200 executing the background application management method is shown below. Figure 7 As shown. First, the display device 200 receives a user-inputted interface switching command, switches the application from a foreground running state to a background running state, and controls the display 260 to display the switched user interface. For example, if the display device 200's display 260 shows the running interface of "First Application," and the user inputs an interface switching command to control the display device 200 to switch the user interface displayed on the display 260 to the home screen, then the display device 200 controls "First Application" to switch to a background running state and controls the display 260 to display the home screen.
[0078] S200: Obtain the switching time point and preset detection cycle.
[0079] In some embodiments, when an application is switched to a background running state, the display device 200 can obtain the switching time point and a preset detection period of the application to calculate the number of times the application is in the foreground running state at the switching time point within the preset detection period. For example, the preset detection period of the display device 200 is set to 7 calendar days, and the switching time point when the "first application" is switched from the foreground running state to the background running state is 12:00.
[0080] It should be understood that the preset testing cycle can be set according to the user's usage habits of the display device 200, and can also be 3 working days, 15 working days, etc., but no specific limitation is made in this application embodiment.
[0081] In some embodiments, the preset detection period of the display device 200 includes a preset number of unit detection periods and a preset number of detection time points. A unit detection period represents a detection period obtained by equally dividing the preset detection period into time units, and each unit detection period includes one detection time point. It should be understood that since the data that the display device 200 needs to detect is the number of times the application is in the foreground running state at the switching time point within the preset detection period, the detection time point in each unit detection period is the switching time point. For example, if the preset detection period of the display device 200 is 7 calendar days, dividing the preset detection period into 7 equal detection periods (i.e., a preset number of 7), the number of unit detection periods is 7, each unit detection period is 1 calendar day, and the number of detection time points is also 7. When the display device 200 responds to a user-inputted interface switching command and switches the application to the background running state at 12:00, the detection time point in each unit detection period is 12:00.
[0082] S300: Traverses the number of foreground runs within the preset detection period, applied at the detection time point when the foreground is in the foreground running state.
[0083] In some embodiments, after obtaining the application switching time point, the display device 200 calculates the application usage probability by iterating through the number of times the application is in the foreground running state at the detection time point within a preset detection period, and uses this probability to determine whether it is necessary to control the application to terminate its process.
[0084] In some embodiments, before iterating through the number of times the application is in the foreground running state at the detection time point within a preset detection period, the display device 200 needs to obtain the time period during which the application is in the foreground running state within each unit detection period, i.e. the foreground running time period, to determine whether the application is in the foreground running state at the detection time point.
[0085] like Figure 8 As shown, to obtain the foreground running time period, the display device 200 can first control the application to start, and obtain and record the application's start time within a unit detection cycle; when the display device 200 receives the user's input interface switching command, the display device 200 controls the application to stop, and obtains and records the application's stop time within a unit detection cycle; the time period between the start time and stop time within the unit detection cycle is marked as the application's foreground running time period; after obtaining the foreground running time period, the display device 200 controls the memory to store the application's foreground running time period for subsequent determination of whether the application is in the foreground running state at the detection time point.
[0086] It should be noted that an application can include multiple foreground running time periods within a unit detection cycle. For example, when a user controls the display device 200 to start and exit the "first application" for the first time, the display device 200 has already stored the first foreground running time period of the "first application" within the unit detection cycle in its memory. If the user controls the "first application" to start and exit again, the display device 200 can obtain the new start time and stop time, and use the time period between the new start time and stop time as the second foreground running time period of the "first application" within the unit detection cycle.
[0087] In some embodiments, the foreground running time periods of applications stored in the memory of the display device 200 within a preset detection period can be highlighted. For example, if the preset detection period of the display device 200 is set to 7 calendar days, and the unit detection period is 1 calendar day, the foreground running time period of the "first application" detected by the display device 200 within the preset detection period is as follows: Figure 9As shown in the diagram. Specifically, the front-end operation time for "Application 1" in the first unit testing cycle is 6:00-12:00 and 18:00-22:00; the front-end operation time for "Application 1" in the second unit testing cycle is 12:00-18:00; the front-end operation time for "Application 1" in the third unit testing cycle is 6:00-12:00; the front-end operation time for "Application 1" in the fourth unit testing cycle is 16:00-22:00; the front-end operation time for "Application 1" in the fifth unit testing cycle is 12:00-18:00; the front-end operation time for "Application 1" in the sixth unit testing cycle is 6:00-12:00 and 14:00-20:00; and the front-end operation time for "Application 1" in the seventh unit testing cycle is 14:00-20:00.
[0088] In some embodiments, once the memory of the display device 200 has stored the foreground running time period of the application within a preset detection period, the number of foreground runs of the application within the preset detection period can be iterated. For example... Figure 10 As shown, the display device 200 iterates through the number of foreground runs of the application within a preset detection period, first setting the number of foreground runs to an initial value (S1001). It then obtains the unit detection period within the preset detection period (S1002). Next, it extracts the foreground run time period of the application within the unit detection period (S1003). If the switching time point falls within the foreground run time period, it increments the number of foreground runs by one (S1004).
[0089] It should be understood that, in order to improve the accuracy of the display device 200 in calculating the probability of application use, the display device 200 needs to determine whether the switching time point in each unit detection cycle within the preset detection cycle is within the foreground running time period, and accumulate the number of foreground runs that meet the conditions.
[0090] For example, the preset detection period of display device 200 is 7 calendar days, the unit detection period is 1 calendar day, the initial value of the number of foreground runs is 0, and the foreground run time of "first application" stored in the memory of display device 200 within the preset detection period is as follows: Figure 9 As shown. If the user-controlled display device 200 switches "First Application" to the background running state at 16:00, then according to... Figure 9The displayed foreground running time periods in the preset detection cycles show that: For the first unit detection cycle, the foreground running time periods are 6:00-12:00 and 18:00-22:00. The switching time point 16:00 is outside these periods, so the foreground running count remains unchanged at 0. For the second unit detection cycle, the foreground running time period is 12:00-18:00. The switching time point 16:00 is within these periods, so the foreground running count increases by one to 1. For the third unit detection cycle, the foreground running time period is 6:00-12:00. The switching time point 16:00 is outside these periods, so the foreground running count remains unchanged at 1. For the fourth unit detection cycle, the foreground running time period is 16:00-18:00-22:00. From 00:00 to 22:00, if the switchover time point 16:00 falls within the foreground operation period, the foreground operation count is incremented by one, resulting in 2. For the fifth unit detection cycle, the foreground operation period is from 12:00 to 18:00. If the switchover time point 16:00 falls within the foreground operation period, the foreground operation count is incremented by one, resulting in 3. For the sixth unit detection cycle, the foreground operation periods are from 6:00 to 12:00 and from 14:00 to 20:00. If the switchover time point 16:00 falls within the foreground operation period, the foreground operation count is incremented by one, resulting in 4. For the seventh unit detection cycle, the foreground operation period is from 14:00 to 20:00. If the switchover time point 16:00 falls within the foreground operation period, the foreground operation count is incremented by one, resulting in 5.
[0091] S400: Calculate the probability of application usage.
[0092] In some embodiments, after obtaining the number of foreground runs of an application within a preset detection period, the display device 200 can calculate the application usage probability based on the number of foreground runs and a preset quantity. The application usage probability represents the probability that the application is in the foreground running state in all unit detection periods within the preset detection period at the switching time point. Since the preset quantity is the number of unit detection periods within the preset detection period, the application usage probability is equal to the ratio of the number of foreground runs to the preset quantity. For example, if the switching time point of the "first application" is 16:00, and the foreground running time period of the "first application" within the preset detection period stored in the memory of the display device 200 is as follows... Figure 9 As shown, the "First Application" runs in the foreground 5 times. And by... Figure 9 As we know, the preset quantity is 7, so the probability of the "first application" being used at the switching time point of 16:00 is 5 / 7≈71.4%.
[0093] S500: If the application usage probability is less than or equal to the first threshold, then stop running the application.
[0094] In some embodiments, after calculating the application usage probability, the display device 200 can determine whether to maintain the application's background running state after it has been switched to a background running state. If the application usage probability is less than or equal to a first threshold, it means that the user is unlikely to send an application launch command again at the switching time, making it less likely that the application will switch to a foreground running state. In this case, it is not necessary to maintain the application's background running state; instead, the application process is terminated to reduce the application's consumption of system resources on the display device 200 and improve the smoothness of the display device 200. For example, if the first threshold is 70%, and the application usage probability of the "first application" calculated by the display device 200 within a preset detection period is 65%, that is, the application usage probability is less than the first threshold, then the display device 200 controls the "first application" process to terminate.
[0095] S600: If the application usage probability is greater than the first threshold, obtain the system resource ratio of the display device and the memory usage value of the application; and when the system resource ratio is greater than the second threshold or the memory usage value of the application is greater than the third threshold, stop the application from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, control the application to keep running in the background.
[0096] In some embodiments, if the application usage probability calculated by the display device 200 is greater than a first threshold, it indicates a high probability that the user will send an application launch command again at the switching time point, controlling the application to switch to the foreground running state. However, since the system memory of the display device 200 is limited, maintaining the background running state of the application requires consuming the system memory of the display device 200. Therefore, determining whether to maintain the background running state of the application cannot be based solely on the application usage probability; it also requires a joint judgment based on the system resource ratio of the display device 200 and the application's memory usage value.
[0097] It should be noted that the moment to determine whether an application needs to remain in the background is the instant the application is switched from the foreground to the background. Therefore, the display device 200 needs to obtain the system resource ratio and the application's memory usage value at the same time the application is switched to the background.
[0098] In some embodiments, the method for obtaining the system resource ratio and application memory usage of the display device 200 includes: in response to a user-inputted application exit command, initiating a memory detection process; detecting the system memory used by the display device 200, the total system memory of the display device, and the application memory usage through the memory detection process; calculating the ratio of the system memory used by the display device 200 to the total system memory to obtain the system resource ratio; and storing the system resource ratio and application memory usage in memory. For example, in response to a user-inputted command to exit "the first application," the display device 200 detects through the memory detection process that the system memory used by the display device 200 is 5G, the total system memory is 8G, and the memory usage of "the first application" is 0.3G. The display device 200 then calculates the system resource ratio as 5 / 8 = 62.5%, and stores the system resource ratio of 62.5% and the memory usage of "the first application" of 0.3G in memory.
[0099] In some embodiments, when the display device 200 obtains the system resource ratio and the application's memory usage values, it can determine whether the application needs to remain running in the background based on these values. For example... Figure 11 As shown, the specific method by which the display device 200 determines whether the application needs to remain running in the background based on the system resource ratio and the application's memory usage is as follows:
[0100] S1101: Obtain the system resource percentage, the second threshold, the application's memory usage value, and the third threshold.
[0101] In some embodiments, when the display device 200 determines whether to maintain the background running state of an application based on the system resource ratio and the application's memory usage, it first needs to obtain a second threshold, a third threshold, the system resource ratio of the display device 200 when the application is switched to the background running state, and the application's memory usage value from the memory. For example, when the "first application" is switched to the background running state, the system resource ratio of the display device 200 stored in the memory is 50%, the memory usage value of the "first application" is 0.5G, the second threshold is 70%, and the third threshold is 0.8G.
[0102] S1102: Determine whether the system resource ratio is less than or equal to the second threshold and the application's memory usage is less than or equal to the third threshold.
[0103] In some embodiments, to improve the smoothness of the display device 200's operation, it is necessary to keep the system resource ratio of the display device 200 no greater than a second threshold; to avoid problems such as memory leaks caused by background applications, it is necessary to keep the memory usage of background applications no greater than a third threshold. Therefore, after the display device 200 obtains the system resource ratio, the second threshold, the application's memory usage, and the third threshold, it needs to determine whether the two conditions—that the system resource ratio is less than or equal to the second threshold and that the application's memory usage is less than or equal to the third threshold—are simultaneously met.
[0104] S1103: If the system resource percentage is less than or equal to the second threshold and the application's memory usage is less than or equal to the third threshold, then the application will be automatically exited to prevent it from exiting automatically.
[0105] In some embodiments, if the system resource usage percentage is less than or equal to a second threshold and the application's memory usage is less than or equal to a third threshold (i.e., both conditions are met simultaneously), it indicates that the system resource usage percentage of the display device 200 is within a reasonable range, and the application is running normally in the background without memory leaks or other issues. In this case, the display device 200 can intercept the automatic exit behavior of the background application to stop it from automatically exiting and keep it running in the background. At this point, if the user sends a command to start the application again, the display device 200 can control the application to start quickly, reducing processing time.
[0106] For example, in response to a user-inputted interface switching command, display device 200 controls the "first application" to switch to a background running state. If display device 200 calculates that the application usage probability of the "first application" at the switching time 16:00 is 72%, which is greater than the first threshold of 70%, then it continues to obtain the system resource usage ratio of display device 200 at the switching time: 50%, which is less than the second threshold of 60%, and the memory usage of the "first application" is 0.3G, which is less than the third threshold of 0.5G. Therefore, display device 200 intercepts the automatic exit behavior of the "first application," keeping the "first application" running in the background.
[0107] S1104: If the system resource usage exceeds the second threshold or the application's memory usage exceeds the third threshold, then control the application to automatically terminate its process.
[0108] In some embodiments, if the system resource ratio is greater than the second threshold or the application's memory usage is greater than the third threshold, that is, if the two conditions are not met at the same time, it indicates that the system resource ratio of the display device 200 exceeds a reasonable range, or the application has problems such as memory leaks. Therefore, the display device 200 needs to control the application to automatically terminate the process in order to improve the smoothness of the display device 200.
[0109] For example, in response to a user's input interface switching command, display device 200 controls the "second application" to switch to background operation. If display device 200 calculates that the application usage probability of the "second application" at the switching time 12:00 is 75%, which is greater than the first threshold of 70%, then it continues to obtain the system resource usage of display device 200 at the switching time. If the system resource usage is 80%, which is greater than the second threshold of 60%, and the memory usage of the "second application" is 0.3G, which is less than the third threshold of 0.5G, then display device 200 will control the "second application" to automatically terminate its process.
[0110] For example, in response to a user's input interface switching command, display device 200 controls the "third application" to switch to background operation. If display device 200 calculates that the application usage probability of the "third application" at the switching time 14:00 is 73%, which is greater than the first threshold of 70%, then it continues to obtain the system resource usage percentage of display device 200 at the switching time, which is 30%, less than the second threshold of 60%, while the memory usage of the "third application" is 0.8G, which is greater than the third threshold of 0.5G. At this time, display device 200 will control the "third application" to automatically terminate its process.
[0111] In some embodiments, after the display device 200 controls the background application to remain running in the background, it can generate a successful interception notification, generate a prompt interface based on the successful interception notification, and control the display 260 to display the prompt interface to remind the user that the application is still running in the background. For example, in response to a user's input interface switching command, the display device 200 controls the "first application" to switch to a background running state, and after jointly judging based on the application usage probability, system resource ratio, and application memory usage value, controls the "first application" to remain running in the background. Then, the display device 200 generates a "successful interception" notification, generates a pop-up window with the words "successful interception" based on the "successful interception" notification, and finally displays the pop-up window on the display 260.
[0112] In some embodiments, after receiving an interface switching command input by the user based on the application's running interface, and responding to the interface switching command by controlling the display 260 to change the display interface and controlling the background application to remain running in the background, the display device 200 also releases the network resources, file resources, and device resources of the background application, and saves the application data of the background application. This achieves the goal of maintaining the background application in the background while reducing the resource consumption of the background application, lowering the time required to restart the background application, and improving the smoothness of the display device 200.
[0113] In some embodiments, the display device 200 also continuously monitors the used system memory value. If the used system memory value of the display device 200 is greater than or equal to a fourth threshold, a resource reclamation process is initiated. The resource reclamation process detects inactive applications, which are applications running in the background on the display device 200 with an activity level less than a fifth threshold. The process then stops running inactive applications. By terminating the processes of inactive applications, the used system memory value of the display device 200 is reduced, improving the smoothness of the display device 200.
[0114] For example, if the fourth threshold is 7G and the fifth threshold is 40%, and the display device 200 detects that the used system memory is 7.5G, then it starts a resource reclamation process. Through the resource reclamation process, it detects inactive background applications, i.e. "third applications", that interact with the display device 200 at a frequency of less than 40%, and stops running the "third applications".
[0115] In some embodiments, the process of detecting inactive applications by the display device 200 includes: iterating through the activity levels of background applications in the display device 200; if the activity level of a background application is less than a fifth threshold, then the background application is marked as an inactive application. For example, the background applications in the display device 200 include a "second application" and a "third application," and the fifth threshold is 40%. The activity levels of the "second application" and the "third application" are detected respectively. If the activity level of the "second application" is 45%, which is greater than 40%, then the "second application" is marked as an active application; if the activity level of the "third application" is 35%, which is less than 40%, then the "third application" is marked as an inactive application.
[0116] In some embodiments, the display device 200 responds to a user-inputted interface switching command, switches the application to a background running state, and performs a background application management method on the background application. The overall process is as follows: Figure 12 As shown. First, the display device 200 responds to the user's input application launch command, starts the application process, and records the application launch time; then, responds to the user's input interface switching command, switches the foreground application to the background application, and controls the display 260 to display the switched user interface; when the background application starts its automatic exit process, it obtains the application usage probability and determines whether the application usage probability is greater than a first threshold. If the application usage probability is less than or equal to the first threshold, it controls the background application to exit automatically; if the application usage probability is greater than the first threshold, it continues to obtain the system resource ratio and the application's memory usage value; if the system resource ratio is less than or equal to a second threshold and the application's memory usage value is less than or equal to a third threshold, it intercepts the background application's automatic exit process and maintains the background running state of the background application; otherwise, it controls the background application to exit automatically.
[0117] By adopting the above-mentioned background application management method, the secondary startup speed of frequently used applications can be improved and the time consumption reduced. The table below shows the time consumption of "First Application", "Second Application" and "Third Application" for 5 startups on display device 200 with and without the background application management method.
[0118]
[0119] As can be seen from the table above, the startup time of the "first application", "second application" and "third application" on the display device 200 using the background application management method is lower than the startup time on the display device 200 without the background application management method.
[0120] Based on the aforementioned display device 200, some embodiments of this application also provide a background application management method, including:
[0121] In response to user input commands to switch interfaces, the application that is currently running in the foreground is switched to running in the background.
[0122] Obtain the switching time point and the preset detection period, wherein the preset detection period includes a preset number of detection time points;
[0123] The number of times the application runs in the foreground running state at the detection time point is traversed within the preset detection period;
[0124] Calculate the application usage probability; wherein, the application usage probability is equal to the ratio of the number of times the foreground runs to the preset number;
[0125] If the application's usage probability is less than or equal to a first threshold, then the application will stop running.
[0126] If the application usage probability is greater than a first threshold, then the system resource ratio of the display device and the memory usage value of the application are obtained; and when the system resource ratio is greater than a second threshold or the memory usage value of the application is greater than a third threshold, the application is stopped from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, the application is controlled to maintain the background running state; wherein, the system resource ratio is the ratio of the system memory value used by the display device to the total system memory value.
[0127] As can be seen from the above technical solutions, some embodiments of this application provide a display device and background application management method. The method can respond to a user-inputted interface switching command to switch an application currently running in the foreground to running in the background. It obtains the switching time point and a preset detection period. It iterates through the number of times the application runs in the foreground at the detection time point within the preset detection period. It also calculates the application usage probability. If the application usage probability is less than or equal to a first threshold, the application stops running; if the application usage probability is greater than the first threshold, it obtains the system resource ratio of the display device and the application's memory usage value. When the system resource ratio is greater than a second threshold or the application's memory usage value is greater than a third threshold, the application stops running; when the system resource ratio is less than or equal to the second threshold and the application's memory usage value is less than or equal to the third threshold, the application is kept running in the background. This method, by jointly judging the application usage probability and resource usage, determines whether to stop the application when it switches to the background running state, thus solving the problem of high time consumption when restarting an application after it has exited a currently running application on the display device.
[0128] The same or similar parts among the various embodiments in this specification can be referred to mutually, and will not be repeated here.
[0129] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or certain parts of the embodiments of the present invention.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0131] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that, include: The monitor is configured to display the user interface; The memory is configured to store application runtime information; The controller is configured as follows: Obtain the application startup time of the application within the unit detection period; Obtain the application exit time of the application within the unit detection period; Calculate the foreground running time of the application within the unit detection cycle based on the application startup time and the application exit time; Store the foreground runtime period into the memory; In response to user input commands to switch interfaces, the application that is currently running in the foreground is switched to running in the background. Obtain the switching time point and the preset detection period, wherein the preset detection period includes a preset number of detection time points and the preset detection period includes a preset number of unit detection periods; The number of times the application runs in the foreground running state at the detection time point is traversed within the preset detection period; Calculate the application usage probability; wherein, the application usage probability is equal to the ratio of the number of times the foreground runs to the preset number; If the application's usage probability is less than or equal to a first threshold, then the application will stop running. If the application usage probability is greater than a first threshold, then the system resource ratio of the display device and the memory usage value of the application are obtained; and when the system resource ratio is greater than a second threshold or the memory usage value of the application is greater than a third threshold, the application is stopped from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, the application is controlled to maintain the background running state; wherein, the system resource ratio is the ratio of the system memory value used by the display device to the total system memory value; The controller executes the number of foreground runs of the application at the detection time point within the preset detection period, specifically configured as follows: Set the number of foreground runs to the initial value; Obtain the unit detection period within the preset detection period; Extract the foreground running time period of the application within the unit detection cycle; If the switching time point falls within the foreground running time period, then the number of foreground runs is incremented by one.
2. The display device according to claim 1, characterized in that, If the application's usage probability is greater than a first threshold, the controller will obtain the system resource ratio of the display device and the application's memory usage value, specifically configured as follows: In response to the user's application exit command, a memory detection process is initiated; The memory detection process detects the system memory used by the display device, the total system memory of the display device, and the memory usage of the application. Calculate the ratio of the system memory used by the display device to the total system memory to obtain the system resource ratio; The system resource percentage and the application's memory usage value are stored in the memory.
3. The display device according to claim 1, characterized in that, The controller, when the system resource usage percentage is less than or equal to a second threshold and the application's memory usage is less than or equal to a third threshold, controls the application to maintain its background running state, specifically configured as follows: Obtain the system resource ratio, the second threshold, the application's memory usage value, and the third threshold; If the system resource ratio is less than or equal to the second threshold and the application's memory usage is less than or equal to the third threshold, then the application will be automatically exited to prevent it from automatically exiting.
4. The display device according to claim 3, characterized in that, The controller executes automatic exit interception for the application if the system resource ratio is less than or equal to a second threshold and the application's memory usage is less than or equal to a third threshold, thereby controlling the application to stop automatically exiting. It is also configured to: Generate a notification of successful interception; A notification interface is generated based on the successful interception notification; Control the display to show the prompt interface.
5. The display device according to claim 1, characterized in that, The controller executes an interface switching command in response to user input, switching the application currently running in the foreground to running in the background, specifically configured as follows: Receive the interface switching command input by the user based on the application's running interface; In response to the interface switching command, control the display to change the display interface; Release the application's network resources, file resources, and device resources, and save the application's application data.
6. The display device according to claim 1, characterized in that, The controller is also configured to: If the system memory used by the display device is greater than or equal to the fourth threshold, then a resource reclamation process is initiated. Inactive applications are detected through the resource recycling process. Inactive applications are those that are running in the background on the display device and have an activity level less than a fifth threshold. The activity level is used to characterize the frequency of interaction performed by the application. Stop the inactive application from running.
7. The display device according to claim 6, characterized in that, The controller is configured to detect inactive applications through the resource reclamation process, specifically as follows: Iterate through the activity levels of background applications in the display device; wherein, the background application is an application that is in the background running state; If the activity level of the background application is less than the fifth threshold, the background application will be marked as an inactive application.
8. A method for managing background applications, characterized in that, Applied to the display device according to any one of claims 1-7, the method comprises: Obtain the application startup time of the application within the unit detection period; Obtain the application exit time of the application within the unit detection period; Calculate the foreground running time of the application within the unit detection cycle based on the application startup time and the application exit time; Store the foreground runtime period into the memory; In response to user input commands to switch interfaces, the application that is currently running in the foreground is switched to running in the background. Obtain the switching time point and the preset detection period, wherein the preset detection period includes a preset number of detection time points and the preset detection period includes a preset number of unit detection periods; The number of times the application runs in the foreground running state at the detection time point is traversed within the preset detection period; Calculate the application usage probability; wherein, the application usage probability is equal to the ratio of the number of times the foreground runs to the preset number; If the application's usage probability is less than or equal to a first threshold, then the application will stop running. If the application usage probability is greater than a first threshold, then the system resource ratio of the display device and the memory usage value of the application are obtained; and when the system resource ratio is greater than a second threshold or the memory usage value of the application is greater than a third threshold, the application is stopped from running; when the system resource ratio is less than or equal to the second threshold and the memory usage value of the application is less than or equal to the third threshold, the application is controlled to maintain the background running state; wherein, the system resource ratio is the ratio of the system memory value used by the display device to the total system memory value; The traversal within the preset detection period, the number of times the application runs in the foreground at the detection time point, includes: Set the number of foreground runs to the initial value; Obtain the unit detection period within the preset detection period; Extract the foreground running time period of the application within the unit detection cycle; If the switching time point falls within the foreground running time period, then the number of foreground runs is incremented by one.
Citation Information
Patent Citations
Method and device for managing application, and terminal
CN106201686A
Application program management method and device, readable medium, electronic equipment and product
CN114995972A