Process residency method and electronic device
By detecting the persistent conditions of processes, the application processes of electronic devices are kept alive only when necessary, which solves the problem of resource waste caused by long-term operation and improves device performance.
Patent Information
- Application Number
- PCT/CN2025/104967
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-10
- Filing Date
- 2025-06-27
- Publication Date
- 2026-01-15
AI Technical Summary
With the increasing number of applications in electronic devices, many applications consume resources even when not used for a long time after the device is turned on, leading to a decline in device performance.
By detecting the conditions for an application's process to remain resident, the process is kept alive only when the conditions are met, thus avoiding unnecessary resource overhead.
It improves application performance, avoids unnecessary resource waste and abnormal process exits, and enhances device operating efficiency.
Smart Images

Figure CN2025104967_15012026_PF_FP_ABST
Abstract
Description
Process resident methods and electronic devices
[0001] This application claims priority to Chinese patent application filed on July 10, 2024, with application number 202410924489.5 and entitled "Process-Resident Method and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a process resident method and electronic device. Background Technology
[0003] Currently, with the widespread use of mobile phones and other electronic devices, users have increasingly higher demands for device performance.
[0004] As the types of applications installed on electronic devices increase, the processes requiring maintenance also become more complex. Some applications may run continuously after the device is powered on, but these applications are not used by the user for extended periods, consuming the device's resources. Therefore, improving the performance of different applications has become a pressing technical problem to be solved. Summary of the Invention
[0005] This application provides a process-resident method and electronic device for improving application performance.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, this application provides a process persistence method applicable to electronic devices or components supporting electronic device functions (such as chip systems). The method includes: detecting that a first application meets the process persistence condition; keeping the running first process alive during the period the process persistence condition is met; and processing a first service associated with the first process through the first process. Here, the first process is the process of the first application, and the process persistence condition of the first process is related to the first service. Using this method, the electronic device can keep the first process of the first application alive during the period the process persistence condition is met. On the one hand, this avoids the system resource overhead caused by starting and keeping the process alive at boot. On the other hand, it prevents the first process from abnormally exiting when it needs to be used, thus improving the performance of the first application. Furthermore, the process persistence condition of the first process is related to the service of the first process. Thus, when the electronic device determines that the first application needs to provide a service, it determines that the first application meets the process persistence condition of the first process. In other words, in this method, the electronic device can keep the first process alive according to the characteristics of the service, provided the first application meets the process persistence condition, to prevent the first process from abnormally exiting, thereby improving the performance of the first application. For example, electronic devices can keep the first process alive during the period when it is required to provide services, in order to prevent the first process from exiting during that period and causing service failure.
[0008] In one possible design, the method further includes: the first process is already running before the first application is detected to meet the process resident condition; or, the first process is run after the first application is detected to meet the process resident condition. In this method, when the first application is detected to meet the process resident condition, the electronic device can keep the already running first process alive. Alternatively, when the first application is detected to meet the process resident condition, the electronic device first runs the first process and then keeps it alive. This can meet the need to keep the first process alive in different scenarios.
[0009] In one possible design, if a first application is detected to meet the process persistence condition, the running first process is kept alive during the period when the process persistence condition is met. This includes: detecting that the first application meets the process persistence condition of the first process and monitoring the status of the first process; detecting that the first process is destroyed and re-running the first process. In this method, when the first process of the first application exits, the electronic device re-runs the first process to ensure that the first process continues to provide services to the user during the process persistence period.
[0010] In one possible design, the process resident condition is determined based on information from system events or user profile information; the user profile information is used to characterize the user's habits of using the primary application.
[0011] In one possible design, the process persistence conditions include at least one of the following: the electronic device is located in a first location, where the first location includes at least one of the following: overseas or a location with signal quality less than a first threshold; the electronic device is connected to a first network, where the first network includes a corporate network or a home network; the current time is within a first time period; or, the user's health indicators are abnormal. Thus, the process persistence conditions may differ in different scenarios. This method can meet the process persistence requirements in different scenarios, thereby improving the performance of the corresponding applications.
[0012] This application does not impose restrictions on the conditions for processes to remain resident on demand. The solution in this application can also be used in other scenarios. For example, for instant messaging applications, considering the need to send and receive messages after connecting to the network, the processes related to sending and receiving messages can be kept resident on demand after the electronic device connects to the network, so that the process can remain resident in memory for a period of time to process related messages. One or more other processes of the instant messaging application can also remain resident at startup.
[0013] For example, in wallet applications, some processes do not need to be persistent when the device boots up. However, when a user uses certain functions of the wallet application, it can trigger the persistence of the processes corresponding to those functions.
[0014] For example, the method provided in this application can also be used in Teen Mode. For instance, in Teen Mode, the process A of application E can be configured to remain resident. For example, process A may have at least one of the following functions: limiting the usage time of specific applications and services, controlling screen usage time, or identifying malicious websites. After the electronic device is powered on, if the device detects that Teen Mode is enabled during operation, it can run process A and keep process A active. The electronic device can stop process A from remaining resident until it exits Teen Mode. For example, process A may be a process of a mobile phone manager, computer management, or antivirus software.
[0015] For example, the solution in this application can also be used in the Elder Care Mode. For instance, the above configuration file can be configured to keep process B of application F resident in Elder Care Mode. For example, process B may have at least one of the following functions: blocking specific phone calls or identifying malicious websites. Specific phone calls include, but are not limited to, sales calls and intermediary calls. After the device is powered on, if the device detects that Elder Care Mode is enabled during operation, it can trigger the revival of process B and keep process B alive. The device can stop process B from resident until it exits Elder Care Mode. For example, process B may be a process managed by a mobile phone manager or computer management system.
[0016] For example, the solution in this application can also be used in accessibility mode. After the device is powered on, if the device detects that accessibility mode is enabled during operation, it can trigger the startup of process C and keep process C alive. For example, process C can provide at least one of the following accessibility services: screen reading or text-to-speech. The device can stop process C from running until it exits accessibility mode.
[0017] In one possible design, if the first application meets the process resident condition of the first process, the first field is set to the first value, which indicates that the resident state of the first process is enabled.
[0018] In one possible design, after keeping the first running process alive, the process further includes: detecting that the first application does not meet the process resident condition, and stopping the keep-alive of the first process. The fact that the first application does not meet the process resident condition of the first process means that the first process is no longer needed to provide services. In this case, the electronic device promptly stops keeping the first process alive, which can reduce the overhead of system resources.
[0019] In one possible design, keeping the first process alive can be stopped, including: destroying the first process; or, stopping monitoring the status of the first process.
[0020] In one possible design, if the first application does not meet the process resident condition of the first process, the first field is set to the second value, which indicates that the resident status of the first process is stopped.
[0021] In one possible design, the first process is the process of a global internet application, and the process is persistent when the location of the electronic device is detected to be overseas; the first process is the process of a network application, and the process is persistent when the electronic device is connected to a first network; the first process is the process of a health application, and the process is persistent when the user's health indicators are detected to be abnormal.
[0022] In one possible design, the method further includes: launching a second process of the first application during the boot process of the electronic device; and keeping the second process alive. In this method, the second process of the first application is a process that is started and kept alive at boot, while the first process of the first application is a process kept alive on demand. It is evident that different processes of the first application correspond to different keep-alive strategies to meet the operational needs of the first application and improve its performance.
[0023] In one possible design, the first application includes at least one of the following types of applications: overseas internet access application, or office application, mobile phone manager, or computer manager.
[0024] Secondly, a method for keeping a process persistent is provided, applicable to electronic devices or components supporting their functions (such as chip systems). This method includes: obtaining the location of the electronic device; running a process for a global internet access application as a persistent process when the electronic device is located overseas; handling overseas internet access services through the process; and stopping the process from being a persistent process when the electronic device is located domestically. This method only enables the persistent running of global internet access applications such as Skyroam when they are needed, thus meeting users' internet access needs while avoiding the high resource consumption caused by the continuous persistence of global internet access applications.
[0025] One possible design is to treat the process as a resident process, including: monitoring the process's status; and restarting the process if it is detected that the process has been destroyed.
[0026] As one possible design, if the process is to be a resident process, the first field is set to the first value, which indicates that the process is enabled to be resident.
[0027] As one possible design approach, stopping the process from being a resident process could involve: destroying the process; or, stopping monitoring the process's status.
[0028] Thirdly, a method for keeping a process persistent is provided, applicable to electronic devices or components supporting electronic device functions (such as chip systems). This method includes: obtaining the network status of the electronic device; running a process of a network application based on the electronic device connecting to a first network, and keeping the process persistent; the network application is related to the first network; handling network services through the process; and stopping the process from being persistent when the electronic device disconnects from the first network. This method only enables the persistence of the network application process in network scenarios, thus satisfying the network service requirements of the network application while avoiding the high resource overhead caused by the network application process being constantly persistent.
[0029] In one possible design, the process is treated as a resident process, which includes: monitoring the process's status; and restarting the process if it is detected that the process has been destroyed.
[0030] In one possible design, where the process is a resident process, the first field is set to the first value, which indicates that the process is enabled to be resident.
[0031] In one possible design, stopping the process from being a resident process includes: destroying the process; or, stopping monitoring the process's status.
[0032] For other design methods in the second and third aspects, please refer to the relevant content in the first aspect, which will not be elaborated here.
[0033] Fourthly, the present application provides an apparatus comprising: one or more processors, a memory, and one or more computer programs; wherein the processor is coupled to the memory, and the one or more computer programs are stored in the memory; when the apparatus is running, the processor executes the one or more computer programs stored in the memory to cause the apparatus to perform the method in any of the above-described designs.
[0034] Fifthly, this application provides an apparatus including a functional module for performing the methods described in any of the possible designs of any of the above aspects of this application. This module can be implemented by software or hardware, or by a combination of software and hardware. For example, it may include a processing unit and a communication unit.
[0035] Sixthly, the present application provides a computer-readable storage medium including computer instructions that, when executed on a device, cause the device to perform any of the possible designs described above.
[0036] Seventhly, the present application provides a computer program product that, when run on a device, causes the device to perform any of the possible designs in any of the above aspects.
[0037] Eighthly, this application provides a circuit system including a processing circuit configured to perform the method in any possible design of any of the above aspects. The processing circuit can be implemented as a corresponding circuit component, such as one or more processors. Alternatively, it can be implemented as a processor and a memory. Yet another example is a processor and a transceiver.
[0038] Ninthly, this application provides a chip system including at least one processor and at least one interface circuit, the at least one interface circuit being used to perform transceiver functions and send instructions to at least one processor, and when at least one processor executes instructions, at least one processor performs a method as described in any of the above aspects and any of the designs therein. Attached Figure Description
[0039] Figure 1 is a schematic diagram of the process resident method provided by related technologies;
[0040] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0041] Figure 3A is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0042] Figure 3B is a flowchart illustrating the process resident method provided in an embodiment of this application;
[0043] Figure 4 is a schematic diagram of a scenario for the process resident method provided in an embodiment of this application;
[0044] Figure 5 is a flowchart illustrating the process resident method provided in an embodiment of this application;
[0045] Figure 6 is a schematic diagram of a scenario provided in an embodiment of this application;
[0046] Figure 7 is a schematic diagram of the interface of the process resident method provided in the embodiment of this application;
[0047] Figure 8 is a flowchart illustrating another method for process persistence provided in an embodiment of this application;
[0048] Figure 9 is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;
[0049] Figure 10 is a schematic diagram of the structure of a chip system provided in an embodiment of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two).
[0051] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0052] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0053] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information in the technical solutions of this application comply with relevant laws and regulations, do not violate public order and good morals, and do not involve privacy leaks. For example, the monitoring of application status and system status in the technical solutions of this application comply with laws and regulations and do not violate public order and good morals, which will be uniformly stated here and will not be repeated below.
[0054] "Used for" can mean "dedicated to" or "available for," without being limited to "dedicated to." For example, "The interface is used for xx" in some examples means that the interface is dedicated to xx. In other examples, the interface may have other functions besides xx, without restriction.
[0055] Currently, to ensure the normal operation of the system or to continuously provide services to users, some resident processes exist. The system keeps these resident processes alive; when a resident process is destroyed, the system re-runs it to ensure that these resident processes remain in memory. Currently, there are two types of resident mechanisms: one provided by the system, and the other implemented by third-party applications.
[0056] In the persistent mechanism provided by the system, when the device boots up, the underlying system services start the processes of applications that need to be persistent and monitor the application status. When the application process is destroyed, the device re-runs the application process to keep it alive.
[0057] In this persistent mechanism, the persistent process starts running as soon as the system boots up, and the system keeps the persistent process alive at all times.
[0058] In the persistent mechanism implemented by third-party applications, the applications can utilize system-provided components to achieve persistence. For example, a third-party application can listen for the boot broadcast and start up on system boot. After booting, the third-party application can actively start multiple services to keep it alive. If one service is cleaned up by the system, the other services can re-run the third-party application.
[0059] As can be seen, both of the above-mentioned persistent mechanisms start and keep the persistent process running when the device boots up, which can lead to resource waste in some cases. Taking an overseas internet access application as an example, as shown in Figure 1, at time t1, the device boots up. During the boot process, the device starts the overseas internet access application and keeps it running. After booting up, even if it does not need to provide services to the outside world, the overseas internet access application will still run idle, causing an increase in memory and power consumption.
[0060] Furthermore, with system version iterations and device manufacturer adaptations, third-party applications will be prohibited from listening to boot broadcasts, and background startup of third-party applications will also be prohibited. It is evident that processes implemented by third-party applications are inherently unstable and may be intercepted by the system at any time.
[0061] Therefore, embodiments of this application provide a process persistence method that supports on-demand application persistence. On-demand persistence refers to the device keeping the application's process alive when the application meets the process persistence conditions, so that the application's process remains resident in memory. In this way, the application's process is not always started and kept alive at boot time, but only kept alive when the application meets the process persistence conditions. This method is more flexible and avoids the system resource overhead caused by starting and keeping the process alive at boot time. The application's process persistence conditions are detailed below.
[0062] Applications can run as one or more processes within the software system of an electronic device. Keeping an application alive can be achieved by maintaining the application's process in memory, preventing it from being killed. This kept-alive process is called a resident process. In some solutions, when the resident process is destroyed, the system will re-run it to ensure normal system operation or continue providing services to the user.
[0063] In this embodiment of the application, the device may also be referred to as an electronic device.
[0064] Process resident conditions, also known as resident conditions, are not limited to any name.
[0065] In this embodiment, the resident process can include two types. One type is a resident process that starts automatically at boot. During the boot process, the device starts this type of resident process and keeps it active. The other type is a resident process that persists on demand. When the conditions for persisting with this type of resident process are met, the device keeps the corresponding resident process active. The specific keep-alive mechanisms for these two types of resident processes are described below.
[0066] In some embodiments, an application may include multiple processes. Some of these processes may be resident at boot time, while others may be resident on demand.
[0067] In this embodiment of the application, launching a process can also be referred to as starting a process. Launching an application can also be referred to as starting an application.
[0068] This method can be applied to electronic devices or systems containing electronic devices. For example, electronic devices can be mobile phones, tablets, laptops, desktop computers, handheld computers, netbooks, as well as artificial intelligence (AI) devices and wearable devices. This application does not limit the specific type of electronic device or the operating system installed on it.
[0069] For example, Figure 2 shows a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0070] As shown in Figure 2, the electronic device 500 may include a processor 510, a memory 520, and a display screen 530, etc.
[0071] Processor 510 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0072] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0073] The processor 510 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 510 is a cache memory. This memory can store instructions or data that the processor 510 has just used or that are used repeatedly. If the processor 510 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 510, and thus improves the efficiency of the system.
[0074] In some embodiments, the processor 510 may include one or more interfaces. These one or more interfaces can be used to connect the processor 510 to the memory 520, the display 530, and the like.
[0075] In some embodiments of this application, the processor 510 can be used to determine whether the application's resident conditions are met. The processor 510 can also be used to keep the application alive when the application's resident conditions are met.
[0076] The memory 520 can be used to store executable program code, including instructions. The memory 520 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a given function (such as image playback), etc. The data storage area may store data created during the use of the electronic device 500. The processor 510 executes various functional applications and data processing of the electronic device 500 by running instructions stored in the memory 520 and / or instructions stored in memory located within the processor.
[0077] Electronic device 500 implements display functions through a GPU, display screen 530, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 530 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 510 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0078] The display screen 530 is used to display images, videos, etc. The display screen 530 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 500 may include one or N display screens 530, where N is a positive integer greater than 1.
[0079] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than those shown in FIG. 2, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0080] Figure 3A illustrates an example architecture of a software system for an electronic device. As shown in Figure 3A, the software system may include: a configuration management module 101, an application management service 102, and a decision module 103. In this embodiment, the application management service may also be referred to as a component management service, and the name is not limited.
[0081] The configuration management module 101 can be used to configure at least one of the following: applications that support on-demand persistent operation, processes that support on-demand persistent operation, functional modules for controlling or setting the startup or shutdown of persistent operation, applications that support startup at boot, or processes that support startup at boot. For example, the functional module for controlling or setting the startup or shutdown of persistent operation can be a system service, with no limitation on its name.
[0082] In this embodiment, the application that supports on-demand persistence can also be understood or replaced as: an application set to be on-demand persistence, or an application enabled to be on-demand persistence. The application that supports startup can also be understood or replaced as: an application set to start on boot, or an application enabled to be persistent on boot. An application that starts on boot can also be understood or replaced as: an application that starts on boot and is kept alive. The process that supports on-demand persistence can also be understood or replaced as: a process set to be on-demand persistence, or a process enabled to be on-demand persistence. The process that supports startup on boot can also be understood or replaced as: a process set to start on boot, or a process enabled to be persistent on boot. A process that starts on boot can also be understood or replaced as: a process that starts on boot and is kept alive.
[0083] For example, applications A and B support on-demand process persistence. However, application C does not support on-demand process persistence. Furthermore, the following settings can be configured: if application A meets the conditions for process persistence, system service 1 controls application A to start process persistence. If application A meets the conditions for process exiting persistence, system service 1 controls application A to exit process persistence. Similarly, the following settings can be configured: if application B meets the conditions for process persistence, system service 2 controls application B to start process persistence. If application B meets the conditions for process exiting persistence, system service 2 controls application B to exit process persistence.
[0084] Exiting process persistence, also known as stopping process persistence or process exiting persistence, means that after exiting process persistence, the process is no longer a persistent process. Therefore, the process is destroyed, and the system will not re-run it. In other words, when process persistence is stopped, the electronic device does not keep the process alive.
[0085] The configuration settings described above in the configuration management module 101 can be generated into a configuration file and stored in the electronic device. For example, the configuration file can be stored in the configuration management module 101. Alternatively, the configuration file can also be stored in other storage spaces of the electronic device, without limitation. In some examples, the configuration file can also be obtained from other devices or servers, such as by distributing the configuration file from the cloud.
[0086] The configuration management module 101 can also update the above configuration files.
[0087] Decision module 103, also known as the decision core module or other names, is used to determine whether the application's resident status conditions are met. When the application meets the process resident status conditions, decision module 103 can keep the application's process resident in memory. Conversely, when the application does not meet the process resident status conditions, decision module 103 can control the application to exit process resident status.
[0088] As one possible implementation, different applications may have different process persistence conditions. Electronic devices can determine whether an application's process needs to be kept alive based on these different persistence conditions.
[0089] As one possible implementation, the decision module 103 can monitor system status by listening to events and determine whether the application meets the process persistence condition based on the system status. In some examples, the decision module 103 can register relevant system broadcasts and determine whether the application meets the process persistence condition based on the broadcasts. For example, registering location-related broadcasts and network status broadcasts. For instance, for an application accessing the internet from overseas, when the location of the electronic device changes, the system-level module sends a broadcast, which the decision module 103 listens to. If the decision module 103 determines from the broadcast that the location of the electronic device has switched to overseas, then it can determine that the overseas internet access application meets the process persistence condition. Subsequently, the decision module 103 determines by listening to system broadcasts that the location of the electronic device has switched to domestic, and accordingly determines that the overseas internet access application does not meet the process persistence condition.
[0090] Overseas internet access applications, also known as global internet access applications, are not limited by name.
[0091] For example, for office applications, the decision module 103 determines that the electronic device has successfully connected to the company Wi-Fi by listening to system broadcasts, and accordingly determines that the office application meets the conditions for process persistence. Subsequently, the decision module 103 determines that the electronic device has disconnected from the company Wi-Fi by listening to system broadcasts, and accordingly determines that the office application does not meet the conditions for process persistence.
[0092] As one possible implementation, if the application is detected to meet the conditions for process resident status, the decision module 103 can send a message to the application management service 102 to instruct or notify the application management service 102 to start process resident status.
[0093] As one possible implementation, if the application meets the conditions for exiting the process resident status, the decision module 103 can send a message to the application management service 102 to instruct or notify the application management service 102 to stop the process resident status.
[0094] As one possible implementation, decision module 103 can determine the persistent state of the application. In some examples, decision module 103 can set the field value of the persistent state of the application to true to indicate that the application's process is enabled to persist. true can also be referred to as the first value. In some examples, decision module 103 can update the field value of the persistent state of the application to false to indicate that the application's persistence is stopped. false can also be referred to as the second value. For example, the first value can also be represented as 1, and the second value can also be represented as 0. Alternatively, the first value can also be represented as 0, and the second value can also be represented as 1.
[0095] As one possible implementation, the decision module 103 may include multiple sub-modules, each used to control the persistent startup or persistent shutdown of different applications. For example, system service 1 in the decision module 103 may maintain the persistent state of application A to control its persistent startup or persistent shutdown. Similarly, system service 2 may control the persistent startup or persistent shutdown of application B.
[0096] For example, decision module 103 is a resident module in the system.
[0097] As one possible implementation, the decision module 103 can be different system services for different business operations. These system services control the persistent startup or shutdown of applications corresponding to those business operations. For example, system service 1 maintains the persistent state of application A to control its persistent startup or shutdown. Similarly, system service 2 maintains the persistent state of application B to control its persistent startup or shutdown.
[0098] Application management service 102, such as but not limited to underlying system services, can be used to manage the lifecycle of components and processes. For example, it can manage the starting and stopping of processes, and keep processes alive.
[0099] As one possible implementation, the application management service 102 can read the aforementioned configuration file and, based on the configuration file, either keep the corresponding application process alive or de-keep it alive. De-keep it alive can mean stopping the process from being kept alive.
[0100] For example, some applications are configured to start automatically upon system boot. After the electronic device boots up, the application management service 102 parses the configuration file, finds that application D needs to start automatically upon system boot, then starts application D and monitors the application status of application D in order to keep application D alive.
[0101] For example, some applications are configured to support on-demand persistence. After the electronic device is powered on and running, the application management service 102 receives a message from system service 1, which instructs the application management service 102 to enable the persistence of application A. After parsing the configuration file, the application management service 102 determines that system service 1 has the permission to enable the persistence of application A. Based on this, the application management service 102 can keep the process of application A alive, thus enabling application A to persist.
[0102] For example, application management service is a type of system service.
[0103] As one possible implementation, as shown in Figure 3B, the application management service 102 enables the application process to remain resident, thus keeping the application process alive. This can be achieved by the application management service 102 starting or registering a death listener to monitor the death or exit status of the process. Each time the application status indicates that the application process has exited, the application management service 102 restarts the application process to achieve process keep-alive. This application embodiment does not limit the specific method of implementing keep-alive.
[0104] As one possible implementation, as shown in Figure 3B, the application management service 102 stops the application process from being resident and performs a process keep-alive function. This can be achieved by the application management service 102 canceling or stopping the death monitoring to stop monitoring the death status of the process. Alternatively, it can be achieved by shutting down the process. This application embodiment does not limit the specific method of implementing the keep-alive function.
[0105] The technical solutions involved in the following embodiments can all be implemented in a device with the structure shown in Figure 2.
[0106] The technical solutions provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0107] In this embodiment, the electronic device can determine the process persistence conditions of an application and keep the application process alive if the application meets the process persistence conditions. If the application does not meet the process persistence conditions, the application process is not kept alive to prevent resource waste caused by the application process starting up on boot and being kept alive indefinitely.
[0108] Taking the example of a global internet access application like Skyroam, where the user is located overseas, as shown in Figure 4, at time t1, the electronic device is powered on but not yet started, and the Skyroam application is kept active. Subsequently, the electronic device remains overseas, and the Skyroam application meets the conditions for continuous operation. Based on the user's need for overseas internet access, to ensure service continuity, at time t2, the electronic device can enable the Skyroam application to remain active, thus keeping the already started Skyroam application alive.
[0109] In some examples, the Skyroam app is already running at or before time t2. In this case, the electronic device keeps the already running Skyroam app active from time t2 onwards. In other examples, the Skyroam app is not running at time t2. In this case, the electronic device starts the Skyroam app first and then keeps it active.
[0110] As shown in Figure 4, subsequently, when the user returns to China, the Skyroam application no longer meets the conditions for persistent processing. Since the user does not need to use the Skyroam application while accessing the internet within China, at time t3, the electronic device can stop the Skyroam application from persisting and will not keep it active.
[0111] As can be seen, in the solutions of this application embodiment, the global internet access application is only enabled to run continuously when it is needed. For example, when a user uses data traffic services abroad, the electronic device keeps the Skyroam process running continuously to avoid the problem of high resource consumption caused by the application running continuously.
[0112] The following describes some technical details involved in the above method. Taking application A and application B that support on-demand persistent operation, and application D that supports startup, as an example, Figure 5 shows an exemplary flow of the process persistent operation method of this application embodiment. The flow includes the following steps:
[0113] S101, Application Management Service obtains configuration file.
[0114] As one possible implementation, the application management service reads configuration files from the configuration management module. A detailed description of the configuration files can be found above and will not be repeated here. As mentioned above, the configuration files in the configuration management module can be pre-configured or come from the cloud; there are no restrictions.
[0115] For example, the configuration file is configured with information such as shown in Table 1 below:
[0116] Table 1
[0117] According to Table 1, applications that support startup at boot include application D. Applications that support on-demand persistence include applications A and B. System service 1 has the permission to enable and disable the persistence of application A. System service 2 has the permission to enable and disable the persistence of application B.
[0118] S102. The application management service starts application D at boot and keeps application D alive.
[0119] For example, during the application management service startup process, if the information in the configuration file shown in Table 1 is read and it is known that application D needs to be started during startup, then application D can be started during startup and kept alive.
[0120] Here, we take application D as an example for startup. This application embodiment does not limit the specific application, the number of applications, or the type of applications that can be started at startup.
[0121] S103. Application A meets the conditions for process resident status, and the decision module sends message A.
[0122] Message A instructs the capability management service to keep application A's process resident. Optionally, the decision-making module can be different for different applications.
[0123] As one possible implementation, the decision-making module can monitor events and system status, and determine whether application A meets the conditions for process persistence based on the system status. For specific implementation details, please refer to other sections of this document, such as the relevant description of scheme A in Figure 3, which will not be repeated here.
[0124] The conditions for an application's process to remain running are related to the application's business logic. Devices can determine these conditions based on the application's business requirements. Different applications may have different running conditions; this can be understood as: the running conditions may differ depending on the specific business scenario.
[0125] For example, whether an overseas internet access application needs to provide overseas internet access depends on the location of the electronic device. For instance, if a user is overseas and needs to use the overseas internet access application, then the overseas internet access application needs to run continuously to handle overseas internet access through its process. If the user is domestic, they do not need to use the overseas internet access application, and therefore, the overseas internet access application does not need to run continuously. Based on this, the condition for an overseas internet access application to run continuously could be: detecting that the electronic device is located overseas.
[0126] In this application embodiment, the overseas internet access application can also be called an overseas internet access service application, and there is no restriction.
[0127] For another example, office applications can provide office services, such as sharing company documents and picking up late-night snacks for those working overtime. These services are related to the network status of the electronic device. When the electronic device is connected to the company network, it can use the services provided by the office application within the network's coverage area. Accordingly, the office application needs to be constantly running to handle network-connected tasks. For example, while the office application is running, users can read shared documents online through it. When the electronic device disconnects from the company network, it typically doesn't need to access the services provided by the office application, and therefore, the office application doesn't need to be constantly running. Based on this, the condition for such office applications to be running continuously could be: detecting that the electronic device is connected to the company network.
[0128] The applications used for network access are not limited to office applications; they can also be other applications. In this embodiment, the application used for network access can be simply referred to as a network application, without limitation on the name. The network application with its process running continuously is related to the network to which the electronic device is connected. For example, after the electronic device is connected to the home network, it can control the devices in the home through a smart living application. In this scenario, the condition for the smart living application to run continuously can be: detecting that the electronic device is connected to the home network. For example, the home network is home Wi-Fi.
[0129] Taking application A as an example, where the corresponding decision-making module is system service 1, system service 1 detects that an electronic device has accessed the company network and determines that the office application meets the conditions for process persistence, requiring it to be kept alive. In this case, system service 1 can send message A to the application management service to instruct it to keep the office application alive.
[0130] As shown in Figure 6, the electronic device powers on at time t1. At time t2, the electronic device detects that it has accessed the company network, triggering the persistent activation of the office application to keep it running. During the period t2-t3, the multitasking interface 201 includes a card for the office application, indicating that the electronic device has kept the application running, ensuring its continued operation during this period.
[0131] S104. The application management service determines that application A is allowed to remain stationary.
[0132] As one possible implementation, based on the above configuration file, the application management service can know that application A supports on-demand persistence, and system service 1 has the permission to enable the process persistence of application A. Therefore, the application management service determines to allow application A to persist.
[0133] S105. The application management service keeps application A alive.
[0134] For a detailed description of the implementation of S105, please refer to the description of other parts of the embodiment, which will not be repeated here.
[0135] For example, if application A has not yet started, the application management service controls the startup of application A and monitors the application status of application A so that application A can be rerun after it is destroyed, thus keeping application A alive.
[0136] For example, if application A has already started, the application management service monitors the application status of application A and keeps application A alive.
[0137] S106. Application A meets the conditions for exiting the resident process, and the decision module sends message B.
[0138] Message B is used to indicate the need to stop application A from being persistent.
[0139] As one possible implementation, the decision module can monitor system events and system status, and determine whether application A meets the conditions for process exiting persistent operation based on the system status. For specific implementation details, please refer to other sections of this document, such as the relevant description of scheme A in Figure 3A, which will not be repeated here.
[0140] For example, the configuration file described above configures system service 1 to control the resident status of application A. When it is detected that application A meets the conditions for process exiting resident status, system service 1 sends message B to indicate that application A should be stopped from resident status.
[0141] The conditions for exiting the resident state correspond to the conditions for resident state. Meeting the conditions for a process to exit the resident state can be understood or replaced as: not meeting the conditions for a process to be resident.
[0142] Taking overseas internet access applications as an example, the conditions for an overseas internet access application to remain active can be: the electronic device's location is detected to be overseas. Correspondingly, the conditions for an overseas internet access application to exit active mode can be: the electronic device's location is detected to be no longer overseas, or the electronic device's location is detected to be within China, or the user is detected to have switched from overseas to within China.
[0143] Taking office applications as an example, the condition for an office application to remain running can be: detecting that an electronic device is connected to the company network. Conversely, the condition for an office application to exit the running state can be: detecting that an electronic device is disconnected from the company network.
[0144] S107. The application management service determines that application A is allowed to exit the persistent state.
[0145] As one possible implementation, based on the above configuration file, the application management service can know that system service 1 has the authority to control the stopping of application A's persistent status. Therefore, the application management service determines to allow application A to exit persistent status.
[0146] S108. Application Management Service stops application A from being permanently running.
[0147] As shown in Figure 6, at time t3, if the electronic device detects that it has disconnected from the company network, it will trigger the cessation of the persistent operation of the office application and will no longer keep the office application alive.
[0148] One possible approach is to stop the application from running continuously, which can be achieved by having the electronic device close the application. Closing the application can also be understood as the electronic device exiting the application, destroying the application, or terminating the application's process. This allows for timely application closure and effectively releases the resources occupied by the application.
[0149] Alternatively, stopping the application from being persistent can be achieved by the electronic device no longer monitoring the application's status. In this case, the electronic device does not need to immediately close the application. After the application exits, since the electronic device is no longer monitoring the application's status, it will not be relaunched.
[0150] Using this method, electronic devices can dynamically stop applications from running when they are not needed, thus preventing waste of system resources.
[0151] The above example uses the startup and persistence of application D's process and the on-demand persistence of application A's process as an example. In other embodiments, for the same application, one or more processes of the application can be persistent at startup, while other one or more processes can be persistent on demand. The process persistence condition is related to the service provided by the process. For example, for an instant messaging application, considering the need to send and receive messages after connecting to the network, the processes related to sending and receiving messages can be persistently started on demand after the electronic device connects to the network, so that the process can remain in memory for a period of time to process related messages. Another one or more processes of the instant messaging application can be persistently started at startup. As another example, for a wallet application, some processes do not need to be persistent when the device starts up. When the user uses some functions of the wallet application, it can trigger the persistence of the processes corresponding to these functions.
[0152] The solution in this application embodiment can also be applied to other scenarios where processes are persistent. Below are some examples of other scenarios where processes are persistent on demand:
[0153] For example, for applications with satellite communication capabilities, the process of such an application can remain active if the electronic device is detected to be in a location with weak or poor signal quality. When the electronic device detects a location with weak cellular signal, it can keep the process implementing satellite communication active to meet the user's communication needs. Poor signal quality refers to a signal quality below a first threshold. For example, the first threshold can be pre-configured. For instance, when a 5G phone cannot use the 5G frequency band, for example, by switching to the 4G frequency band, the signal quality of the 5G phone is determined to be poor.
[0154] The methods provided in some embodiments of this application can also be used in Teen Mode. For example, the above configuration file can be configured to keep process A of application E resident in Teen Mode. For example, process A may have at least one of the following functions: limiting the usage time of specific applications and services, controlling screen usage time, or identifying malicious websites. After the electronic device is powered on, if the electronic device detects that Teen Mode is enabled during operation, it can trigger the launch of process A and keep process A alive. The device can stop process A from resident until the electronic device exits Teen Mode. For example, process A is a process of a mobile phone manager, computer management, or antivirus software.
[0155] The solutions provided in some embodiments of this application can also be used in the Elder Care Mode. For example, the above configuration file can be configured to keep process B of application F resident in Elder Care Mode. For example, process B may have at least one of the following functions: blocking specific calls or identifying malicious websites. Specific calls include, but are not limited to, sales calls and intermediary calls. After the electronic device is powered on, if the electronic device detects that Elder Care Mode is enabled during operation, it can trigger the startup of process B and keep process B alive. The device can stop process B from resident until the electronic device exits Elder Care Mode. For example, process B is a process managed by a mobile phone manager or computer management system.
[0156] The solutions provided in some embodiments of this application can also be used in accessibility mode. After the electronic device is powered on, if the electronic device detects that accessibility mode is enabled during operation, it can trigger the startup of process C and keep process C alive. For example, process C can provide at least one of the following accessibility services: screen reading or text-to-speech. The electronic device can stop process C from running until the device exits accessibility mode.
[0157] This application also provides a method for keeping processes running in the background. Electronic devices can combine user profiles to set the conditions for keeping application processes running in the background, so as to meet the user's need to use the corresponding application on demand and to conform to the user's application usage habits.
[0158] For example, if an electronic device determines that a user frequently uses accessibility software based on user profiles, the device can set the accessibility software process as a persistent process and keep it running. User profile information is used to characterize a user's application usage habits.
[0159] For example, based on user profiles, an electronic device determines that a user will consistently use an online learning application to attend online classes during the first time period, such as daytime on weekends. The electronic device can set the condition for the online learning application to remain running on weekends. Conversely, it can set the condition for the application to exit running on weekdays. Subsequently, on weekends, if the electronic device determines that the application meets the conditions for running continuously, it will enable the corresponding process of the online learning application to remain running continuously. On weekdays, if the electronic device determines that the application meets the conditions for exiting running continuously, it will disable the corresponding process of the online learning application from running continuously.
[0160] For example, an electronic device might determine that a user's heart rate has been abnormal based on health data from their user profile. To promptly monitor the user's health, the device can set the condition for the health application to remain running indefinitely: when an abnormality in the user's health indicators is detected. This allows the device to promptly keep the health application running indefinitely after an abnormality occurs, enabling it to monitor the user's health status through this persistent application. Alternatively, the device can set the condition for exiting the health application's indefinite running state: when a user's health indicators remain consistently normal for a certain period. This allows the device to promptly stop the corresponding health application process from running indefinitely when the user's health indicators remain normal for an extended period, reducing system resource consumption.
[0161] In some embodiments, the electronic device may also provide a settings interface related to on-demand persistence. For example, as shown in Figure 7(1), the mobile phone displays interface 601, which may include a switch 602 and settings 604. When the switch 602 is turned on, enabling the scheme of this application embodiment, the mobile phone can enable or stop one or more processes of an application from persisting on demand. In some examples, in response to the user clicking on settings 604, the mobile phone may jump to interface 603 as shown in Figure 7(2). The user can set the applications that need to persist on demand through this interface. As shown in Figure 7(2), if the online course application is checked, the mobile phone can enable or stop the process of the online course application from persisting on demand. Similarly, the mobile phone can enable or stop the process of the health application from persisting on demand. Using this method, applications that need to persist on demand can be set in a personalized way to meet the user's application usage needs.
[0162] The embodiments of this application do not limit the specific conditions for process resident status. Any scheme that requires process resident status to be enabled under certain conditions is within the protection scope of this application.
[0163] For example, Figure 8 shows a flowchart of another process resident method provided in an embodiment of this application. As shown in the example of Figure 8, the method includes the following steps:
[0164] S201. The electronic device detects that the first application meets the process resident condition, and keeps the running first process alive during the period when the process resident condition is met.
[0165] The first process is the process of the first application. The conditions for the first process to remain resident are related to the business logic of the first process.
[0166] Optionally, the first process may run before the first application is detected as meeting the process resident condition. Alternatively, the first process may run after the first application is detected as meeting the process resident condition.
[0167] As one possible implementation, S201 can be implemented as follows: the electronic device detects that the first application meets the process resident condition of the first process, and listens to the status of the first process; if the first process is detected to be destroyed, the first process is restarted.
[0168] For example, the process resident condition is determined based on information from system events or user profile information; the user profile information is used to characterize the user's habits of using the first application.
[0169] S202. Electronic devices process the first service associated with the first process through the first process.
[0170] Taking the Skyroam app as an example, where the process must be kept running when the electronic device is located overseas, the electronic device determines that the Skyroam app meets the process persistence condition. During the period when the process persistence condition is met, the running Skyroam process is kept alive. Furthermore, the electronic device uses the Skyroam process to handle overseas internet access services, ensuring that users can access the internet normally while abroad.
[0171] As one possible implementation, after keeping the first running process alive, the method may further include: the electronic device detecting that the first application does not meet the process resident conditions, stopping the keeping-alive of the first process, so as to reduce the overhead of system resources.
[0172] For the specific implementation of S201 and S202, please refer to the content of other parts of the embodiment, which will not be repeated here.
[0173] The above primarily describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Based on the units and algorithm steps of the various examples described in the embodiments disclosed in this application, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by a computer driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solutions of the embodiments of this application.
[0174] This application provides embodiments for dividing an electronic device into functional modules based on the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into a single processing unit. The integrated unit can be implemented in hardware or as a software functional module. It should be noted that the unit division in this application embodiment is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used.
[0175] Figure 9 shows a schematic diagram of an electronic device provided in an embodiment of this application. This electronic device 2200 can be used to implement the methods described in the above method embodiments. For example, the electronic device 2200 may specifically include a processing unit 2201.
[0176] The processing unit 2201 is used to support the electronic device 2200 in performing any of the processing functions in Figures 1 to 8.
[0177] Optionally, the electronic device 2200 may also include a display unit 2202, which is used to support the electronic device 2200 in performing display functions.
[0178] Optionally, the electronic device 2200 shown in FIG9 may further include a communication unit (not shown in FIG9) for supporting the electronic device 2200 in performing the steps of communication between the electronic device and other electronic devices in the embodiments of this application.
[0179] Optionally, the electronic device 2200 shown in FIG9 may further include a storage unit 2203, which stores programs or instructions. When the processing unit 2201 executes the program or instructions, the electronic device 2200 shown in FIG9 can perform the method shown in the above-described method embodiment.
[0180] The technical effects of the electronic device 2200 shown in Figure 9 can be referred to the technical effects of the method shown in the above method embodiments, and will not be repeated here. The processing unit 2201 involved in the electronic device 2200 shown in Figure 9 can be implemented by a processor or processor-related circuit components, and can be a processor or processing module. The communication unit can be implemented by a transceiver or transceiver-related circuit components, and can be a transceiver or transceiver module. The display unit 2202 can be implemented by display screen-related components.
[0181] This application also provides a chip system, as shown in FIG10, which includes at least one processor 2301 and at least one interface circuit 2302. The processor 2301 and the interface circuit 2302 can be interconnected via lines. For example, the interface circuit 2302 can be used to receive signals from other devices. As another example, the interface circuit 2302 can be used to send signals to other devices (e.g., the processor 2301). Exemplarily, the interface circuit 2302 can read instructions stored in a memory and send the instructions to the processor 2301. When the instructions are executed by the processor 2301, the electronic device can perform the various steps performed by the electronic device in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application.
[0182] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0183] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor.
[0184] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0185] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0186] This application also provides a computer storage medium storing computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the above-described method embodiments.
[0187] This application provides a computer program product, which includes a computer program or instructions that, when run on a computer, cause the computer to perform the method described in the above method embodiments.
[0188] In addition, this application also provides an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the apparatus to perform the methods in the above-described method embodiments.
[0189] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0190] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0191] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The embodiments can be combined with or referenced to each other without conflict. The apparatus embodiments described above are merely illustrative; for example, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0192] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0194] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0195] The above description is only a specific implementation of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.
Claims
1. A method for keeping a process resident, characterized in that, Applied to electronic devices, the method includes: If the first application is detected to meet the process resident condition, the running first process is kept alive during the period when the process resident condition is met; the first process is the process of the first application. The first process processes the first service, wherein the process resident condition of the first process is related to the first service.
2. The method according to claim 1, characterized in that, The method further includes: The first process has been running before the first application is detected to meet the process resident condition; or, After detecting that the first application meets the conditions for process resident status, the first process is run.
3. The method according to claim 1 or 2, characterized in that, The step of detecting that the first application meets the process resident condition and keeping the running first process alive during the period when the process resident condition is met includes: If the first application is detected to meet the process resident condition of the first process, monitor the status of the first process; If the first process is detected to have been destroyed, the first process will be restarted.
4. The method according to any one of claims 1-3, characterized in that, The process resident condition is determined based on system event information or user profile information; the user profile information is used to characterize the user's habits of using the first application.
5. The method according to any one of claims 1-4, characterized in that, The conditions for a process to remain resident include at least one of the following: The electronic device is located at a first location; wherein, the first location includes at least one of the following locations: outside the territory or a location where the signal quality is less than a first threshold; The electronic device is connected to a first network; wherein the first network includes a corporate network or a home network; The current time is in the first time period; or, The user's health indicators are abnormal.
6. The method according to any one of claims 1-5, characterized in that, If the first application meets the process resident condition of the first process, the first field is set to the first value, and the first value indicates that the resident state of the first process is enabled.
7. The method according to any one of claims 1-6, characterized in that, After keeping the first running process alive, the process further includes: If the first application is detected to not meet the process resident condition, the process will be kept alive.
8. The method according to claim 7, characterized in that, Stop keeping the first process alive, including: Delete the first process; or, Stop monitoring the status of the first process.
9. The method according to claim 7 or 8, characterized in that, If the first application does not meet the process resident condition of the first process, the first field is set to the second value, which indicates that the resident status of the first process is stopped.
10. The method according to any one of claims 1-9, characterized in that, The first process is a global internet access application process, and the process remains resident under the following conditions: the location of the electronic device is detected to be overseas; or, The first process is a network application process, and the process remains resident under the following conditions: the electronic device is connected to the first network; or, The first process is a health application process; the process remains resident under the condition that abnormal user health indicators are detected.
11. A method for keeping a process resident, characterized in that, Applied to electronic devices, the method includes: Obtain the location of the electronic device; Since the electronic device is located overseas, the process running a global internet application will be designated as a persistent process. The process handles overseas internet access services. Since the electronic device is located within the territory, the process is stopped from being a resident process.
12. The method according to claim 11, characterized in that, Treating the process as a resident process includes: Monitor the status of the process; If the process is detected to have been destroyed, the process will be restarted.
13. The method according to claim 11 or 12, characterized in that, When the process is set as a resident process, the first field is set to a first value, which indicates that the process is enabled to be resident.
14. The method according to any one of claims 11-13, characterized in that, Stopping the process from being a resident process includes: Destroy the process; or, Stop monitoring the status of the process.
15. A method for keeping a process resident, characterized in that, Applied to electronic devices, the method includes: Obtain the network status of the electronic device; Based on the electronic device's connection to the first network, a process running a network application is established, and this process is designated as a persistent process; the network application is related to the first network. The process handles network services. Based on the fact that the electronic device disconnects from the first network, the process is stopped from being a resident process.
16. The method according to claim 15, characterized in that, Treating the process as a resident process includes: Monitor the status of the process; If the process is detected to have been destroyed, the process will be restarted.
17. The method according to claim 15 or 16, characterized in that, When the process is set as a resident process, the first field is set to a first value, which indicates that the process is enabled to be resident.
18. The method according to any one of claims 15-17, characterized in that, Stopping the process from being a resident process includes: Destroy the process; or, Stop monitoring the status of the process.
19. A computer-readable storage medium, characterized in that, Includes a program or instructions that, when executed, implement the method as claimed in any one of claims 1 to 18.
20. A computer program product, characterized in that, It includes a program or instructions that, when the computer program product is run on a computer, cause the computer to perform the method as described in any one of claims 1 to 18.
21. An electronic device, characterized in that, The device includes a processor and a memory, the memory being used to store computer execution instructions. When the electronic device is running, the processor executes the computer execution instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 18.
Citation Information
Patent Citations
Application process protecting method and device
CN106228064A
Method and device for application maintenance
CN108920263A
Service processing method and device
CN113296848A
Process processing method and terminal equipment
CN116088955A
Display method and electronic equipment
CN116974434A