Application management method, device, readable medium, electronic device and product

By detecting the running status and keep-alive probability of the application, and combining it with the system status of the terminal device to decide whether to keep the application running in the background, the problem of time-consuming application switching is solved and fast switching is achieved.

CN114995972BActive Publication Date: 2025-10-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210536703.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-10-10
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

The application takes a long time to switch and needs to be restarted, resulting in low switching efficiency.

Method used

By detecting the running status and keep-alive probability of the target application, combined with the system status of the terminal device, it is decided whether to keep the application running in the background to avoid restarting.

Benefits of technology

It improves the switching efficiency between applications, reduces the switching time, and enables quick entry into the target application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114995972B_ABST
    Figure CN114995972B_ABST
Patent Text Reader

Abstract

The application discloses a kind of application management method, device, readable medium, electronic equipment and product, the method includes: the running state of the target application program installed on terminal equipment is detected;The keep-alive probability of the target application program is acquired, the keep-alive probability is used to indicate the probability that the target application program continues to keep running after switching to background;If according to the running state determines that the target application program is switched to background, whether the target application program is kept in background running according to the keep-alive probability of the target application program and the system state of the terminal equipment is determined;If it is determined that the target application program needs to be kept in background running, the operation of keeping the target application program in background running is executed.The technical scheme of the present application can quickly enter the target application program when the target application program is switched to foreground again, thereby saving the time-consuming of application switching, and improving the switching efficiency between applications.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer, and particularly relates to a management method and device of application program, readable medium, electronic equipment and product. BACKGROUND

[0002] A terminal device is a common electronic device in people's daily life, which can be used for communication, entertainment and other activities. Multiple application programs (APPs) can be installed in the terminal device, and the multiple application programs can be switched. When switching from one application program to another application program, the former application program is switched to the background, and the latter application program is switched to the foreground. In order to ensure the normal use of the latter application program, the former application program is usually closed at this time. Then, in this case, when switching back from the latter application program to the former application program, the former application program needs to be restarted to re-enter the former application program because the former application program has been closed. Thus, the switching between the application programs is time-consuming and very inconvenient. SUMMARY

[0003] The present application aims to provide a management method and device of application program, readable medium, electronic equipment and product, so as to optimize the problem of low switching efficiency between application programs in the related art.

[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0005] According to an aspect of an embodiment of the present application, a management method of application program is provided, comprising:

[0006] detecting a running state of a target application program installed on a terminal device;

[0007] obtaining a keep-alive probability of the target application program, the keep-alive probability being used to represent a probability that the target application program continues to run after being switched to the background;

[0008] if it is determined that the target application program is switched to the background according to the running state, determining whether to keep the target application program running in the background according to the keep-alive probability of the target application program and a system state of the terminal device;

[0009] if it is determined that the target application program needs to be kept running in the background, performing an operation of keeping the target application program running in the background.

[0010] According to an aspect of an embodiment of the present application, a keep-alive device of application program is provided, comprising:

[0011] A program state detection module is configured to detect a running state of a target application installed on a terminal device.

[0012] A data acquisition module is configured to acquire a keep-alive probability of the target application, the keep-alive probability being used to represent a probability that the target application continues to run after being switched to the background.

[0013] A judgment module is configured to, if it is determined according to the running state that the target application is switched to the background, determine whether to keep the target application running in the background according to the keep-alive probability of the target application and a system state of the terminal device.

[0014] A keep-alive module is configured to, if it is determined that the target application needs to be kept running in the background, perform an operation of keeping the target application running in the background.

[0015] In an embodiment of the present application, the data acquisition module comprises:

[0016] A scene identification acquisition unit is configured to acquire identification information of a current running scene in the target application.

[0017] A matching unit is configured to perform matching in an application keep-alive probability list according to the identification information of the current running scene to obtain a keep-alive probability corresponding to the current running scene, the application keep-alive probability list containing an association relationship between identification information of an application running scene and a keep-alive probability.

[0018] A keep-alive probability acquisition unit is configured to take the keep-alive probability corresponding to the current running scene as the keep-alive probability of the target application.

[0019] In an embodiment of the present application, the apparatus further comprises:

[0020] A probability list acquisition module is configured to send a keep-alive probability acquisition request to a server to acquire the application keep-alive probability list fed back by the server in response to the keep-alive probability acquisition request.

[0021] In an embodiment of the present application, the apparatus further comprises:

[0022] A historical data acquisition module is configured to acquire historical running data of an application installed on the terminal device, the historical running data including historical data of whether the application is switched to the foreground again after being switched to the background in each running scene.

[0023] A scene probability calculation module is configured to calculate a keep-alive probability of the application in each running scene according to the historical running data.

[0024] The probability list building module is used to establish an association between the identification information of each running scenario and the keep-alive probability of the application in each running scenario, and generate the application keep-alive probability list.

[0025] In one embodiment of the present application, the scenario probability calculation module is specifically configured to:

[0026] Statistically processing the historical operation data to obtain a historical keep-alive probability, an occurrence probability of each operation scenario, and a conditional keep-alive probability for each operation scenario; the historical keep-alive probability indicates the probability that the application needs to remain running in the background; the conditional keep-alive probability for each operation scenario indicates the probability of each operation scenario occurring while the application remains running in the background;

[0027] The keep-alive probability of the application in each of the running scenarios is calculated according to the historical keep-alive probability, the occurrence probability of each of the running scenarios, and the conditional keep-alive probability of each of the running scenarios.

[0028] In one embodiment of the present application, the judgment module includes:

[0029] a probability threshold determination unit, configured to determine a keep-alive probability threshold according to a system state of the terminal device;

[0030] A judgment unit is used to determine that the target application needs to be kept running in the background when the survival probability of the target application is greater than the survival probability threshold; and to determine that the target application does not need to be kept running in the background when the survival probability of the target application is less than the survival probability threshold.

[0031] In one embodiment of the present application, the probability threshold determination unit is specifically configured to:

[0032] determining a system idleness level indicated by a system status of the terminal device;

[0033] The keep-alive probability threshold is determined according to the system idleness, wherein the system idleness is negatively correlated with the keep-alive probability threshold.

[0034] In one embodiment of the present application, the apparatus further comprises:

[0035] A system status detection module, configured to detect the current system status of the terminal device;

[0036] The exception handling module is used to stop executing the operation of keeping the target application running in the background if the current system status indicates that the terminal device has a performance abnormality.

[0037] In one embodiment of the present application, the apparatus further comprises:

[0038] The load reduction module is configured to perform at least one of the following operations if it is determined that the target application needs to be kept running in the background:

[0039] According to the process identification running in the target application, close other processes except for a core process, the core process being a process for maintaining the target application running in the background;

[0040] Reduce the memory occupied by the target application;

[0041] Limit the network communication of the target application.

[0042] In an embodiment of the present application, the apparatus further comprises:

[0043] A default keep-alive processing module is configured to determine whether to keep the target application running in the background according to a default keep-alive strategy of the terminal device if it is determined that the target application does not need to be kept running in the background according to the keep-alive probability of the target application and the system state of the terminal device.

[0044] In an embodiment of the present application, the default keep-alive processing module is specifically configured to:

[0045] Detect whether the target application is an application in an application white list indicated by the default keep-alive strategy;

[0046] If the target application is an application in the application white list, perform an operation of keeping the target application running in the background;

[0047] If the target application is not an application in the application white list, do not perform the operation of keeping the target application running in the background.

[0048] In an embodiment of the present application, the keep-alive module is specifically configured to:

[0049] Store running state data of the target application in a memory;

[0050] When it is detected that the target application is switched to the foreground, obtain the running state data from the memory to recover the running state of the target application according to the running state data.

[0051] According to an aspect of an embodiment of the present application, there is provided a computer readable medium having stored thereon a computer program, which, when executed by a processor, implements the application program management method in the above technical solutions.

[0052] According to an aspect of the embodiments of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor executes the executable instructions to enable the electronic device to perform the application management method in the above technical solutions.

[0053] According to an aspect of the embodiments of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the application management method in the above technical solutions.

[0054] In the technical solutions provided in the embodiments of the present application, when it is determined according to the running state of the target application that the target application is switched to the background, it is determined whether to keep the target application running in the background according to the keep-alive probability of the target application and the system state of the terminal device, which fully considers the influence of the target application itself and the system load of the terminal device on keeping the target application running in the background, and can realize the personalized needs of keeping different applications running in the background, and also avoid the influence of keeping the application running in the background on the system performance. If it is determined that the target application needs to be kept running in the background, the target application does not need to be closed, but an operation of keeping the target application running in the background is performed, which is equivalent to prolonging the running time of the target application. Then, when the target application is switched to the foreground again, the target application can be quickly entered because the target application is running, thereby saving the time consumption of application switching and improving the switching efficiency between applications.

[0055] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0056] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0057] Figure 1 An exemplary system architecture block diagram to which the technical solutions of the present application are applied is schematically shown.

[0058] Figure 2 A system architecture block diagram to which the technical solutions of the present application are applied is schematically shown.

[0059] Figure 3 A flow chart of a method for managing an application is schematically shown.

[0060] Figure 4 A flow chart of a method for managing an application is schematically shown.

[0061] Figure 5 A flow chart of a method for managing an application is schematically shown.

[0062] Figure 6 A flow chart of a method for managing an application is schematically shown.

[0063] Figure 7 A structural block diagram of a device for managing an application is schematically shown.

[0064] Figure 8 A structural block diagram of a device for managing an application is schematically shown.

[0065] Figure 9 A structural block diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0066] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the implementations set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art.

[0067] Moreover, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0068] The block diagrams in the drawings show only the functionality of the features and are not necessarily meant to imply a specific order of execution. Further, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0069] The flowchart shown in the accompanying drawings is only an exemplary illustration, and does not necessarily include all contents and operations / steps, nor does it necessarily need to be executed in the order described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to actual conditions.

[0070] It can be understood that when the above embodiments of the present application are applied to specific products or technologies, permission or consent needs to be obtained for the acquisition of relevant data, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of the country and region.

[0071] Figure 1 An exemplary system architecture block diagram to which the technical solutions of the present application are applied is schematically shown.

[0072] As shown in Figure 1 The system architecture 100 can include a terminal device 110, a network 120 and a server 130. The terminal device 110 refers to a type of device with rich human-computer interaction modes, access to the Internet, usually with various operating systems, and strong processing capabilities, which can include smartphones, tablet computers, notebook computers, smart voice interaction devices, smart home appliances, vehicle-mounted terminals, handheld game consoles, etc. The server 130 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The network 120 can be various connection types of communication media that can provide communication links between the terminal device 110 and the server 130, such as wired communication links or wireless communication links.

[0073] According to the implementation needs, the system architecture in the embodiments of the present application can have any number of terminal devices, networks and servers. For example, the server 130 can be a server group composed of multiple server devices. In addition, the technical solutions provided by the embodiments of the present application can be applied to the terminal device 110, or can be applied to the server 130, or can be jointly implemented by the terminal device 110 and the server 130, and the present application does not make special limitations on this.

[0074] For example, the application provides a management method of an application, which is executed by the terminal device 110. The terminal device 110 detects a running state of a target application installed in the terminal device 110, and obtains a keep-alive probability of the target application, the keep-alive probability being used to represent a probability that the target application continues to run after being switched to the background. The terminal device 110 can obtain the keep-alive probability of the target application from the server 130. Next, if the terminal device 110 determines that the target application is switched to the background according to the running state, the terminal device 110 determines whether to keep the target application running in the background according to the keep-alive probability and a system state of the terminal device 110. If it is determined that the target application needs to be kept running in the background, the terminal device 110 performs an operation of keeping the target application running in the background.

[0075] In one embodiment of the application, the application provides a management method of an application, which is executed by the terminal device 110 and the server 130. The terminal device 110 can send a running state of a target application to the server 130, and the server 130 determines whether the target application is switched to the background according to the running state. Alternatively, when the terminal device 110 detects whether the target application is switched to the background, the terminal device 110 sends an application switching notification to the server 130 to inform the server 130 that the target application is switched to the background. When the server 130 determines that the target application is switched to the background, the server 130 determines whether to keep the target application running in the background according to a keep-alive probability and a system state of the terminal device 110, and generates a running instruction of the target application and sends the running instruction to the terminal device 110. If the running instruction indicates that the target application needs to be kept running in the background, the terminal device 110 performs an operation of keeping the target application running in the background; if the running instruction indicates that the target application does not need to be kept running in the background, the terminal device 110 does not perform the operation of keeping the target application running in the background.

[0076] Figure 2 A system architecture block diagram to which the technical solution of the application is applied is schematically shown. As shown in Figure 2 The system architecture can include a terminal device 210, a client 220, and a server 230.

[0077] The definitions of the terminal device 210 and the server 230 are the same as those of the terminal device 110 and the server 130, respectively. Figure 1The definitions of the terminal device 110 and the server 130 in the illustrated system architecture are the same, and will not be repeated here. The client 220 refers to an application program corresponding to the server 230, which provides local services for customers, and can be installed in the terminal device 110. In the embodiments of the present application, the client 220 can be a target application program, or can be another application program different from the target application program. For example, the target application program is a game application program, and the client 220 can be a game application program (also referred to as a game client) or a game assistant application program (also referred to as a game assistant client) that provides auxiliary services for the game application program.

[0078] In the embodiments of the present application, the client 220 or the terminal device 210 obtains the keep-alive probability of the target application program from the server 230, or the server 230 periodically sends the keep-alive probability of the target application program to the client 220 or the terminal device 210. When the client 220 runs in the terminal device 210, the running state of the target application program is detected in real time. When it is determined according to the running state that the target application program is switched to the background, the client 220 requests the terminal device 210 to obtain the system state of the terminal device 210. Then, the client 220 determines whether the target application program needs to keep running in the background according to the keep-alive probability of the target application program and the system state of the terminal device 210; if the client 220 determines that the target application program needs to keep running in the background, the client 220 initiates an instruction to keep running to the terminal device 210, so that the terminal device 210 keeps the target application program running in the background, avoiding the terminal device 210 closing the client 220.

[0079] For example, the terminal device 210 is installed with a game client and a communication client, and the execution process of the embodiments of the present application will be described below taking the target application program as the game client. In the terminal device 210, first, the game client is started, and the game client runs in the foreground of the terminal device 210; then, the communication client is started, the communication client runs in the foreground of the terminal device 210, and the game client is switched to the background of the terminal device 210.

[0080] When a game client detects that it has been switched to the background based on its own running status, it obtains the system status of the terminal device 210 and determines whether it needs to remain in the background based on the system status and the keepalive probability of the terminal device 210. The keepalive probability is obtained by the terminal device 210 or the game client from the server 230. The present embodiment does not restrict the order of obtaining the keepalive probability and detecting whether the game client has been switched to the background based on the running status; these two steps can be performed simultaneously or sequentially. When obtaining the keepalive probability from the server 230, the terminal device 210 can obtain both the keepalive probability of the game client and the keepalive probability of the communication client; however, it can also obtain only the keepalive probability of the client that has been switched to the background. When obtaining the keepalive probability from the server 230, the game client can obtain only its own keepalive probability; however, it can also obtain the keepalive probability of the communication client and send the keepalive probability of the communication client to the terminal device 210 or the communication client for subsequent determination of whether the communication client should remain in the background.

[0081] When the game client determines that it needs to remain running in the background, the terminal device 210 initiates a keep-run instruction, causing the terminal device 210 to keep the game client running in the background. That is, when the communication client is running in the foreground of the terminal device 210, the game client continues to run in the background of the terminal device 210. In this way, when the game client is switched to the foreground again, the game client can be quickly accessed without restarting, which facilitates switching between clients, saves switching time, and improves switching efficiency.

[0082] When the game client is switched to the foreground again, the communication client is switched to the background. At this time, the communication client serves as the target application. The communication client or terminal device 210 can determine whether to keep the communication client running in the background through the application management method provided in the embodiment of the present application.

[0083] The following is a detailed description of the application management method provided by this application in conjunction with specific implementation methods.

[0084] Figure 3 The flowchart of the application management method provided by one embodiment of the present application is schematically shown as follows: Figure 3 As shown, the method includes steps 310 to 340, which are specifically as follows:

[0085] Step 310: Detect the running status of the target application installed on the terminal device.

[0086] Specifically, the target application can be any application installed on the terminal device. Compared with the server, the application installed on the terminal device is also called a client. For example, a game application in the terminal device can also be called a game client, and a music application can also be called a music client.

[0087] The target application's running status records whether the target application is currently in the foreground or background of the terminal device. The foreground of a terminal device refers to pages, visualization pages, etc. that can interact with the terminal device user. When the target application is in the foreground of a terminal device, it indicates that the terminal device is currently displaying the target application. The background of a terminal device refers to the program data execution page, which generally cannot be visualized for the terminal device user, but can be visualized for program management personnel such as system administrators. When the target application is in the background of a terminal device, it indicates that the terminal device is not currently displaying the target application.

[0088] In one embodiment of the present application, the running state of the target application can be represented by a state flag. That is, a foreground state flag is set when the target application is in the foreground of the terminal device, and a background state flag is set when the target application is in the background of the terminal device. For example, when the target application is in the foreground of the terminal device, the state flag is set to 1; when the target application is in the background of the terminal device, the state flag is set to 0. In this way, changes in the running state of the target application can be detected by changes in the state flag.

[0089] Step 320: Obtain the keep-alive probability of the target application. The keep-alive probability is used to indicate the probability that the target application continues to run after being switched to the background.

[0090] Specifically, the keep-alive probability represents the probability that the target application will continue to run after being switched to the background. Generally, the operation of keeping the target application running after being switched to the background is also called a keep-alive operation, so the keep-alive probability is the probability of performing the keep-alive operation on the target application.

[0091] The target application continues to run after switching to the background so that it can be quickly accessed when the target application switches back to the foreground after switching to the background. Therefore, the target application's keepalive probability actually reflects the probability of the target application switching back to the foreground after switching to the background. Generally speaking, the greater the probability of the target application switching back to the foreground after switching to the background, the greater the keepalive probability of the target application, and vice versa.

[0092] In an embodiment of the present application, the technical solution of the present application is executed by a terminal device, which can calculate the keep-alive probability of a target application according to historical running data of the target application; the terminal device can also send a keep-alive probability acquisition request to a server, and then the server feeds back the keep-alive probability of the application to the terminal device according to the keep-alive probability acquisition request.

[0093] In an embodiment of the present application, the keep-alive probability of the target application can be acquired according to a program identifier of the target application. The program identifier is identification information that can be used to distinguish different applications. For example, the program identifier can be an application ID (APP ID) of the application. A correlation relationship list can be established in advance between the program identifier of each application and the keep-alive probability corresponding to the application. When the keep-alive probability of the target application is acquired, the correlation relationship list is queried according to the program identifier of the target application, and thus the keep-alive probability of the target application can be obtained.

[0094] In step 330, if it is determined according to the running state that the target application is switched to the background, it is determined whether to keep the target application running in the background according to the keep-alive probability of the target application and the system state of the terminal device.

[0095] Specifically, the running state of the target application reflects whether the target application is switched to the background. For example, the change of a state identifier can be used to determine whether the target application is switched to the background. For example, if the state identifier changes from 1 to 0, it can be determined that the target application is switched from the foreground to the background; if the state identifier changes from 0 to 1, it can be determined that the target application is switched from the background to the foreground.

[0096] When it is determined that the target application is switched to the background, the system state of the terminal device is acquired, and then it is determined whether to keep the target application running in the background according to the system state of the terminal device and the keep-alive probability of the target application, that is, it is determined whether to perform a keep-alive operation on the target application according to the system state and the keep-alive probability.

[0097] In an embodiment of the present application, the system state of the terminal device mainly reflects the current load of the terminal device, or reflects the busy or idle degree of the system of the terminal device. The system state of the terminal device can be represented according to the usage of the CPU (Central Processing Unit), GPU (Graphics Processing Unit), memory, network, and the like of the terminal device.

[0098] When the system of the terminal device is relatively busy, the terminal device can not be able to provide sufficient resources to keep the target application running in the background, or keeping the target application running in the background will cause the running performance of the foreground running application to decrease, in which case it is not suitable to keep the target application running in the background. Therefore, whether to keep the target application running in the background can be determined in advance by the system state of the terminal device. When the system state of the terminal device indicates that the system is relatively busy, it can be considered that the target application does not need to be kept running in the background. When the system state of the terminal device indicates that the system is relatively idle, whether to keep the target application running in the background can be further determined according to the keep-alive probability of the target application. For example, when the system state of the terminal device indicates that the system is relatively idle, for a target application with a relatively small keep-alive probability (for example, the keep-alive probability is less than a preset probability threshold), it can be considered that the target application does not need to be kept running in the background; for a target application with a relatively large keep-alive probability (for example, the keep-alive probability is greater than the preset probability threshold), it can be considered that the target application needs to be kept running in the background.

[0099] In an embodiment of the present application, whether to keep the target application running in the background can be initially determined according to the keep-alive probability, and then further determined in combination with the system state of the terminal device. For example, when the keep-alive probability is less than or equal to a preset threshold, it is determined that the target application does not need to be kept running in the background. When the keep-alive probability is greater than the preset probability threshold, if the system state of the terminal device indicates that the system is relatively idle, it is determined that the target application needs to be kept running in the background; if the system state of the terminal device indicates that the system is relatively busy, the target application does not need to be kept running in the background.

[0100] Step 340: If it is determined that the target application needs to be kept running in the background, an operation of keeping the target application running in the background is performed.

[0101] Specifically, when it is determined according to the foregoing steps that the target application needs to be kept running in the background, an operation of keeping the target application running in the background is performed, that is, after the target application is switched to the background, the target application continues to be kept running.

[0102] In the technical solution provided in the embodiment of the present application, when it is determined that the target application is switched to the background based on the running status of the target application, whether to keep the target application running in the background is determined based on the target application's keep-alive probability and the system status of the terminal device. This fully considers the impact of the target application itself and the terminal device system load on keeping the target application running in the background, and can meet the personalized needs of keeping different applications running in the background. At the same time, it also avoids keeping the application running in the background and affecting system performance. If it is determined that the target application needs to be kept running in the background, there is no need to close the target application, but to perform the operation of keeping the target application running in the background, which is equivalent to extending the running time of the target application; then, when the target application is switched to the foreground again, since the target application is running, it can quickly enter the target application, thereby saving the time spent on application switching and improving the efficiency of switching between applications.

[0103] Figure 4 The flowchart of the application management method provided by one embodiment of the present application is schematically shown. This embodiment is a further refinement of the above embodiment. Figure 4 As shown, the application management method provided in the embodiment of the present application includes steps 401 to 410, which are specifically as follows:

[0104] Step 401: Detect the running status of the target application installed on the terminal device.

[0105] Specifically, the detection of the running status is the same as step 310 in the aforementioned embodiment, and will not be repeated here.

[0106] Step 402: Send a keep-alive probability acquisition request to the server to obtain an application keep-alive probability list fed back by the server in response to the keep-alive probability acquisition request.

[0107] Specifically, a keepalive probability request is used to request the server to obtain the keepalive probability of a target application. This request can be sent by either a terminal device or a client. Upon receiving the keepalive probability request, the server returns a list of application keepalive probabilities. The list contains the association between the identification information of the application's running scenario and the keepalive probability.

[0108] When the application runs on the terminal device, there are multiple running scenarios, and one running scenario corresponds to one function page of the application. For example, for a game application, there are game hall scenario, equipment setting scenario, two-player battle scenario, multi-player battle scenario, etc.; for a video application, there are application home page scenario, video playing scenario, video detailed information scenario, account login scenario, etc. The identification information of the running scenario is used to uniquely identify the running scenario, and the identification information of different running scenarios is different.

[0109] For the same target application, when switched to the background in the running scenario, the probability of switching back to the foreground is different. For example, for a game application, the probability of switching back to the foreground from the two-player battle scenario is generally greater than the probability of switching back to the foreground from the game hall scenario. Therefore, different running scenarios have different keep-alive probabilities, and the association between the identification information of the running scenario and the keep-alive probability forms the application keep-alive probability list.

[0110] In the embodiment of the present application, by dividing the target application into scenarios and setting a keep-alive probability for each running scenario of the target application, the keep-alive probability of the target application obtained subsequently can be more accurate, and thus the accuracy and precision of judging whether to keep the target application running in the background can be improved.

[0111] In one embodiment of the present application, the generation process of the application keep-alive probability list includes: obtaining historical running data of the application installed on the terminal device, the historical running data including historical data of whether the application in each running scenario is switched to the foreground again after being switched to the background; calculating the keep-alive probability of the application in each running scenario according to the historical running data; establishing an association between the identification information of each running scenario and the keep-alive probability of the application in each running scenario, and generating the application keep-alive probability list.

[0112] Specifically, the keep-alive probability of each running scenario of the application is calculated through the historical running data of the application on the terminal device, and then the identification information of each running scenario is associated with the keep-alive probability to form the application keep-alive probability list.

[0113] The historical running data of the application includes historical data of whether the application in each running scenario is switched to the foreground again after being switched to the background, i.e., historical data of the application in each running scenario being switched to the foreground again after being switched to the background, and historical data of the application in each running scenario not being switched to the foreground after being switched to the background.

[0114] In an embodiment of the present application, since the application is kept running in the background for the purpose of making it more convenient for the application to switch to the foreground again, when the application is switched to the foreground again after being switched to the background in a certain running scenario, it can be considered that the running scenario needs to be kept running in the background in this case. For ease of description, the historical data of each running scenario being switched to the foreground again after being switched to the background is referred to as the keep-alive data of each running scenario, and the historical data of each running scenario not being switched to the foreground after being switched to the background is referred to as the non-keep-alive data of each running scenario, and keeping the running scenario running in the background is referred to as keeping the running scenario alive.

[0115] Then, the keep-alive probability corresponding to a running scenario can be the proportion of the keep-alive data of the running scenario in the historical running data of the application of the running scenario. For example, a certain game application has 100 pieces of historical running data, and the keep-alive data corresponding to the game lobby scenario has 30 pieces, so the keep-alive probability corresponding to the game lobby scenario is 30%.

[0116] In an embodiment of the present application, the calculation method of the keep-alive probability corresponding to each running scenario can be: performing statistical processing on the historical running data to obtain a historical keep-alive probability, an occurrence probability of each running scenario, and a conditional keep-alive probability of each running scenario; and calculating the keep-alive probability of the application in each running scenario according to the historical keep-alive probability, the occurrence probability of each running scenario, and the conditional keep-alive probability of each running scenario.

[0117] The historical keep-alive probability represents the probability that the application needs to be kept running in the background, which is equivalent to the proportion of the keep-alive data in the historical running data of the application. For example, a certain game application has 100 pieces of historical running data, and 80 pieces of data are data being switched to the foreground again after being switched to the background, so the historical keep-alive probability of the game application is 80%.

[0118] The occurrence probability of each running scenario refers to the probability of the corresponding running scenario appearing when the application is running, which is equivalent to the proportion of the data corresponding to each running scenario in the historical running data of the application. For example, a certain game application has 100 pieces of historical running data, and 40 pieces of data are data corresponding to the game lobby scenario, so the occurrence probability of the game lobby scenario is 40%.

[0119] The conditional keep-alive probability of each running scenario represents the probability of the corresponding running scenario appearing when the application is kept running in the background, which is equivalent to the proportion of the data of each running scenario in the keep-alive data of the application. For example, the keep-alive data of a certain game application is 80 pieces of data, and the data corresponding to the game lobby scenario is 30 pieces, so the conditional keep-alive probability of the game lobby scenario is 37.5%.

[0120] After the above three parameters are obtained, the keep-alive probability corresponding to each running scenario is calculated according to the following formula:

[0121]

[0122] Wherein, P(A) is the historical keep-alive probability of the application program; P(Ci) is the occurrence probability of the running scenario Ci; P(Ci|A) is the conditional keep-alive probability of the running scenario Ci; P(A|Ci) is the keep-alive probability corresponding to the running scenario Ci.

[0123] In an embodiment of the present application, when calculating the keep-alive probability of each running scenario according to the historical running data, the keep-alive probability calculated according to the above formula and the actual keep-alive probability may differ greatly, which indicates that the division granularity of the running scenario is coarse, and the running scenario should be further subdivided to obtain more accurate data. For example, for the game hall scenario, it can be further subdivided into the scenario of just entering the game, the scenario of completing one game, the scenario of completing two games, etc. according to the game market. The keep-alive probabilities corresponding to these subdivided scenarios may differ greatly, and if they are uniformly calculated, it is easy to cause a large error.

[0124] For example, in the historical running data of the game application program given in the above embodiment, the scenario of entering the game, the scenario of completing one game, and the scenario of completing two games are uniformly regarded as the game hall scenario, and the keep-alive probability of the game hall scenario is calculated to be 75% according to the above formula. However, for the scenario of entering the game, the corresponding historical data has 10 entries, and the actual keep-alive data is only 1, so the actual keep-alive probability of this scenario is 10%. Obviously, the actual keep-alive probability 10% differs greatly from the calculated keep-alive probability 75%, and therefore, the game hall scenario needs to be further subdivided.

[0125] Step 403, obtaining the identification information of the current running scenario in the target application program.

[0126] Specifically, the current running scenario refers to the running scenario when the target application program is switched to the background, and the current running scenario is one of the running scenarios obtained after the target application program is divided into running scenarios.

[0127] Step 404, matching in the application program keep-alive probability list according to the identification information of the current running scenario to obtain the keep-alive probability corresponding to the current running scenario.

[0128] Step 405, taking the keep-alive probability corresponding to the current running scenario as the keep-alive probability of the target application program.

[0129] Specifically, after obtaining the identification information of the current running scenario, the identification information is matched in the application keep-alive probability list according to the identification information, and the keep-alive probability corresponding to the identification information in the application keep-alive probability list is found, so that the keep-alive probability corresponding to the current running scenario is obtained, and the keep-alive probability corresponding to the current running scenario is the keep-alive probability of the target application.

[0130] In step 406, if it is determined according to the running state that the target application is switched to the background, the keep-alive probability threshold is determined according to the system state of the terminal device.

[0131] Specifically, when it is detected that the target application is switched to the background, it is determined whether to keep alive the target application according to the keep-alive probability of the application. First, the keep-alive probability threshold is determined. In the embodiment of the present application, the keep-alive probability threshold is set according to the system state of the terminal device, that is, the system state of the terminal device is different, and the corresponding keep-alive probability threshold is also different.

[0132] In an embodiment of the present application, the system state of the terminal device indicates the system idle degree of the terminal device, and then the keep-alive probability threshold can be determined according to the system idle degree. Generally, the system idle degree and the keep-alive probability threshold are negatively correlated. That is, the higher the system idle degree, the smaller the corresponding keep-alive probability threshold. This also indicates that the higher the system idle degree of the terminal device, the more applications can be kept running in the background.

[0133] Exemplarily, the system idle degree of the terminal device is divided into 10 levels, wherein the first level represents the highest system idle degree, and the tenth level represents the lowest system idle degree. The relationship between the system idle degree and the keep-alive probability threshold is shown in Table 1.

[0134] Table 1 Relationship between system idle degree and keep-alive probability threshold

[0135] System idle degree Keep-alive probability threshold 1 5% 2 15% 3 25% 4 35% 5 45% 6 55% 7 65% 8 75% 9 85% 10 95%

[0136] Exemplarily, according to Table 1, if the system idle degree is level 6, the keep-alive probability threshold is 55%.

[0137] After the keep-alive probability threshold is determined, the keep-alive probability of the target application and the keep-alive probability threshold are compared. If the keep-alive probability of the target application is greater than the keep-alive probability threshold, steps 407-408 are executed; if the keep-alive probability of the target application is less than the keep-alive probability threshold, steps 409-410 are executed. It can be understood that the case where the keep-alive probability of the target application is equal to the keep-alive probability threshold can be classified into either of the two cases where the keep-alive probability is greater than the keep-alive probability threshold and the keep-alive probability is less than the keep-alive probability threshold.

[0138] Step 407: When the keep-alive probability of the target application is greater than the keep-alive probability threshold, it is determined that the target application needs to be kept running in the background.

[0139] Step 408: If it is determined that the target application needs to be kept running in the background, an operation of keeping the target application running in the background is performed.

[0140] Specifically, when the keep-alive probability of the target application is greater than the keep-alive probability threshold, it is indicated that the target application needs to be kept alive, and thus the operation of keeping the target application running in the background is performed.

[0141] In the embodiments of the present application, the keep-alive of the target application is implemented in the following two cases: the target application has a high system idle degree but a low keep-alive probability; and the target application has a low system idle degree but a high keep-alive probability.

[0142] For example, when the system idle degree is level 1, as long as the keep-alive probability of the target application is greater than 5%, the target application can be kept alive. This is because, when the system idle degree is high, it indicates that the system currently has sufficient resources available, and in this case, keeping the target application running in the background does not affect the performance of the application running in the foreground of the terminal device, and also improves the switching efficiency between applications, and there is no need to close the target application switched to the background.

[0143] For another example, when the system idle degree is level 10, only when the keep-alive probability of the target application is greater than 95%, the target application can be kept alive. This is because, when the system idle degree is low, it indicates that the system resources have been mostly occupied, and in this case, if the target application switched to the background is kept alive at will, it may affect the performance of the application running in the foreground of the terminal device, and thus the keep-alive requirement of the application is increased, i.e., the keep-alive probability threshold is increased. Then, when the target application has a high keep-alive probability, it indicates that the target application is likely to be switched back to the foreground after being switched to the background, and in order to facilitate the switching between applications, the target application can be kept alive in this case.

[0144] Therefore, the application management method provided in the embodiments of the present application comprehensively considers the influence of the system resource usage of the terminal device and the switching of the target application from the background to the foreground, and can ensure that the performance of the application running in the foreground of the terminal device is not affected when the target application is kept running in the background, and also improves the switching efficiency between applications.

[0145] In an embodiment of the present application, if it is determined that the target application needs to be kept running in the background, at least one of the following operations is performed: according to the process identification running in the target application, closing other processes except the core process; reducing the memory occupied by the target application; limiting the network communication of the target application.

[0146] Specifically, the core process of the target application is a process for maintaining the target application running in the background. By closing other processes except the core process, that is, closing unnecessary processes (or threads) of the target application. Generally, whether a process in the target application is a core process can be identified by a specific identification, for example, the core process has a first identification and the non-core process has a second identification. For example, when it is determined that the game application needs to be kept running in the background, the non-core threads such as data collection and auxiliary threads can be suspended, and the CPU and GPU loads can be reduced.

[0147] Reducing the memory occupied by the application, that is, releasing the memory that is no longer used when the target application is switched to the background, and reducing the amount of memory used by the target application as a whole.

[0148] Limiting the network communication of the target application, that is, stopping unnecessary network communication of the target application in the background except for some necessary network communication. For example, stopping other network communication of the game application in the background except for the network communication such as heartbeat packet for maintaining network connection and resource download for updating game scene. Whether the network communication is necessary can also be identified by setting an identification.

[0149] According to the above technical solutions, when it is determined that the target application needs to be kept alive, at least one of the above operations is performed to reduce the load of the target application itself, that is, to reduce the system resources required to keep the target application running in the background, thereby reducing the system burden for keeping the target application running in the background.

[0150] In an embodiment of the present application, when it is determined that the target application needs to be kept running in the background, one operation of keeping the target application alive is to store the running state data of the target application in the memory; when it is detected that the target application is switched to the foreground, the running state data is obtained from the memory to restore the running state of the target application according to the running state data.

[0151] Specifically, when it is determined that the target application needs to be kept running in the background, instead of directly keeping the target application running in the background, for a terminal device with sufficient memory space, the running state data of the target application can be stored in the memory. The memory data can be restored quickly, so that when it is detected that the target application is switched to the foreground again, the corresponding running state data can be obtained from the memory to quickly restore the running state of the target application before being switched, so that the target application can be quickly entered, and a long time-consuming of reloading the target application can be avoided.

[0152] Step 409, when the keep-alive probability of the target application is less than the keep-alive probability threshold, it is determined that the target application does not need to be kept running in the background.

[0153] Step 410, limiting the target application to run in the background.

[0154] Specifically, when the keep-alive probability of the target application is less than the keep-alive probability threshold, it indicates that the target application is less likely to be switched to the foreground after being switched to the background, and therefore, in order to save system resources, it can be considered that the target application does not need to be kept running in the background, that is, the target application is limited to run in the background, for example, the process of the target application is closed.

[0155] Figure 5 A flowchart of the application program management method provided by an embodiment of the application is schematically shown, and the embodiment is a further optimization of the above-mentioned embodiment. As shown in Figure 5 The application program management method provided by the embodiment of the application includes steps 501 to 512, and specifically as follows:

[0156] Step 501, detecting the running state of a target application installed on a terminal device.

[0157] Step 502, sending a keep-alive probability acquisition request to a server to acquire an application keep-alive probability list fed back by the server in response to the keep-alive probability acquisition request.

[0158] Step 503, acquiring identification information of a current running scene in the target application.

[0159] Step 504, matching the identification information of the current running scene in the application keep-alive probability list to obtain a keep-alive probability corresponding to the current running scene.

[0160] Step 505, taking the keep-alive probability corresponding to the current running scene as the keep-alive probability of the target application.

[0161] Step 506, if it is determined that the target application is switched to the background according to the running state, determining a keep-alive probability threshold according to the system state of the terminal device.

[0162] Step 507, when the keep-alive probability of the target application is greater than the keep-alive probability threshold, it is determined that the target application needs to be kept running in the background.

[0163] Step 508, if it is determined that the target application needs to be kept running in the background, an operation of keeping the target application running in the background is performed.

[0164] Steps 501 to 508 are the same as steps 401 to 408 in the foregoing embodiments, and will not be described here again.

[0165] Step 509, when the keep-alive probability of the target application is less than the keep-alive probability threshold, it is determined whether to keep the target application running in the background according to a default keep-alive strategy of the terminal device.

[0166] Specifically, when it is determined that the target application does not need to be kept alive according to the system state of the terminal device and the keep-alive probability of the target application, it can be further determined whether to keep the target application alive according to the default keep-alive strategy of the terminal device.

[0167] In an embodiment of the present application, the default keep-alive strategy of the terminal device is implemented through an application white list, that is, the applications in the application white list are applications that need to be kept alive, and the applications outside the application white list are applications that do not need to be kept alive. Then, the judgment process of whether the target application is kept alive is: detecting whether the target application is an application in the application white list indicated by the default keep-alive strategy; if the target application is an application in the application white list, returning to step 508; if the application is not an application in the application white list, performing step 510.

[0168] In an embodiment of the present application, the default keep-alive strategy can also be set according to the type of the application, for example, for applications of types such as playing music, voice call or map navigation, a keep-alive operation is performed, and for applications of other types, no keep-alive operation is performed.

[0169] Step 510, limiting the target application to run in the background.

[0170] Step 511, detecting the current system state of the terminal device.

[0171] Specifically, this step is after step 508, that is, after performing the operation of keeping the target application running in the background, the current system state of the terminal device is detected, so as to adjust the keep-alive strategy for the target application in real time according to the system state of the terminal device.

[0172] Step 512, judging whether the current system state indicates that the terminal device has performance abnormality, if yes, entering step 510; if no, returning to step 511.

[0173] Specifically, when the current system state indicates that the terminal device has performance abnormality, the target application program is not kept alive, that is, the target application program is limited to run in the background. The performance abnormality of the terminal device is, for example, temperature being too high, the foreground running application program having performance bottleneck (for example, lag, slow response, etc.), and system resource occupation rapidly increasing.

[0174] Figure 6 A flowchart of the application program management method provided by an embodiment of the application is schematically shown, and in the embodiment of the application, the game client 610, the game server 620 and the terminal device 630 are taken as examples to illustrate the embodiment process of the application program management method provided by the embodiment of the application.

[0175] As shown in the method, the method comprises: Figure 6

[0176] S0, the game server 620 periodically calculates the keep-alive probability corresponding to each running scene in the background offline.

[0177] Specifically, the periodicity can be daily, weekly or other set time length, etc., for example, the game server 620 calculates the keep-alive probability every morning. The game server 620 can calculate the keep-alive probability of a plurality of application programs on the terminal device 630 according to a plurality of application programs, and each application program corresponds to a plurality of running scenes. Moreover, the game server 620 establishes an association relationship between the identification information of the running scene and the corresponding keep-alive probability, and obtains an application program keep-alive probability list. Optionally, an application program keep-alive probability list can be constructed for each application program, or an application program keep-alive probability list can be constructed for all application programs.

[0178] The calculation method of the keep-alive probability corresponding to each running scene in this step can refer to the related description in step 420 in the foregoing embodiment, which will not be described here again.

[0179] S1, when the game client 610 is started, the game client 610 initiates a request to the terminal device 630 to confirm whether the current system of the terminal device 630 supports the keep-alive function.

[0180] Specifically, the current system of the terminal device 630 refers to the system currently configured by the terminal device 630, and for some systems, the application program keep-alive function can not be supported, that is, the operation of keeping the application program running in the background cannot be performed, and in this case, the keep-alive operation cannot be performed on the game client 610.

[0181] ​S2, after receiving the request initiated by the game client 610, the terminal device 630 returns a message to the game client 610 about whether the keep-alive function is supported.

[0182] S3, when the terminal device 630 supports the keep-alive function, the game client 610 sends a keep-alive probability acquisition request to the game server 620.

[0183] Specifically, the game client 610 initiates a request to the game server 620 to acquire the application keep-alive probability list.

[0184] S4, the game server 620 returns the application keep-alive probability list to the game client 610 in response to the request.

[0185] Specifically, the game server 620 returns the application keep-alive probability list calculated in the foregoing step to the game client 610.

[0186] S5, when the game client 610 is switched to the background, the game client 610 requests the terminal device 630 for the current system status.

[0187] Specifically, this step determines whether the game client 610 is switched to the background by detecting the running status of the game client 610, which can be the same as step 310 in the foregoing embodiments and will not be described here.

[0188] Meanwhile, the game client 610 requests the terminal device 630 to acquire the system status of the terminal device 630, so as to subsequently determine whether to keep the game client 610 running in the background according to the system status of the terminal device 630.

[0189] S6, after receiving the request of the game client 610, the terminal device 630 returns the current system status to the game client 610.

[0190] Specifically, the system status of the terminal device 630 includes the usage of CPU, GPU, memory, network, etc., which can be referred to the foregoing description and will not be described here.

[0191] S7, the game client 610 determines whether to perform keep-alive according to the keep-alive probability corresponding to the current running scenario and the system status of the terminal device 630, and sends a keep-alive instruction to the terminal device 630.

[0192] Specifically, game client 610 matches the current execution scenario with the application keepalive probability list obtained in the aforementioned steps to obtain the keepalive probability corresponding to the current execution scenario. After determining the keepalive probability, game client 610 determines a keepalive probability threshold based on the system idleness indicated by the system status of terminal device 630. Then, based on the relationship between the keepalive probability and the keepalive probability threshold, game client 610 determines whether keepalive is necessary. The specific process is described in the previous steps and will not be repeated here.

[0193] The keep-alive instruction is used to indicate whether the terminal device 630 keeps the game client 610 alive. It can instruct the terminal device 630 to keep the game client 610 alive, or it can instruct the terminal device 630 not to keep the game client 610 alive. In other words, regardless of whether to keep the game client 610 alive, the determination result must be notified to the terminal device 630.

[0194] S8. The terminal device 630 determines a keep-alive strategy for the game client 610.

[0195] Specifically, when the keep-alive instruction indicates that the game client 610 should be kept alive, the terminal device 630 performs an operation to keep the game client 610 running in the background. When the keep-alive instruction indicates that the game client 610 should not be kept alive, the terminal device 630 determines whether to keep the game client 610 alive according to the default keep-alive policy. The specific process can be referred to the description of the relevant steps above and will not be repeated here.

[0196] S9. The game client 610 records the actual keep-alive status of the current running scene and reports it to the game server 620.

[0197] Specifically, the actual keep-alive status of the current running scene refers to whether the game client 610 is switched to the foreground after the current running scene is switched to the background. If the game client 610 is switched to the foreground after the current running scene is switched to the background, the actual keep-alive status of the current running scene is that keep-alive is required; if the game client 610 is not switched to the foreground after the current running scene is switched to the background, the actual keep-alive status of the current running scene is that keep-alive is not required. The actual keep-alive status of the current running scene is reported to the game server 620 so that the game server 620 can update the keep-alive probability corresponding to the running scene in real time.

[0198] S10 , the game server 620 records and integrates the data reported by the game client 610 and responds to the game client 610 .

[0199] Specifically, after receiving the data reported by the game client 610, the game server 620 records and integrates the data, and then feeds back a relevant message to the game client 610, indicating that the data reported by the game client 610 has been recorded or other operations have been performed.

[0200] S11, the terminal device 630 detects the system state in real time, and sends a stop keep-alive request to the game client 610 when a performance anomaly occurs.

[0201] Specifically, after performing background keep-alive on the game client 610, the terminal device 630 detects the system state in real time, and when the system state indicates that the terminal device 630 has a performance anomaly, such as excessively high temperature, a performance bottleneck of a foreground running application, etc., the terminal device 630 needs to stop the background operation of the game client 610, and thus sends a stop keep-alive request to the game client 610.

[0202] S12, the game client 610 receives the stop keep-alive request, and responds to the request and stops running in the background.

[0203] The technical scheme provided by the embodiment of the application determines whether to keep alive the game client 610 by the keep-alive probability of the running scenario and the system state of the terminal device 630, and appropriately reduces the resource consumption of the game client 610 in the background when keeping alive, so as to balance the client use experience and system resource consumption.

[0204] It should be noted that although the steps of the method in the present application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired result. In addition or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.

[0205] The device embodiment of the present application is introduced below, which can be used to execute the application management method in the above-mentioned embodiments of the present application. Figure 7 The structural block diagram of the application management device provided by the embodiment of the present application is schematically shown. As shown in Figure 7 The application management device provided by the embodiment of the present application comprises:

[0206] The program state detection module 710 is configured to detect the running state of the target application installed on the terminal device;

[0207] The data acquisition module 720 is configured to acquire the keep-alive probability of the target application, the keep-alive probability being used to represent the probability that the target application continues to run after being switched to the background;

[0208] The judgment module 730 is configured to, if it is determined according to the running state that the target application is switched to the background, determine whether to keep the target application running in the background according to the keep-alive probability of the target application and the system state of the terminal device;

[0209] The keep-alive module 740 is configured to perform an operation of keeping the target application running in the background if it is determined that the target application needs to be kept running in the background.

[0210] In an embodiment of the present application, the data acquisition module 720 includes:

[0211] The scene identification acquisition unit is configured to acquire identification information of a current running scene in the target application.

[0212] The matching unit is configured to perform matching in an application keep-alive probability list according to the identification information of the current running scene to obtain a keep-alive probability corresponding to the current running scene, the application keep-alive probability list including an association between identification information of an application running scene and a keep-alive probability.

[0213] The keep-alive probability acquisition unit is configured to take the keep-alive probability corresponding to the current running scene as the keep-alive probability of the target application.

[0214] In an embodiment of the present application, the apparatus further includes:

[0215] The probability list acquisition module is configured to send a keep-alive probability acquisition request to a server to acquire the application keep-alive probability list fed back by the server in response to the keep-alive probability acquisition request.

[0216] In an embodiment of the present application, the apparatus further includes:

[0217] The historical data acquisition module is configured to acquire historical running data of an application installed on the terminal device, the historical running data including historical data of whether the application is switched to the foreground again after being switched to the background in each running scene.

[0218] The scene probability calculation module is configured to calculate a keep-alive probability of the application in each running scene according to the historical running data.

[0219] The probability list construction module is configured to associate identification information of each running scene with the keep-alive probability of the application in each running scene to generate the application keep-alive probability list.

[0220] In an embodiment of the present application, the scene probability calculation module is specifically configured to:

[0221] statistically process the historical running data to obtain a historical keep-alive probability, a probability of occurrence of each running scenario, and a conditional keep-alive probability of each running scenario; the historical keep-alive probability represents a probability that the application program needs to keep running in the background; the conditional keep-alive probability of each running scenario represents a probability that the each running scenario occurs when the application program keeps running in the background;

[0222] calculate the keep-alive probability of the application program in the each running scenario according to the historical keep-alive probability, the probability of occurrence of each running scenario, and the conditional keep-alive probability of each running scenario.

[0223] In an embodiment of the present application, the judging module 730 includes:

[0224] a probability threshold determining unit, configured to determine a keep-alive probability threshold according to a system state of the terminal device;

[0225] a judging unit, configured to determine that the target application program needs to keep running in the background when the keep-alive probability of the target application program is greater than the keep-alive probability threshold, and determine that the target application program does not need to keep running in the background when the keep-alive probability of the target application program is less than the keep-alive probability threshold.

[0226] In an embodiment of the present application, the probability threshold determining unit is specifically configured to:

[0227] determine a system idle degree indicated by the system state of the terminal device;

[0228] determine the keep-alive probability threshold according to the system idle degree, where the system idle degree and the keep-alive probability threshold are in a negative correlation relationship.

[0229] In an embodiment of the present application, the apparatus further includes:

[0230] a system state detecting module, configured to detect a current system state of the terminal device;

[0231] an exception processing module, configured to stop performing an operation of keeping the target application program running in the background if the current system state indicates that the terminal device has a performance exception.

[0232] In an embodiment of the present application, the apparatus further includes:

[0233] a burden reducing module, configured to perform at least one of the following operations if it is determined that the target application program needs to keep running in the background:

[0234] According to the process identification running in the target application program, other processes except a core process are closed, the core process being a process for maintaining the target application program running in the background;

[0235] The memory occupied by the target application program is reduced.

[0236] The network communication of the target application program is limited.

[0237] In an embodiment of the present application, the apparatus further comprises:

[0238] A default keep-alive processing module is configured to determine whether to maintain the target application program running in the background according to a default keep-alive strategy of the terminal device, if it is determined that the target application program does not need to be maintained running in the background according to the keep-alive probability of the target application program and the system state of the terminal device.

[0239] In an embodiment of the present application, the default keep-alive processing module is specifically configured to:

[0240] Detect whether the target application program is an application program in an application program white list indicated by the default keep-alive strategy;

[0241] If the target application program is an application program in the application program white list, an operation of maintaining the target application program running in the background is performed;

[0242] If the target application program is not an application program in the application program white list, the operation of maintaining the target application program running in the background is not performed.

[0243] In an embodiment of the present application, the keep-alive module 740 is specifically configured to:

[0244] The running state data of the target application program is stored in a memory;

[0245] When it is detected that the target application program is switched to the foreground, the running state data is acquired from the memory to recover the running state of the target application program according to the running state data.

[0246] The specific details of the keep-alive apparatus of the application program provided in the embodiments of the present application have been described in detail in the corresponding method embodiments, which will not be described here.

[0247] Figure 8 The structural block diagram of the application program management apparatus provided in an embodiment of the present application is schematically shown as Figure 8 The apparatus comprises a game client 810, a game server 820 and a terminal device 830.

[0248] The game client 810 comprises a server communication module 811, a scene identification module 812, a keep-alive strategy module 813 and a terminal interaction module 814.

[0249] The server communication module 811 is configured to communicate with the game server 820, obtain an application keep-alive probability list from the game server 820, and report historical running data of the game client 810 to the game server 820 for the game server 820 to calculate keep-alive probabilities of various running scenes.

[0250] The scene identification module 812 is configured to identify identification information of various running scenes, in particular, identification information of a current running scene when the game client 810 is switched to the background.

[0251] The keep-alive strategy module 813 is configured to match the identification information of the current running scene in the application keep-alive probability list to determine a keep-alive probability corresponding to the current running scene, and is further configured to determine whether to keep alive (i.e., keep the game client 810 running in the background) the current running scene according to the keep-alive probability corresponding to the current running scene and a system state of the terminal device 830.

[0252] Further, the keep-alive strategy module 813 is further configured to appropriately reduce a load of the game client 810 when running in the background, such as reducing non-core processes, reducing memory, limiting network communication, etc.

[0253] Further, the keep-alive strategy module 813 is further configured to stop keep-alive and actively exit the running of the game client 810 when receiving a stop keep-alive request sent by the terminal device 830 (or receiving system performance exception information sent by the terminal device 830).

[0254] The terminal interaction module 814 is configured to communicate with the terminal device 830, such as obtaining a system state of the terminal device 830, issuing a keep-alive instruction of the current running scene, receiving system state exception information of the terminal device 830, and notifying the keep-alive strategy module 813 to stop keep-alive.

[0255] The game server 820 comprises a data storage module 821, a client communication module 822 and a keep-alive probability calculation module 823.

[0256] The data storage module 821 is configured to receive data reported by the server communication module 811 of the game client 810 and store the data for use by other modules.

[0257] The client communication module 822 is configured to issue an application keep-alive probability list to the game client 810 according to a request of the game client 810.

[0258] The keep-alive probability calculation module 823 is configured to calculate the keep-alive probability corresponding to each running scenario according to the data stored in the storage module, and form an application keep-alive probability list.

[0259] The terminal device 830 includes a game interaction module 831, an exception monitoring module 832, and a background process management module 833.

[0260] The game interaction module 831 is configured to respond to a connection request of the game client 810, maintain the connection during running of the game client 810, receive a keep-alive instruction issued by the game client 810, and notify the background process management module 833 to perform keep-alive, and notify the game client 810 of a keep-alive result.

[0261] The exception monitoring module is configured to detect a system state of the terminal device 830, and notify the game client 810 to stop background keep-alive when an abnormal condition such as temperature being too high, load being too heavy, or memory being tight occurs.

[0262] The background process management module 833 is configured to perform keep-alive operation on a game process switched to the background according to the keep-alive instruction of the game interaction module 831.

[0263] Figure 9 A computer system structure block diagram of an electronic device for implementing the embodiments of the present application is schematically shown.

[0264] It should be noted that, Figure 9 The computer system 900 of the electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0265] As Figure 9 shown, the computer system 900 includes a central processing unit 901 (CPU), which can perform various appropriate actions and processes according to programs stored in a read-only memory 902 (ROM) or loaded into a random access memory 903 (RAM) from a storage portion 908. Various programs and data required for system operation are also stored in the random access memory 903. The central processing unit 901, the read-only memory 902, and the random access memory 903 are connected to each other through a bus 904. An input / output interface 905 (I / O interface) is also connected to the bus 904.

[0266] The following components are connected to the input / output interface 905: an input portion 906 including input devices such as a keyboard and mouse; an output portion 907 including output devices such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk; and a communication portion 909 including a network interface card such as a Local Area Network card, a modem, and the like. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as necessary. A removable media 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 910 as necessary, so that a computer program read therefrom is installed in the storage portion 908 as necessary.

[0267] In particular, according to embodiments of the present application, the processes described in the various method flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 909, and / or installed from the removable media 911. When the computer program is executed by the central processing unit 901, various functions defined in the system of the present application are executed.

[0268] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, device or apparatus. In this application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can send, transmit, propagate, or transport a program for use by or in connection with an instruction execution system, device or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including, but not limited to, wireless, wired, or the like, or any suitable combination thereof.

[0269] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the reverse order, depending on the functionality involved. It will also be noted that each block in the flowcharts or block diagrams and combinations of blocks in the flowcharts or block diagrams can be implemented by special-purpose hardware-based systems that perform the specified functions or operations, or combinations of special-purpose hardware and computer instructions.

[0270] It should be noted that, although several modules or units for a device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to an embodiment of the application, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into several modules or units embodied.

[0271] Those skilled in the art can easily understand, through the above description of the embodiments, that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) execute the methods according to the embodiments of the present application.

[0272] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present application cover any and all variations of the application that come within the scope of the present application, along with all of the equivalents thereof. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0273] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should be limited only by the appended claims.

Claims

1. A method for managing an application, characterized in that: include: Obtain historical running data of applications installed on the terminal device, the historical running data including historical data of whether the application was switched to the foreground again after being switched to the background in various running scenarios; Statistically processing the historical operation data to obtain a historical keep-alive probability, an occurrence probability of each operation scenario, and a conditional keep-alive probability for each operation scenario; the historical keep-alive probability indicates the probability that the application needs to remain running in the background; the conditional keep-alive probability for each operation scenario indicates the probability of each operation scenario occurring while the application remains running in the background; Calculating a keepalive probability of the application in each of the running scenarios according to the historical keepalive probability, the occurrence probability of each of the running scenarios, and the conditional keepalive probability of each of the running scenarios; If the survival probability corresponding to the operation scenario does not match the actual survival probability, the operation scenario is subdivided and the survival probability corresponding to each subdivided operation scenario is recalculated; wherein the actual survival probability includes the historical survival probability of the operation scenario; Establishing an association between the identification information of each running scenario and the keep-alive probability of the application in each running scenario, and generating an application keep-alive probability list; Detecting the running status of a target application installed on the terminal device; Obtaining a keep-alive probability of the target application according to the current running scenario of the target application and the application keep-alive probability list, where the keep-alive probability indicates a probability that the target application continues to run after being switched to the background; If it is determined according to the running state that the target application is switched to the background, determining whether to keep the target application running in the background according to the keep-alive probability of the target application and the system state of the terminal device; If it is determined that the target application needs to be kept running in the background, an operation of keeping the target application running in the background is performed.

2. The application management method according to claim 1, characterized in that: Obtaining the keep-alive probability of the target application according to the current running scenario of the target application and the application keep-alive probability list includes: Obtain identification information of the currently running scenario in the target application; Matching the identification information of the current running scenario in the application keep-alive probability list to obtain the keep-alive probability corresponding to the current running scenario, the application keep-alive probability list including the association between the identification information of the application running scenario and the keep-alive probability; The keep-alive probability corresponding to the current running scenario is used as the keep-alive probability of the target application.

3. The application management method according to claim 2, characterized in that: Before matching the application program in the application keep-alive probability list according to the identification information of the current running scenario, the method further includes: A keep-alive probability acquisition request is sent to the server to obtain the application keep-alive probability list fed back by the server in response to the keep-alive probability acquisition request.

4. The application management method according to claim 1, characterized in that: Determining whether to keep the target application running in the background according to the keep-alive probability of the target application and the system state of the terminal device includes: Determining a keep-alive probability threshold according to the system status of the terminal device; When the keep-alive probability of the target application is greater than the keep-alive probability threshold, determining that the target application needs to be kept running in the background; When the keep-alive probability of the target application is less than the keep-alive probability threshold, it is determined that there is no need to keep the target application running in the background.

5. The application management method according to claim 4, characterized in that: Determining a keep-alive probability threshold according to a system state of the terminal device includes: determining a system idleness level indicated by a system status of the terminal device; The keep-alive probability threshold is determined according to the system idleness, wherein the system idleness is negatively correlated with the keep-alive probability threshold.

6. The application management method according to claim 1, characterized in that: After executing the operation of keeping the target application running in the background, the method further includes: Detecting the current system status of the terminal device; If the current system status indicates that the terminal device has a performance abnormality, the operation of keeping the target application running in the background is stopped.

7. The application management method according to claim 1, characterized in that: The method further comprises: If it is determined that the target application needs to be kept running in the background, perform at least one of the following operations: According to the process identifier of the target application, shut down other processes except the core process, wherein the core process is a process for maintaining the target application running in the background; reducing the memory occupied by the target application; Restrict network communication of the target application.

8. The application management method according to claim 1, characterized in that: The method further comprises: If it is determined that the target application does not need to be kept running in the background according to the keep-alive probability of the target application and the system status of the terminal device, whether to keep the target application running in the background is determined according to the default keep-alive policy of the terminal device.

9. The application management method according to claim 8, characterized in that: Determining whether to keep the target application running in the background according to a default keep-alive policy of the terminal device includes: detecting whether the target application is an application in the application whitelist indicated by the default keep-alive policy; If the target application is an application in the application whitelist, executing an operation of keeping the target application running in the background; If the target application is not an application in the application whitelist, the operation of keeping the target application running in the background is not performed.

10. The application management method according to any one of claims 1 to 9, characterized in that: Performing operations to keep the target application running in the background, including: Storing the target application's running status data in a memory; When it is detected that the target application is switched to the foreground, the running state data is obtained from the memory to restore the running state of the target application according to the running state data.

11. An application management device, characterized in that: include: A historical data acquisition module is used to acquire historical operation data of applications installed on the terminal device, wherein the historical operation data includes historical data of whether the application is switched to the foreground again after being switched to the background in various operation scenarios; a scenario probability calculation module for performing statistical processing on the historical operation data to obtain a historical keep-alive probability, an occurrence probability of each operation scenario, and a conditional keep-alive probability for each operation scenario; the historical keep-alive probability indicates the probability that the application needs to remain running in the background; the conditional keep-alive probability for each operation scenario indicates the probability of each operation scenario occurring while the application remains running in the background; and the keep-alive probability of the application in each operation scenario is calculated based on the historical keep-alive probability, the occurrence probability of each operation scenario, and the conditional keep-alive probability of each operation scenario; If the survival probability corresponding to the operation scenario does not match the actual survival probability, the operation scenario is subdivided and the survival probability corresponding to each subdivided operation scenario is recalculated; wherein the actual survival probability includes the historical survival probability of the operation scenario; A probability list building module is used to establish an association relationship between the identification information of each operation scenario and the survival probability of the application in each operation scenario, and generate the application survival probability list; A program status detection module, configured to detect the running status of a target application installed on the terminal device; a data acquisition module, configured to acquire a keep-alive probability of the target application based on the current running scenario of the target application and the application keep-alive probability list, wherein the keep-alive probability indicates a probability that the target application continues to run after being switched to the background; a judgment module, configured to, if it is determined according to the running status that the target application has been switched to the background, determine whether to keep the target application running in the background according to the keep-alive probability of the target application and the system status of the terminal device; The keep-alive module is used to execute an operation of keeping the target application running in the background if it is determined that the target application needs to be kept running in the background.

12. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the application management method according to any one of claims 1 to 10.

13. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor executes the executable instructions so that the electronic device executes the application management method according to any one of claims 1 to 10.

14. A computer program product, characterized in that The computer program product includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the application management method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Terminal equipment application program management method, computer device and computer readable storage medium

    CN107957906A

  • Application program running method and device, storage medium and terminal

    CN113127094A

  • Application program safe switching method and device, equipment and storage medium

    CN113806026A