Program management method and terminal equipment
By automatically starting the target system program on the smart device and dynamically adjusting the program management strategy according to different application scenarios, the problem of lag caused by limited memory of smart devices is solved, and the fluency and memory utilization of the device are improved.
Patent Information
- Application Number
- CN202311520038.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2025-05-16
Smart Images

Figure CN120010942A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a program management method and terminal device. Background Art
[0002] With the development of Internet technology, smart devices have been increasingly used in people's daily lives. Take smart TVs or projectors as an example. They are usually equipped with Android systems and provide users with a variety of functional services through built-in programs or downloaded third-party programs.
[0003] Smart devices have limited memory, and various programs will take up a lot of memory, causing the device to run slowly. At this time, it is necessary to manage the programs and free up memory to alleviate device lags.
[0004] However, in the related art, the program management method is too single, resulting in poor management effect. Summary of the invention
[0005] Based on this, it is necessary to provide a program management method and terminal device to address the above technical issues.
[0006] In a first aspect, the present application provides a program management method, which is applied to a target system program, and the target system program is automatically started with a high priority when a terminal device is turned on. The method includes:
[0007] Determine the application scenario of the terminal device at the current moment;
[0008] The programs in the terminal device are managed according to the preset program management strategies under multiple different application scenarios; different application scenarios correspond to different program management strategies.
[0009] In one embodiment, the multiple different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; and managing programs in the terminal device according to the preset program management strategies in the multiple different application scenarios includes:
[0010] Determine, from among the programs of the terminal device, a program that belongs to a startup program blacklist and is in a running state;
[0011] End the running programs in the terminal device that are in the startup program blacklist.
[0012] In one embodiment, the plurality of different application scenarios include a program usage scenario, and the program management strategy in the program usage scenario includes a mutually exclusive program list; and managing the programs in the terminal device according to the preset program management strategies in the plurality of different application scenarios includes:
[0013] Determine the foreground program running in the foreground among the programs of the terminal device;
[0014] When the foreground program is a program in the mutually exclusive program list, the programs in the terminal device are managed according to other programs in the mutually exclusive program list.
[0015] In one embodiment, managing programs in a terminal device according to other programs in a mutually exclusive program list includes:
[0016] Determine a target program that matches other programs among programs of the terminal device;
[0017] When the target program is running in the background, terminate the target program in the terminal device.
[0018] In one embodiment, the multiple different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; and managing programs in the terminal device according to the preset program management strategies in the multiple different application scenarios includes:
[0019] Determine the background program running in the background among the programs of the terminal device;
[0020] Determine the priority of background programs based on the program whitelist; programs in the program whitelist have the lowest priority;
[0021] Manage background programs according to priority.
[0022] In one embodiment, background programs are managed according to priorities, including:
[0023] Sort the background programs in descending order of priority;
[0024] End background programs in order according to their order until the memory shortage stops.
[0025] In one embodiment, determining the application scenario of the terminal device at the current moment includes:
[0026] Get the running time of the target system program at the current moment;
[0027] Determine whether the application scenario of the terminal device is a startup scenario based on the running time.
[0028] In one embodiment, determining the application scenario of the terminal device at the current moment includes:
[0029] Get the running status of the program on the terminal device at the current moment;
[0030] Determine whether the application scenario of the terminal device is a program usage scenario based on the running status.
[0031] In one embodiment, determining the application scenario of the terminal device at the current moment includes:
[0032] Get the memory status of the terminal device;
[0033] Determine whether the application scenario of the terminal device is an insufficient memory scenario based on the memory status.
[0034] In a second aspect, the present application further provides a terminal device, which is applied to a target system program, and the target system program is automatically started with a high priority when the terminal device is turned on. The terminal device includes:
[0035] A scenario determination module is used to determine the application scenario of the terminal device at the current moment;
[0036] The program management module is used to manage the programs in the terminal device according to the preset program management strategies under multiple different application scenarios.
[0037] The above program management method and terminal device automatically start the target system program with high priority when the terminal device is turned on, and determine the application scenario of the terminal device at the current moment, so as to manage the programs in the terminal device according to the program management strategies under multiple preset different application scenarios. In the above method, different application scenarios correspond to different program management strategies. In the face of the diverse application scenarios of the terminal device, the corresponding program management strategy is selected to manage the program, which improves the matching degree between the strategy and the scenario, and correspondingly improves the management effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is an internal structure diagram of a terminal device in one embodiment;
[0039] Figure 2 A flowchart of a program management method in one embodiment;
[0040] Figure 3 A schematic diagram of a process flow of program management in a startup scenario in one embodiment;
[0041] Figure 4 A schematic diagram of a process flow of program management in a program usage scenario in one embodiment;
[0042] Figure 5 A schematic diagram of a flow chart of program management in a program usage scenario in another embodiment;
[0043] Figure 6 A schematic diagram of a process flow of program management in a memory shortage scenario in one embodiment;
[0044] Figure 7 A schematic diagram of a flow chart of program management in a memory shortage scenario in another embodiment;
[0045] Figure 8 A schematic diagram of a process for determining a startup scenario in an embodiment;
[0046] Fig. 9 A schematic diagram of a flow chart for determining a program usage scenario in one embodiment;
[0047] Fig.10 A schematic diagram of a process for determining an insufficient memory scenario in one embodiment;
[0048] Fig.11 is a flowchart of a program management method in another embodiment;
[0049] Fig.12 FIG. 4 is a structural block diagram of a terminal device in an embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The program management method provided in the embodiment of the present application is applied to the target system program installed in the terminal device, and the target system program is automatically started with a high priority when the terminal device is turned on. The target system program is a system application (System application, SysAPP) with a system signature in the terminal device, which is configured to manage the programs in the terminal device. The target system program is located in the application layer, and the target system program can run in the foreground or in the background.
[0052] Among them, the internal structure diagram of the terminal device can be as follows Figure 1 As shown, it includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the terminal device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network or other technologies. When the computer program is executed by the processor, a program management method is implemented. The display screen of the terminal device can be a liquid crystal display screen, an electronic ink display screen or a projection screen, and the input device of the terminal device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the terminal device shell, or an external keyboard, touch pad, remote control or mouse, etc.
[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0054] In one embodiment, Figure 2 As shown, a program management method is provided, which is applied to Figure 1 The program management method is described by taking the terminal device in the example of FIG. 1 and is specifically applied to the target system program in the terminal device. The program management method includes the following steps:
[0055] S210: Determine the application scenario of the terminal device at the current moment.
[0056] The application scenarios of the terminal device may be used to characterize different usage states or stages of the terminal device, for example, a startup scenario of just powering on, a standby scenario of not using an application program, or a program usage scenario of using an application program.
[0057] Different application scenarios have different scene features. For example, the scene feature of the startup scene is the preset duration after startup, that is, the terminal device is in the startup scene within the preset duration after startup; the scene feature of the program usage scene is the foreground program running in the foreground on the terminal device; the scene feature of the standby scene is that the terminal device is neither in the startup scene nor using the application when it is powered on.
[0058] Optionally, the terminal device determines the application scenario of the terminal device at the current moment according to the scenario characteristics of different application scenarios through the target system program. Exemplarily, the target system program can be automatically started with high priority when the terminal device is turned on, and the start time of the target system program can be used as the start time of the terminal device. The target system program can compare the running time between the start time and the current time with the preset time. If the running time is less than or equal to the preset time, it is determined that the terminal device is in the startup scene; conversely, if the running time is greater than the preset time, it is determined that the terminal device is in the running scene or standby scene after startup.
[0059] S220: Manage programs in the terminal device according to preset program management strategies for multiple different application scenarios.
[0060] Among them, the program management strategy is used to characterize the management method of the program. Different application scenarios correspond to different program management strategies. The programs in the terminal device may include the system programs that come with the terminal device, and may also include third-party applications (Application, APP) that are downloaded and installed separately.
[0061] Optionally, after determining the application scenario of the terminal device at the current moment, the terminal device determines the program management strategy corresponding to the application scenario at the current moment according to the preset scenario strategy correspondence through the target system program, and manages the program in the terminal device. Specifically, the running state of the program can be managed, such as ending the program, that is, ending the process of the program.
[0062] In the embodiment of the present application, a program management method applied to a target system program is provided, wherein the target system program is automatically started with a high priority when the terminal device is turned on, and the application scenario of the terminal device at the current moment is determined, so as to manage the program in the terminal device according to the program management strategy under multiple preset different application scenarios. In the above method, different application scenarios correspond to different program management strategies, and corresponding program management strategies are selected for program management in the face of the diverse application scenarios of the terminal device, which improves the matching degree between the strategy and the scenario, and correspondingly improves the management effect.
[0063] Multiple different application scenarios include the boot scenario. In the boot scenario, the terminal device's self-startup (including the startup and initialization of important system programs) requires a large amount of memory resources, and the self-startup of other applications also requires the occupation of memory resources, which in turn causes the terminal device to freeze in the boot scenario. Based on this, in order to alleviate the freeze of the terminal device in the boot scenario, in one embodiment, Figure 3 As shown, the above S220, managing the programs in the terminal device according to the preset program management strategies under multiple different application scenarios, includes:
[0064] S310: Determine, from among the programs of the terminal device, a program that is in a blacklist of startup programs and is in a running state.
[0065] The terminal device is in the startup scene within a preset time after startup. If the target system program is configured to automatically start with a high priority when the terminal device is powered on, the time between the startup of the terminal device and the startup of the target system program can be ignored, and the terminal device is in the startup scene within a preset time after the startup of the target system program.
[0066] When it is determined that the terminal device is in the startup scenario, a program management policy corresponding to the startup scenario is further obtained, and the program management policy corresponding to the startup scenario includes a startup program blacklist.
[0067] The startup program blacklist includes at least one program that is prohibited from running when the terminal device is in the startup scenario. Exemplarily, the program in the startup program blacklist is a third-party application that is automatically started after the terminal device is turned on. Among them, the startup program blacklist can be pre-configured to the terminal device by the developer, or it can be determined by the target system program based on the third application that is automatically started during the historical startup process.
[0068] Optionally, when the terminal device is in a startup scenario, the terminal device uses the system interface through the target system program to obtain the running status of each program in the startup program blacklist in the terminal device to determine the programs in the terminal device that belong to the startup program blacklist and are in a running state. Exemplarily, the startup program blacklist includes APP1, APP2, APP3, APP4 and APP5, wherein APP1 and APP2 are in a running state in the terminal device, that is, APP1 and APP2 are the programs in the terminal device that belong to the startup program blacklist and are in a running state.
[0069] S320, terminate the program in the terminal device that is in the startup program blacklist and is in running state.
[0070] Optionally, after determining a program in the terminal device that is in the startup program blacklist and is in a running state, the terminal device ends the program by calling a system interface through a target system program to close the program.
[0071] In an embodiment of the present application, a plurality of different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist. The terminal device determines the programs that belong to the startup program blacklist and are in a running state in the programs of the terminal device through the target system program, so as to terminate the programs that belong to the startup program blacklist and are in a running state in the terminal device. In the above method, when the terminal device is in the startup scenario, the programs that belong to the startup program blacklist and are in a running state in the terminal device are terminated, so as to release more memory resources for the terminal device in the startup scenario for the terminal device to start up automatically, thereby improving the smoothness of the system operation and alleviating the jamming in the startup scenario.
[0072] The multiple different application scenarios include program usage scenarios. The program usage scenario corresponds to the situation where the user selects a program to run in the foreground of the terminal device. The program running in the foreground often occupies a large amount of memory resources of the terminal device. At this time, if there is a program running in the background and consuming a large amount of memory, it will affect the program running in the foreground, causing lag. Based on this, in order to alleviate the lag of the terminal device in the program usage scenario, in one embodiment, if Figure 4 As shown, the above S220, managing the programs in the terminal device according to the preset program management strategies under multiple different application scenarios, includes:
[0073] S410: Determine a foreground program running in the foreground among the programs of the terminal device.
[0074] The terminal device is in the program usage scenario when the user selects a program to run in the foreground. For example, when the user selects a video playback application installed in the terminal device to play a video, the terminal device is in the program usage scenario.
[0075] Optionally, the terminal device reads the full path of the current interface in the program information through the target system program to determine the foreground program running in the foreground of the terminal device.
[0076] S420: When the foreground program is a program in a mutually exclusive program list, manage the programs in the terminal device according to other programs in the mutually exclusive program list.
[0077] When it is determined that the terminal device is in a program usage scenario, a program management policy corresponding to the program usage scenario is further obtained, and the program management policy corresponding to the program usage scenario includes a mutually exclusive program list.
[0078] The mutually exclusive program list includes at least two programs that are prohibited from running simultaneously on the terminal device. Exemplarily, the programs in the mutually exclusive program list are third-party applications whose runtime memory usage is greater than a preset usage, or third-party applications whose runtime memory usage is greater than a preset usage and have the same functions. The mutually exclusive program list can be pre-configured in the terminal device by the developer, or can be automatically determined by the target system program by reading the program's historical running data.
[0079] Optionally, when the terminal device is in a program application scenario, the terminal device matches the foreground program with the programs in the mutually exclusive program list through the target system program to determine whether the foreground program is a program in the mutually exclusive program list. Exemplarily, the mutually exclusive program list includes program identifiers that characterize each program, and the terminal device reads the program identifier of the foreground program through the target system program to match the program identifier of the foreground program with the program identifier in the mutually exclusive program list. If there is a program identifier that is identical to the program identifier of the foreground program in the mutually exclusive program list, the foreground program is determined to be a program in the mutually exclusive program list; conversely, if there is no program identifier that is identical to the program identifier of the foreground program in the mutually exclusive program list, it is determined that the foreground program is not a program in the mutually exclusive program list.
[0080] Optionally, when the foreground program is a program in the mutually exclusive program list, the terminal device further determines the running status of other programs in the mutually exclusive program list except the foreground program through the target system program, so as to manage the programs in the terminal device according to the running status of other programs.
[0081] In an optional embodiment, if Figure 5 As shown, the above S420 manages the programs in the terminal device according to other programs in the mutually exclusive program list, including:
[0082] S510: Determine a target program that matches other programs in the programs of the terminal device.
[0083] Optionally, the terminal device obtains the program identifier of each program in the terminal device through the target system program, and matches the program identifier of each program with the program identifiers of other programs in the mutually exclusive program list to determine the target program that matches the other programs in the program of the terminal device. Wherein, if the program identifiers are the same, the programs are matched accordingly.
[0084] S520: When the target program is running in the background, terminate the target program.
[0085] Optionally, after determining the target program, the terminal device determines the running state of the target program by using the system interface through the target system program, so as to manage the target program in the terminal device according to the running state of the target program. Wherein, when the running state of the target program is background running, the terminal device ends the target program by calling the system interface through the target system program to close the target program. Exemplarily, when there are multiple target programs, all of them can be closed to ensure that only one program in the mutually exclusive program list is running, and this program is the foreground program.
[0086] In an embodiment of the present application, a plurality of different application scenarios include a program usage scenario, and a program management strategy in a program usage scenario includes a list of mutually exclusive programs. The terminal device determines the foreground program running in the foreground in the program of the terminal device through the target system program, so that when the foreground program is a program in the list of mutually exclusive programs, the program in the terminal device is managed according to other programs in the list of mutually exclusive programs. Specifically, a target program matching other programs is determined in the program of the terminal device, so that when the target program is running in the background, the target program in the terminal device is terminated. In the above method, when the terminal device is in a program usage scenario, by determining whether the foreground program is a program in the list of mutually exclusive programs, when the foreground program is a program in the list of mutually exclusive programs, the target program in the terminal device that belongs to other programs in the list of mutually exclusive programs and is running in the background is terminated, so that more memory resources are released for the terminal device in the program usage scenario for the foreground program to run, thereby improving the fluency of the foreground program and alleviating the jam in the program usage scenario.
[0087] A plurality of different application scenarios include insufficient memory scenarios. Insufficient memory scenarios correspond to situations where the memory status of a terminal device does not meet the operating requirements. Based on this, in one embodiment, Figure 6As shown, the above S220, managing the programs in the terminal device according to the preset program management strategies under multiple different application scenarios, includes:
[0088] S610: Determine a background program running in the background among programs of the terminal device.
[0089] Optionally, the terminal device uses the system interface to obtain the program information of the terminal device through the target system program, so as to determine the programs in the terminal device that are in operation and the foreground programs that are running in the foreground according to the program information, and exclude the foreground programs in the programs in operation to obtain the background programs that are running in the background. For example, there are 4 programs in operation in the terminal device, namely APPa, APPb, APPc and APPd. Based on the full path of the current interface in the program information, APPd is determined to be the foreground program, and APPa, APPb and APPc are the background programs that are running in the background.
[0090] S620. Determine the priority of the background program according to the program whitelist; the program in the program whitelist has the lowest priority.
[0091] When it is determined that the terminal device is in an insufficient memory scenario, a program management policy corresponding to the insufficient memory scenario is further obtained, and the program management policy corresponding to the insufficient memory scenario includes a program whitelist.
[0092] The program whitelist includes at least one program, which can be an important core program in the terminal device or a program frequently used by the user. The program whitelist can be pre-configured in the terminal device by the developer or determined by the target system program based on the program's historical running data.
[0093] Among them, the priority is used to indicate the priority of terminating a program. The higher the priority, the earlier the corresponding program is terminated; conversely, the lower the priority, the later the corresponding program is terminated. The programs in the program whitelist have the lowest priority, indicating that the programs in the program whitelist are terminated last.
[0094] Optionally, the terminal device determines the priority of all background programs running in the background of the terminal device according to the program characteristics through the target system program, and sets the priority of the background programs in the program whitelist to the lowest. For example, all background programs running in the background of the terminal device include APP1, APP2, APPa, APPb and APPc. According to the characteristics of the programs themselves, the priority order of APP1, APP2, APPa, APPb and APPc is APP1, APP2, APPa, APPb, APPc, where APP2 and APPb are programs in the program whitelist, and the updated priority order is APP1, APPa, APPc, APP2 / APPb.
[0095] Optionally, program features may include memory usage at runtime (i.e., running memory usage), access frequency, or last access time. Exemplarily, the priority of each background program can be determined based on the running memory usage of the background program, such as the larger the running memory usage, the higher the priority of the corresponding program; conversely, the smaller the running memory usage, the lower the priority of the corresponding program. The priority of each background program can also be determined based on the access frequency of the background program, such as the higher the access frequency, the lower the priority of the corresponding program; conversely, the lower the access frequency, the higher the priority of the corresponding program. The priority of each background program can also be determined based on the last access time of the background program, such as the earlier the last access time, the higher the priority of the corresponding program; conversely, the later the last access time, the lower the priority of the corresponding program. It should be noted that the access frequency or the last access time refers to the access frequency or the last access time when the program is running in the foreground, that is, as the foreground program.
[0096] S630: Manage background programs according to priorities.
[0097] Optionally, after obtaining the priorities of all background programs in the terminal device through the target system program, the terminal device may sort the background programs based on the priorities of the background programs, so as to terminate the background programs in sequence according to the sorting.
[0098] In one embodiment, if Figure 7 As shown, the above S630, managing the background programs according to the priority, includes:
[0099] S710. Sort the background programs in descending order of priority.
[0100] Optionally, the terminal device compares the priorities of the background programs through the target system program to arrange all the background programs in descending order of priority, thereby obtaining the ranking of all the background programs in the terminal device.
[0101] S720: End the background programs in order according to the order of the background programs until the insufficient memory scenario is resolved.
[0102] Among them, the terminal device is out of the insufficient memory scenario, which indicates that the memory status of the terminal device meets the operation requirements.
[0103] Optionally, after obtaining the ranking of all background programs in the terminal device, the terminal device can terminate the background programs in sequence according to the ranking of the background programs through the target system program, and continuously determine the memory status of the terminal device so as not to terminate the background programs when the memory status of the terminal device meets the operating requirements. For example, continuing the above example, the ranking of the background programs obtained in order from high to low priority is: APP1, APPa, APPc, APP2 / APPb. In the insufficient memory scenario, the target system program terminates the background programs in sequence according to the above order, and obtains the memory occupancy rate of the terminal device in real time or periodically, and stops the process of terminating the background programs when the memory occupancy rate is less than the occupancy rate threshold. For example, after terminating APPa, the memory occupancy rate of the terminal device is obtained to be 65%, which is less than the occupancy rate threshold of 80%, it is determined that the terminal device has escaped the insufficient memory scenario, and APPc, APP2 / APPb are no longer terminated.
[0104] In the embodiment of the present application, a plurality of different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist. The terminal device determines the background program running in the background in the program of the terminal device through the target system application, and determines the priority of the background program according to the program whitelist, so as to manage the background program according to the priority. Specifically, the background programs are sorted in order from high to low priority, so as to terminate the background programs in sequence according to the order of the background programs until the insufficient memory scenario is out of sight. Among them, the priority of the program in the program whitelist is the lowest. In the above method, when the terminal device is in an insufficient memory scenario, the priority of the background program is determined by the program whitelist, so as to terminate the background application program in sequence according to the order of the priority from high to low until the insufficient memory scenario is out of sight, so as to release more memory resources for the terminal device in the insufficient memory scenario, alleviate the jamming in the insufficient memory scenario, and realize the delayed termination of the programs in the program whitelist, reducing the probability of user inconvenience or other failures caused by the early termination of the program process in the program whitelist.
[0105] In the case where the target system program is automatically started with a high priority, it can be determined whether the terminal device is in the startup scenario based on the running time of the target system program. Based on this, in one embodiment, if Figure 8 As shown, the above S210, determining the application scenario of the terminal device at the current moment, includes:
[0106] S810: Obtain the current running time of the target system program.
[0107] Optionally, the terminal device may obtain the start time of the target system program through the target system program to calculate the duration between the start time and the current time, that is, the running time of the target system program.
[0108] S820: Determine whether the application scenario of the terminal device is a startup scenario according to the running time.
[0109] In actual applications, the terminal device is in the startup scene within the preset time after startup. In the case where the target system program is configured to automatically start with a high priority when the terminal device is powered on, the time between the terminal device startup and the target system program startup can be ignored, and the difference between the running time after the target system program is started and the preset time is used to determine whether the terminal device is in the startup scene.
[0110] Optionally, the terminal device compares the running time of the target system program with the preset time through the target system program to determine whether the application scenario of the terminal device is the startup scenario according to the comparison. Wherein, if the running time is less than or equal to the preset time, it is determined that the application scenario of the terminal device at the current moment is the startup scenario; conversely, if the running time is greater than the preset time, it is determined that the application scenario of the terminal device at the current moment is not the startup scenario.
[0111] Optionally, in addition to directly comparing the running time with the preset time, the number of calculations of the running time can also be obtained to determine whether the application scenario of the terminal device is a boot scenario based on the number of calculations. Exemplarily, the terminal device periodically calculates the running time between the startup moment and the current moment through the target system program. When the number of calculations does not reach the preset number (determined based on the preset time and the calculation cycle), it indicates that the running time of the target system program has not reached the preset time, and the terminal device is in the boot scenario; conversely, when the number of calculations reaches the preset number, it indicates that the running time of the target system program reaches the preset time, and the terminal device is not in the boot scenario accordingly. For example, the preset time is 2min and the cycle is 30s, that is, the running time between the startup moment and the current moment is calculated every 30s, and the preset number threshold is (2*60) / 30=4. When the number of cycles of the calculated running time is ≤ the preset number threshold 4, it indicates that the terminal device is in the boot scenario; when the number of cycles of the calculated running time is > the preset number threshold 4, it indicates that the terminal device is not in the boot scenario.
[0112] In the embodiment of the present application, the running time of the target system program at the current moment is obtained to determine whether the application scenario of the terminal device is the startup scenario according to the running time. In the above method, whether the application scenario of the terminal device is the startup scenario can be accurately determined, thereby improving the accuracy of the determination of the startup scenario.
[0113] Whether the terminal device is in the program usage scenario depends on the running state of the program on the terminal device. Based on this, in one embodiment, Fig. 9 As shown, the above S210, determining the application scenario of the terminal device at the current moment, includes:
[0114] S910: Obtain the running status of the program on the terminal device at the current moment.
[0115] The running status of the program is used to indicate whether the program is running, and whether it is running in the foreground or the background of the terminal device.
[0116] Optionally, the terminal device obtains program information of the program on the terminal device through the target system program using the system interface, and obtains the program status therefrom. The program information includes program attribute information, such as running status, program identification, program version, package name, etc.
[0117] S920: Determine whether the application scenario of the terminal device is a program usage scenario according to the running status.
[0118] Optionally, the terminal device determines whether there is a program in a running state on the terminal device through the target system program, and if there is, further determines whether the program in each running state is running in the foreground or in the background of the terminal device. If there is a program running in the foreground among the programs in each running state, the application scenario of the terminal device is determined to be a program usage scenario; otherwise, if there is no program running in the foreground among the programs in each running state, the application scenario of the terminal device is determined not to be a program usage scenario.
[0119] Among them, the program information also includes the full path of the current interface for indicating the program running in the foreground of the terminal device at the current moment. Optionally, the terminal device can directly read the full path of the current interface in the program information to determine whether the application scenario of the terminal device is a program usage scenario. Among them, when the acquired program information includes the full path of the current interface, it is determined that there is a program running in the foreground of the terminal device, and the application scenario of the terminal device can be determined as the program usage scenario accordingly; conversely, when the acquired program information does not include the full path of the current interface, it is determined that there is no program running in the foreground of the terminal device, and the application scenario of the terminal device can be determined not to be a program usage scenario accordingly.
[0120] In the embodiment of the present application, the running state of the program on the terminal device at the current moment is obtained to determine whether the application scenario of the terminal device is a program usage scenario according to the running state. In the above method, it is possible to accurately determine whether the application scenario of the terminal device is a program usage scenario, thereby improving the accuracy of determining the program usage scenario.
[0121] The memory status of the terminal device can be used to determine whether the application scenario of the terminal device is an insufficient memory scenario. Based on this, in one embodiment, if Fig.10 As shown, the above S210, determining the application scenario of the terminal device at the current moment, includes:
[0122] S1010. Obtain the memory status of the terminal device.
[0123] The memory status of the terminal device is used to characterize the available memory capacity. For example, the memory status can be determined based on the memory occupancy rate or the remaining memory capacity of the terminal device.
[0124] Optionally, the terminal device reads the memory occupancy of the terminal device in real time or periodically through the target system program, and compares the memory occupancy with a preset occupancy threshold to determine the memory status of the terminal device according to the comparison result.
[0125] S1020. Determine, according to the memory status, whether the application scenario of the terminal device is an insufficient memory scenario.
[0126] Optionally, the terminal device determines whether the memory state meets the preset operation requirements through the target system program, and then determines whether the application scenario of the terminal device is an insufficient memory scenario. Wherein, when the memory state of the terminal device is that the memory occupancy rate is less than the occupancy rate threshold, it is determined that the memory state of the terminal device meets the operation requirements, and the application scenario of the terminal device is not an insufficient memory scenario; when the memory state of the terminal device is that the memory occupancy rate is greater than or equal to the occupancy rate threshold, it is determined that the memory state of the terminal device does not meet the operation requirements, and the application scenario of the terminal device is an insufficient memory scenario.
[0127] In the embodiment of the present application, the memory status of the terminal device is obtained to determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status. In the above method, it is possible to accurately determine whether the application scenario of the terminal device is an insufficient memory scenario, thereby improving the accuracy of determining the insufficient memory scenario.
[0128] In order to facilitate the understanding of those skilled in the art, the following is a detailed introduction to the program management method provided by the present application. The program management method is applied to the target system program, and the target system program is automatically started with a high priority when the terminal device is turned on. Fig.11 As shown, the method may include:
[0129] S1101, determining an application scenario of a terminal device at the current moment;
[0130] S1102, when the terminal device is in a startup scenario, determining, from among the programs of the terminal device, a program that is in a startup program blacklist in a program management policy corresponding to the startup scenario and is in a running state;
[0131] S1103, ending the program in the terminal device that is in the startup program blacklist and is in a running state;
[0132] S1104, when the terminal device is in a program usage scenario, determining a foreground program running in the foreground among the programs of the terminal device;
[0133] S1105, when the foreground program is a program in the mutually exclusive program list in the program management policy corresponding to the program usage scenario, determining a target program matching other programs in the mutually exclusive program list in the programs of the terminal device;
[0134] S1106, when the target program is running in the background, terminating the target program in the terminal device;
[0135] S1107. When the terminal device is in a memory shortage scenario, determine a background program running in the background from among the programs of the terminal device;
[0136] S1108, determining the priority of the background program according to the program whitelist in the program management policy corresponding to the insufficient memory scenario;
[0137] S1109, sorting the background programs in descending order of priority;
[0138] S1110 , ending the background programs in sequence according to the order of the background programs until the insufficient memory scenario is resolved.
[0139] For the description in the above S1101 - S1110 , reference may be made to the relevant description in the above embodiment, and the effects are similar, so this embodiment will not be repeated here.
[0140] It should be noted that, in the embodiment of the present application, the terminal device for installing the above-mentioned target system program is a TV or a projector. A TV or a projector is usually equipped with an Android system, and often freezes during its use. There are various reasons for freezing. For example, when a TV or a projector is just turned on or plays a high-definition video (such as a video with a resolution of 2K / 4K), there is a large memory resource demand, and affected by the performance of the system-on-a-Chip (System-on-a-Chip, SOC) in the TV or projector, the TV or projector is prone to freeze in this case. For another example, in actual applications, developers usually only equip a TV or a projector with a smaller memory (such as 2GB or 3GB), and after a TV or a projector installs more programs, the available memory is reduced, thereby causing freezes. For another example, there are many programs in a TV or a projector, and most programs will automatically start after the TV or projector is turned on, and have been running in the background, further exacerbating the freeze of the TV or projector during use.
[0141] For TVs or projectors, the relevant technology usually adopts modifying the software logic of the system framework layer (such as modifying the Framework layer, i.e. the system framework) to update the system firmware to alleviate the jamming of the TV or projector during use. However, the process of updating the system firmware is not only cumbersome and complicated, but for TVs or projectors sold to overseas markets, updating the system firmware also requires professional certification, which not only requires paying the certification fee, but also has a long certification cycle and cannot be updated in time. In particular, for TVs or projectors equipped with the Google TV system or the Android TV system, if the system provider does not allow the system framework layer to be modified, this makes it particularly difficult to alleviate the jamming of the TV or projector.
[0142] By adopting the program management method provided in the above embodiments of the present application, there is no need to modify the system framework layer of the TV or projector. Program management in different application scenarios of the TV or projector can be achieved only through the target system program installed in the TV or projector to release more memory resources. This not only improves the smoothness of use of the TV or projector, alleviates the lag of the TV or projector during use, but also improves and broadens the scope of application. It is also applicable to some terminal products that do not allow system-level modifications.
[0143] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0144] Based on the same inventive concept, the embodiment of the present application also provides a terminal device for implementing the program management method involved above. The implementation solution provided by the terminal device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more terminal device embodiments provided below can refer to the limitations on the program management method above, and will not be repeated here.
[0145] In one embodiment, Fig.12 As shown, a terminal device is provided, which is applied to a target system program. The target system program is automatically started with a high priority when the terminal device is turned on. The terminal device includes: a scene determination module 1201 and a program management module 1202, wherein:
[0146] The scenario determination module 1201 is used to determine the application scenario of the terminal device at the current moment;
[0147] The program management module 1202 is used to manage the programs in the terminal device according to preset program management strategies in multiple different application scenarios.
[0148] In one embodiment, the multiple different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; the program management module 1202 includes:
[0149] The running status submodule is used to determine the programs in the terminal device that belong to the startup program blacklist and are in the running state;
[0150] The end program submodule is used to end the program in the terminal device that belongs to the startup program blacklist and is in running state.
[0151] In one embodiment, the plurality of different application scenarios include a program usage scenario, and the program management strategy in the program usage scenario includes a mutually exclusive program list; the program management module 1202 includes:
[0152] The foreground running submodule is used to determine the foreground program running in the foreground among the programs of the terminal device;
[0153] The program management submodule is used to manage the programs in the terminal device according to other programs in the mutually exclusive program list when the foreground program is a program in the mutually exclusive program list.
[0154] In one embodiment, the program management submodule includes:
[0155] A target matching unit, used to determine a target program that matches other programs in the programs of the terminal device;
[0156] The end execution unit is used to end the target program in the terminal device when the target program is running in the background.
[0157] In one embodiment, the plurality of different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; the program management module 1202 includes:
[0158] The background submodule determines the background program running in the background in the program of the terminal device;
[0159] The priority submodule is used to determine the priority of the background program according to the program whitelist; the program in the program whitelist has the lowest priority;
[0160] The management submodule is used to manage background programs according to their priorities.
[0161] In one embodiment, the management submodule includes:
[0162] A sorting unit is used to sort the background programs in descending order of priority;
[0163] The management unit is used to terminate the background programs in sequence according to the order of the background programs until the insufficient memory scenario is solved.
[0164] In one embodiment, the scene determination module 1201 includes:
[0165] The duration determination submodule is used to obtain the running duration of the target system program at the current moment;
[0166] The power-on determination submodule determines whether the application scenario of the terminal device is a power-on scenario according to the running time.
[0167] In one embodiment, the scene determination module 1201 includes:
[0168] The running determination submodule is used to obtain the running status of the program on the terminal device at the current moment;
[0169] The usage determination submodule is used to determine whether the application scenario of the terminal device is a program usage scenario according to the running status.
[0170] In one embodiment, the scene determination module 1201 includes:
[0171] The memory determination submodule is used to obtain the memory status of the terminal device;
[0172] The insufficient determination submodule is used to determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status.
[0173] Each module in the above terminal device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0174] In one embodiment, a terminal device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0175] Determine the application scenario of the terminal device at the current moment; manage the programs in the terminal device according to the preset program management strategies under multiple different application scenarios; different application scenarios correspond to different program management strategies.
[0176] In one embodiment, the plurality of different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; when the processor executes the computer program, the following steps are further implemented:
[0177] Determine the programs in the terminal device that belong to the startup program blacklist and are in a running state; and terminate the programs in the terminal device that belong to the startup program blacklist and are in a running state.
[0178] In one embodiment, the plurality of different application scenarios include a program usage scenario, and the program management strategy in the program usage scenario includes a mutually exclusive program list; when the processor executes the computer program, the following steps are further implemented:
[0179] A foreground program running in the foreground is determined among the programs of the terminal device; when the foreground program is a program in a mutually exclusive program list, the programs in the terminal device are managed according to other programs in the mutually exclusive program list.
[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0181] A target program matching other programs is determined in the programs of the terminal device; and when the target program is running in the background, the target program in the terminal device is terminated.
[0182] In one embodiment, the plurality of different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; when the processor executes the computer program, the processor further implements the following steps:
[0183] Determine the background programs running in the background among the programs of the terminal device; determine the priority of the background programs according to the program whitelist; the programs in the program whitelist have the lowest priority; and manage the background programs according to the priority.
[0184] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0185] Sort the background programs in descending order of priority; terminate the background programs in order of priority until the insufficient memory scenario is resolved.
[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0187] Obtain the running time of the target system program at the current moment; determine whether the application scenario of the terminal device is a startup scenario according to the running time.
[0188] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0189] Obtain the running status of the program on the terminal device at the current moment; determine whether the application scenario of the terminal device is the program usage scenario according to the running status.
[0190] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0191] Obtain the memory status of the terminal device; determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status.
[0192] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0193] Determine the application scenario of the terminal device at the current moment; manage the programs in the terminal device according to the preset program management strategies under multiple different application scenarios; different application scenarios correspond to different program management strategies.
[0194] In one embodiment, the plurality of different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; when the computer program is executed by the processor, the following steps are further implemented:
[0195] Determine the programs in the terminal device that belong to the startup program blacklist and are in a running state; and terminate the programs in the terminal device that belong to the startup program blacklist and are in a running state.
[0196] In one embodiment, the plurality of different application scenarios include a program usage scenario, and the program management strategy in the program usage scenario includes a mutually exclusive program list; when the computer program is executed by the processor, the following steps are further implemented:
[0197] A foreground program running in the foreground is determined among the programs of the terminal device; when the foreground program is a program in a mutually exclusive program list, the programs in the terminal device are managed according to other programs in the mutually exclusive program list.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0199] A target program matching other programs is determined in the programs of the terminal device; and when the target program is running in the background, the target program in the terminal device is terminated.
[0200] In one embodiment, the plurality of different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; when the computer program is executed by the processor, the following steps are further implemented:
[0201] Determine the background programs running in the background among the programs of the terminal device; determine the priority of the background programs according to the program whitelist; the programs in the program whitelist have the lowest priority; and manage the background programs according to the priority.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0203] Sort the background programs in descending order of priority; terminate the background programs in order of priority until the insufficient memory scenario is resolved.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] Obtain the running time of the target system program at the current moment; determine whether the application scenario of the terminal device is a startup scenario according to the running time.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0207] Obtain the running status of the program on the terminal device at the current moment; determine whether the application scenario of the terminal device is the program usage scenario according to the running status.
[0208] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0209] Obtain the memory status of the terminal device; determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status.
[0210] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0211] Determine the application scenario of the terminal device at the current moment; manage the programs in the terminal device according to the preset program management strategies under multiple different application scenarios; different application scenarios correspond to different program management strategies.
[0212] In one embodiment, the plurality of different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; when the computer program is executed by the processor, the following steps are further implemented:
[0213] Determine the programs in the terminal device that belong to the startup program blacklist and are in a running state; and terminate the programs in the terminal device that belong to the startup program blacklist and are in a running state.
[0214] In one embodiment, the plurality of different application scenarios include a program usage scenario, and the program management strategy in the program usage scenario includes a mutually exclusive program list; when the computer program is executed by the processor, the following steps are further implemented:
[0215] A foreground program running in the foreground is determined among the programs of the terminal device; when the foreground program is a program in a mutually exclusive program list, the programs in the terminal device are managed according to other programs in the mutually exclusive program list.
[0216] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0217] A target program matching other programs is determined in the programs of the terminal device; and when the target program is running in the background, the target program in the terminal device is terminated.
[0218] In one embodiment, the plurality of different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; when the computer program is executed by the processor, the following steps are further implemented:
[0219] Determine the background programs running in the background among the programs of the terminal device; determine the priority of the background programs according to the program whitelist; the programs in the program whitelist have the lowest priority; and manage the background programs according to the priority.
[0220] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0221] Sort the background programs in descending order of priority; terminate the background programs in order of priority until the insufficient memory scenario is resolved.
[0222] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0223] Obtain the running time of the target system program at the current moment; determine whether the application scenario of the terminal device is a startup scenario according to the running time.
[0224] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0225] Obtain the running status of the program on the terminal device at the current moment; determine whether the application scenario of the terminal device is the program usage scenario according to the running status.
[0226] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0227] Obtain the memory status of the terminal device; determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status.
[0228] It should be noted that the program information and program historical operation data involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0229] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0230] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0231] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A program management method, characterized in that: Applied to a target system program, the target system program is automatically started with a high priority when the terminal device is turned on, the method comprising: Determine the application scenario of the terminal device at the current moment; The programs in the terminal device are managed according to the preset program management strategies in multiple different application scenarios; different application scenarios correspond to different program management strategies.
2. The method according to claim 1, characterized in that: The multiple different application scenarios include a startup scenario, and the program management strategy in the startup scenario includes a startup program blacklist; and managing the programs in the terminal device according to the preset program management strategies in the multiple different application scenarios includes: Determining, from among the programs of the terminal device, a program that belongs to the startup program blacklist and is in a running state; Terminate the programs in the terminal device that are in the startup program blacklist and are in running state.
3. The method according to claim 1, characterized in that The multiple different application scenarios include program usage scenarios, and the program management strategy under the program usage scenario includes a mutually exclusive program list; managing the programs in the terminal device according to the preset program management strategy under the multiple different application scenarios includes: Determining a foreground program running in the foreground among the programs of the terminal device; In the case that the foreground program is a program in the mutually exclusive program list, the programs in the terminal device are managed according to other programs in the mutually exclusive program list.
4. The method according to claim 3, characterized in that The managing the programs in the terminal device according to other programs in the mutually exclusive program list includes: Determining a target program matching the other programs among the programs of the terminal device; When the target program is running in the background, the target program in the terminal device is terminated.
5. The method according to any one of claims 1 to 4, characterized in that The multiple different application scenarios include an insufficient memory scenario, and the program management strategy in the insufficient memory scenario includes a program whitelist; The managing the programs in the terminal device according to the preset program management strategies in multiple different application scenarios includes: Determining a background program running in the background among the programs of the terminal device; Determining the priority of the background program according to the program whitelist; the program in the program whitelist has the lowest priority; The background program is managed according to the priority.
6. The method according to claim 5, characterized in that The managing the background program according to the priority includes: Sorting the background programs according to the priority from high to low; The background programs are terminated in sequence according to the order of the background programs until the insufficient memory scenario is avoided.
7. The method according to any one of claims 1 to 4, characterized in that The determining of the application scenario of the terminal device at the current moment includes: Obtaining the running time of the target system program at the current moment; Determine whether the application scenario of the terminal device is a startup scenario according to the running time.
8. The method according to any one of claims 1 to 4, characterized in that The determining of the application scenario of the terminal device at the current moment includes: Obtaining the running status of the program on the terminal device at the current moment; Determine whether the application scenario of the terminal device is a program usage scenario according to the running status.
9. The method according to any one of claims 1 to 4, characterized in that The determining of the application scenario of the terminal device at the current moment includes: Obtaining the memory status of the terminal device; Determine whether the application scenario of the terminal device is an insufficient memory scenario according to the memory status.
10. A terminal device, characterized in that: Applied to a target system program, the target system program is automatically started with a high priority when a terminal device is turned on, the terminal device comprising: A scenario determination module is used to determine the application scenario of the terminal device at the current moment; The program management module is used to manage the programs in the terminal device according to preset program management strategies under multiple different application scenarios.