WO2022228098A1 - 应用保活方法、电子设备及存储介质 - Google Patents

应用保活方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2022228098A1
WO2022228098A1 PCT/CN2022/086101 CN2022086101W WO2022228098A1 WO 2022228098 A1 WO2022228098 A1 WO 2022228098A1 CN 2022086101 W CN2022086101 W CN 2022086101W WO 2022228098 A1 WO2022228098 A1 WO 2022228098A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
operating system
identification information
information
subscription
Prior art date
Application number
PCT/CN2022/086101
Other languages
English (en)
French (fr)
Inventor
李浩然
郭玉兵
戴志成
曾旻
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22794569.8A priority Critical patent/EP4310672A1/en
Publication of WO2022228098A1 publication Critical patent/WO2022228098A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Definitions

  • the embodiments of the present application relate to the field of electronic devices, and in particular, to an application keep-alive method, an electronic device, and a storage medium.
  • the application collaboration function refers to the function of providing services to users through collaboration between two application programs (application, App), and a rich experience can be brought to the user through the application collaboration function.
  • An application may be referred to as an application for short.
  • the first application is installed on the first device, and the second application is installed on the second device.
  • the first application and the second application can cooperate to provide services to the user, and the user can view the information in the first application on the first device through the second application on the second device .
  • the operating system of the first device may forcibly kill some applications running on the first device due to the limitation of system resources (insufficient system resources). Free up system resources.
  • the application killed by the first device includes the first application (the first application may be referred to as the associated application of the application coordination function)
  • the application coordination function between the first application and the second application will be affected, affecting the user experience .
  • the second application can register the death notification of the first application, and when the first application is killed by the first device , the second application may receive the death notification of the first application, and re-launch the second application to continue to implement the application coordination function between the first application and the second application.
  • the second application will receive the death notification of the first application only after the first application is killed. At this time, the application coordination function between the first application and the second application has been affected .
  • a heartbeat relationship may be established between the first application and the second application, and the second application may periodically send heartbeat information to the first application.
  • the operating system of the first device forcibly kills some applications running on the first device to release system resources, if the heartbeat information periodically sent by the second application to the first application is monitored, the survival time of the first application can be extended.
  • embodiments of the present application provide an application keep-alive method, an electronic device, and a storage medium.
  • the technical solutions of the embodiments of the present application can be applied to the above scenario where the application coordination function is implemented between the first application and the second application, and the survival time of the first application is extended to avoid application coordination between the first application and the second application. functionality is affected. Also, the power consumption of the device where the first application and the second application are located is low.
  • an embodiment of the present application provides an application keep-alive method, the method is applied to a first device, the first device includes a first application, and an application coordination function is provided between the first application and the second application; the method The method includes: when the first application detects that the second application acquires the first information in the first application, the first application creates a first object, and generates a unique identifier of the first object. The first application sends the unique identifier of the first object to the second application. The first application receives a subscription request sent by the second application according to the unique identifier of the first object, where the subscription request includes identification information of the second application. The first application adds the identification information of the second application to the subscription list of the first object according to the subscription request.
  • the operating system of the first device When the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object includes the identification information of the second application, the operating system of the first device extends the survival time of the first application.
  • the first device in the process of viewing the first information in the first application through the second application, when the operating system of the first device needs to forcibly kill some programs running on the first device due to the limitation of system resources, when the application releases system resources, for the first application, the first device can first query the subscription list of the first object, and if the subscription list of the first object includes the identification information of the second application, it indicates that the first application and the second application There is a coordination relationship between them, and the first device can prolong the survival time of the first application, so as to avoid the application coordination function between the first application and the second application from being affected.
  • this method can establish a cooperative relationship between the first application and the second application in a simple manner without requiring periodic heartbeats. Therefore, the power consumption of the first device and the second device may be lower. In addition, compared with the method of restarting the first application after being killed, the user experience can be better.
  • the operating system of the first device extends the survival time of the first application, including: the operating system of the first device increasing the priority of the first application among all currently running applications in the first device At least one priority, the higher the priority, the longer the application will live.
  • the operating system of the first device increases the priority of the first application in all currently running applications in the first device by at least one priority, including: the operating system of the first device The priority of the application is raised to the highest priority among all currently running applications in the first device.
  • the subscription request is sent by the second application to the first application after verifying that the second application has the permission to read the unique identifier of the first object .
  • the second application after receiving the unique identifier of the first object from the first application, the second application first verifies the unique identifier of the first object, and after confirming that the unique identifier of the first object has been read After the permission is granted, the subsequent steps (that is, sending a subscription request) can be performed to better protect user privacy.
  • the first application adds the identification information of the second application to the subscription list of the first object according to the subscription request, including: the first application verifying the first application 2. Whether the application has the right to subscribe to the first object; when the first application verifies that the second application has the right to subscribe to the first object, the first application adds the second application's subscription list to the first object's subscription list according to the subscription request. identification information.
  • the first application after the first application receives the subscription request from the second application, it first verifies the subscription request, and after confirming that the second application has the right to subscribe to the first object, and then executes the subsequent steps, which may be better. Protect user privacy.
  • the application keep-alive method involves the running data of the application, the method can realize the application keep-alive only after the user agrees and grants the corresponding permission, so as to better protect the user's privacy.
  • the method further includes: the first application receives an unsubscribe request sent by the second application according to the unique identifier of the first object, where the unsubscribe request includes the second The identification information of the application.
  • the first application deletes the identification information of the second application from the subscription list of the first object according to the unsubscribe request.
  • the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object does not include the identification information of the second application, the operating system of the first device does not need to extend the survival time of the first application.
  • the unique identifier of the first object includes device information of the first device, application information of the first application, object information of the first object, and the creation of the first object. Timestamp information at the time of the object.
  • the devices where the first application and the second application reside are the same device or different devices.
  • the second application may be installed on a second device that is different from the second device.
  • the second application may also be installed on the first device.
  • the second application includes a plurality of third applications; if the first object's subscription list includes identification information of the second application, the first device's Extending the survival time of the first application by the operating system includes: if the subscription list of the first object includes identification information of at least one third application, extending the survival time of the first application by the operating system of the first device.
  • the operating system of the first device when the operating system of the first device is limited by system resources, it is necessary to forcibly kill some applications running on the first device to release system resources
  • the operating system of the first device can first query the subscription list of the first object. If the subscription list of the first object includes the identification information of other applications, it indicates that the first object is subscribed by other applications, and the first object is subscribed by other applications. There is a synergistic relationship between an application and other applications, and the operating system of the first device can prolong the survival time of the first application.
  • an embodiment of the present application provides an apparatus for keeping an application alive.
  • the apparatus is applied to a first device, and the first device can use the apparatus to implement the function of the first application in the method for keeping the application alive in the first aspect.
  • the apparatus may include: an object management module, configured to create a first object and generate a unique identifier of the first object when it is detected that the second application acquires the first information in the first application; When the second application acquires the first information in the first application, a first object is created, and a unique identifier of the first object is generated.
  • the transceiver module is configured to send the unique identifier of the first object to the second application; and receive a subscription request sent by the second application according to the unique identifier of the first object, where the subscription request includes identification information of the second application.
  • the keep-alive management module is configured to add the identification information of the second application to the subscription list of the first object according to the subscription request.
  • the operating system of the first device When the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object includes the identification information of the second application, the operating system of the first device extends the survival time of the first application.
  • the operating system of the first device is specifically configured to increase the priority of the first application among all applications currently running in the first device by at least one priority, and the higher the priority, the longer the survival time of the application. long.
  • the operating system of the first device is specifically configured to elevate the priority of the first application among all applications currently running in the first device to the highest priority.
  • the subscription request is sent to the first application by the second application after verifying that the second application has the permission to read the unique identifier of the first object.
  • the device may further include: a permission verification module for verifying whether the second application has the right to subscribe to the first object; a keep-alive management module, which is specifically configured to verify that the second application has been verified by the permission verification module After having the right to subscribe to the first object, the identification information of the second application is added to the subscription list of the first object according to the subscription request.
  • a permission verification module for verifying whether the second application has the right to subscribe to the first object
  • a keep-alive management module which is specifically configured to verify that the second application has been verified by the permission verification module After having the right to subscribe to the first object, the identification information of the second application is added to the subscription list of the first object according to the subscription request.
  • the transceiver module is further configured to receive an unsubscribe request sent by the second application according to the unique identifier of the first object, where the unsubscribe request includes identification information of the second application.
  • the keep-alive management module is further configured to delete the identification information of the second application from the subscription list of the first object according to the unsubscribe request.
  • the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object does not include the identification information of the second application, the operating system of the first device does not need to extend the survival time of the first application.
  • the unique identifier of the first object includes device information of the first device, application information of the first application, object information of the first object, and timestamp information when the first object is created.
  • the devices where the first application and the second application are located are the same device or different devices.
  • the second application includes a plurality of third applications; the operating system of the first device is specifically configured to, if the subscription list of the first object includes identification information of at least one third application, the operating system of the first device is extended. The lifetime of the first application.
  • embodiments of the present application provide an electronic device, including: a processor; a memory; and a computer program; wherein, the computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device realizes the first
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes a computer program, and when the computer program runs on an electronic device, the electronic device enables the electronic device to implement any of the first aspect and the first aspect.
  • the embodiments of the present application further provide a computer program product, including computer-readable codes, when the computer-readable codes are run on an electronic device, the electronic device can implement any one of the first aspect and the first aspect.
  • the electronic device may be the first device mentioned in the first aspect.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a first device provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an application keep-alive method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an application keep-alive device provided by an embodiment of the present application.
  • FIG. 6 is another schematic structural diagram of the device for keeping applications alive according to an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the term “connected” includes both direct and indirect connections unless otherwise specified.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • words such as “exemplarily” or “for example” are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as “exemplarily” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplarily” or “such as” is intended to present the related concepts in a specific manner.
  • the application collaboration function refers to the function of providing services to users through collaboration between two application programs (application, App), and a rich experience can be brought to the user through the application collaboration function.
  • An application may be referred to as an application for short.
  • the first application is installed on the first device, and the second application is installed on the second device.
  • the first application and the second application can cooperate to provide services to the user, and the user can view the information in the first application on the first device through the second application on the second device .
  • the operating system of the first device may forcibly kill some applications running on the first device due to the limitation of system resources (insufficient system resources). Free up system resources. Killing an app means ending the app's process.
  • the application killed by the operating system of the first device includes the first application (the first application may be referred to as an associated application of the application coordination function), the application coordination function between the first application and the second application will be affected, affect the user experience.
  • the first device is a mobile phone
  • the first application is gallery application 1 installed on the mobile phone
  • the second device is a smart watch
  • the second application is gallery application 2 installed on the smart watch.
  • the gallery application 1 and the gallery application 2 can cooperate to provide services for the user, and the user can view the pictures in the gallery application 1 on the mobile phone through the gallery application 2 on the smart watch.
  • the operating system of the mobile phone may forcibly kill some applications running on the mobile phone to release system resources due to the limitation of system resources. If the apps killed by the mobile phone include gallery app 1, the application collaboration function between gallery app 1 and gallery app 2 will be affected, and gallery app 1 and gallery app 2 cannot continue to collaborate to provide services to users. At this time, the user's operation of viewing the pictures in the gallery application 1 on the mobile phone through the gallery application 2 on the smart watch may be forcibly interrupted, so that the user cannot continue to view the pictures in the gallery application 1 on the mobile phone through the gallery application 2 on the smart watch. pictures, which seriously affects the user experience.
  • the second application can register the death notification of the first application, and when the first application is killed by the first device , the second application may receive the death notification of the first application, and re-launch the second application to continue to implement the application coordination function between the first application and the second application.
  • the second application will receive the death notification of the first application only after the first application is killed. At this time, the application coordination function between the first application and the second application has been affected .
  • a heartbeat relationship may be established between the first application and the second application, and the second application may periodically send heartbeat information to the first application.
  • the operating system of the first device forcibly kills some applications running on the first device to release system resources, if the heartbeat information periodically sent by the second application to the first application is monitored, the survival time of the first application can be extended.
  • an embodiment of the present application provides an application keep-alive method, which can be applied to the above-mentioned scenario in which an application coordination function is implemented between the first application and the second application.
  • the method may include: when the second application receives an operation of the user viewing the first information in the first application, the second application acquires the first information from the first application and displays it to the user.
  • the first application detects that the second application acquires the first information, the first application creates the first object and generates a unique identifier of the first object. After generating the unique identifier of the first object, the first application sends (shares) the unique identifier of the first object to the second application.
  • the second application sends a subscription request to the first application according to the unique identifier of the first object.
  • the subscription request is used to indicate to the first application that the second application has subscribed to the first object, and the subscription request may include identification information of the second application.
  • the first application adds the identification information of the second application to the subscription list of the first object according to the subscription request.
  • the first application adds the identification information of the second application to the subscription list of the first object, it indicates that a collaborative relationship (or referred to as a dependency relationship) is established between the first application and the second application.
  • the operating system of the first device may first query the subscription list of the first object, and if the subscription list of the first object includes the identification information of the second application, it indicates that there is a relationship between the first application and the second application In the cooperative relationship, the operating system of the first device can prolong the survival time of the first application.
  • the application keeping method can prolong the survival time of the first application, so as to avoid the application cooperation function between the first application and the second application from being affected. Also, the power consumption of the first device and the second device may be lower.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • an application scenario of this embodiment of the present application may include: a first device 100 and a second device 200 .
  • the connection between the first device 100 and the second device 200 may be established in a wired or wireless manner.
  • the first application 110 is installed on the first device 100
  • the second application 210 is installed on the second device 200 .
  • the first application 110 and the second application 210 can cooperate to provide services for the user, and the user can view the first device 100 on the second device 200 through the second application 210 information in the first application 110 of the .
  • the wireless communication protocol adopted when the connection is established between the first device 100 and the second device 200 in a wireless manner may be a wireless fidelity (wireless fidelity, Wi-Fi) protocol, a bluetooth (bluetooth) protocol, a ZigBee protocol, A near field communication (near field communication, NFC) protocol, various cellular network protocols, etc., are not specifically limited here.
  • the above-mentioned first device 100 and/or second device 200 may be a mobile phone, a tablet computer, a handheld computer, a PC, a cellular phone, a personal digital assistant (PDA), a wearable device (such as : smart watches, smart bracelets), smart home devices (such as: TV sets), car devices (such as: car computers), smart screens, game consoles, headphones, artificial intelligence (artificial intelligence, AI) speakers, and augmented reality (augmented reality (AR)/virtual reality (virtual reality, VR) devices, etc.
  • the specific device forms of the first device 100 and the second device 200 are not particularly limited in this embodiment of the present application.
  • the device forms of the first device 100 and the second device 200 may be the same.
  • both the first device 100 and the second device 200 are mobile phones.
  • the device forms of the first device 100 and the second device 200 may also be different.
  • the first device 100 may be a mobile phone
  • the second device 200 may be a smart watch.
  • the above-mentioned first device 100 and the second device 200 may be touch screen devices or non-touch screen devices.
  • the operating system of the first device 100 and/or the second device 200 may be an AndroidTM (android) system, an iosTM system, a windowsTM system, a macTM system, a linuxTM system, or the like. More specifically, Huawei TM system, EMUITM system, Android WearTM system, Lite OSTM, TizenTM system, watch osTM system, etc. can also be used.
  • the operating systems of the first device 100 and the second device 200 may be the same. In other embodiments, the operating systems of the first device 100 and the second device 200 may also be different. This embodiment of the present application does not specifically limit the operating system of the first device 100 and/or the second device 200 .
  • the first device 100 and the second device 200 may include a memory, a processor and a display, respectively.
  • the memory may be used to store the operating system
  • the processor may be used to run the operating system stored in the memory.
  • Displays can be used to display various user interfaces (UIs).
  • the display of the first device 100 may be used to display the application interface of the first application installed on the first device 100 and the user interaction interface of the operating system of the first device 100 .
  • FIG. 2 is a schematic structural diagram of a first device according to an embodiment of the present application.
  • the first device 100 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging Management module 240, power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295 and the like.
  • SIM subscriber identification module
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller can be the nerve center and command center of the mobile phone.
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the application keep-alive method provided by the embodiments of the present application may be implemented by writing code or a program in the processor 210 .
  • the processor 210 executes the code or program
  • the first device 100 can implement the application keeping method provided by the embodiment of the present application.
  • the first application 110 in the first device 100 may implement steps such as S303, S304, and S306 shown in FIG. 3 below.
  • the operating system of the first device 100 may implement the following S307 and S308 shown in FIG. 3 .
  • the processor 210 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM interface, and/or USB interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM interface SIM interface
  • USB interface etc.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the mobile phone by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as image data, phone book, etc.) created during the use of the mobile phone.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the charging management module 240 is used to receive charging input from the charger. While the charging management module 240 charges the battery 242 , it can also supply power to the mobile phone through the power management module 241 .
  • the power management module 241 is used to connect the battery 242 , the charging management module 240 , and the processor 210 .
  • the power management module 241 can also receive the input of the battery 242 to supply power to the mobile phone.
  • the wireless communication function of the mobile phone can be realized by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in a cell phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile phone can implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor. Such as music playback, recording, etc.
  • the sensor module 280 may include a pressure sensor 280A, a gyro sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and an ambient light sensor 280L, bone conduction sensor 280M, etc.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • emitting diode, AMOLED organic light-emitting diode
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the cell phone may include one or M display screens 294, where M is a positive integer greater than one.
  • display screen 294 may be used to display a display interface for an application.
  • the mobile phone realizes the display function through the GPU, the display screen 294, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the structure shown in FIG. 2 does not constitute a specific limitation on the mobile phone.
  • the mobile phone may also include more or less components than those shown in FIG. 2 , or combine some components, or separate some components, or different component arrangements, and the like.
  • some of the components shown in FIG. 2 may be implemented in hardware, software, or a combination of software and hardware.
  • the first device 100 is a tablet computer, a handheld computer, a PC, a cellular phone, a PDA, a wearable device, a smart home device, a car device, a smart screen, a game console, an earphone, an AI speaker, and an AR/VR device, etc.
  • the specific structures of these other terminal devices can also be referred to as shown in FIG. 2 .
  • other terminal devices may have components added or reduced on the basis of the structure given in FIG. 2 , which will not be repeated here.
  • the structure of the second device 200 is the same as that of the first device 100 .
  • the structure of the second device 200 may also refer to FIG. 2, which may be based on the structure given in FIG. I will not repeat them.
  • the application types of the first application 110 and the second application 210 may be the same or different.
  • both the first application 110 and the second application 210 may be gallery applications.
  • the first application 110 may be a file management application
  • the second application 210 may be a gallery application. This application is not limited here.
  • the application keep-alive method provided by the embodiment of the present application can be applied to the application scenario shown in FIG. 1 .
  • FIG. 3 is a schematic flowchart of an application keep-alive method provided by an embodiment of the present application. As shown in FIG. 3, the method may include S301-S308.
  • the second application 210 receives an operation of a user viewing the first information in the first application 110 .
  • a first control may be provided in the application interface of the second application 210, and when the user clicks on the first control, the second application 210 may be triggered to obtain the first information from the first application 110 and display it to the user.
  • the operation of the user clicking the first control is the operation of the user viewing the first information in the first application 110 described in S301.
  • the first information refers to information contained in the first application 110 .
  • the first information may be a picture stored in the first application 110 .
  • the second application 210 acquires the first information from the first application 110, and displays it to the user.
  • S303-S304 may be performed.
  • the second application 210 may send an acquisition request for the first information to the first application 110 . After receiving the request for obtaining the first information, the first application 110 may return the first information to the second application 210 . When the first application 110 receives the request for obtaining the first information, it can be detected that the second application 210 obtains the first information.
  • the first application 110 creates a first object, and generates a unique identifier of the first object.
  • the first object may be a virtual object created by the first application 110.
  • the virtual object may be a text, a number, etc., and the virtual object may be randomly generated by the first application 110 or generated according to certain rules. limit.
  • the first object may also be created by the first application 110 according to the first information, or the first object may be the first information.
  • the first application 110 is a gallery application and the first information is picture 1 stored in the first application 110
  • the first object may be text data created according to picture 1
  • the first object may be picture 1 .
  • the unique identifier of the first object may be generated by the first application 110 according to device information of the first device 100, application information of the first application 110, object information of the first object, timestamp information when the first object is created, and the like.
  • the unique identifier of the first object may include: device information of the first device 100, application information of the first application 110, object information of the first object, and timestamp information when the first object is created.
  • the device information of the first device 100 may be a device name or a device model of the first device 100 .
  • the application information of the first application 110 may be an application name or an application type of the first application 110 .
  • the object information of the first object may be the name of the first object.
  • the first object created by the first application 110 is "Object”
  • the device model of the first device 100 is "12345”
  • the application name of the first application 110 is "photo”
  • the timestamp when the first object is created is "20201027”
  • the unique identifier of the first object may be "12345_photo_Object_20201027”.
  • the first application 110 sends the unique identifier of the first object to the second application 210 .
  • the second application 210 receives the unique identifier of the first object from the first application 110 .
  • the second application 210 sends a subscription request to the first application 110 according to the unique identifier of the first object.
  • the first application 110 receives the subscription request from the second application 210 .
  • the subscription request is used to indicate to the first application 110 that the second application 210 subscribes to the first object, and the subscription request may include identification information of the second application 210 .
  • the identification information of the second application 210 may be the name of the second application 210 .
  • the first application 110 adds the identification information of the second application 210 to the subscription list of the first object according to the subscription request.
  • the first application 110 adds the identification information of the second application 210 to the subscription list of the first object, it indicates that a collaborative relationship is established between the first application 110 and the second application 210.
  • the identification information of the second application 210 included in the subscription list of the first object may be used to instruct the first device 100 to extend the survival time of the first application 110 . For example, see S307-S308.
  • the operating system of the first device 100 queries the subscription list of the first object .
  • the Android TM system includes a lowmemorykiller component, and the lowmemorykiller component can be used to forcibly kill some applications running on the first device 100 to release system resources.
  • the subscription list of the first object includes the identification information of the second application 210
  • the operating system of the first device 100 extends the survival time of the first application 110.
  • the operating system of the first device 100 prolonging the survival time of the first application 110 may include: the operating system of the first device 100 does not forcibly kill the first application 110 .
  • the operating system of the first device 100 prolongs the survival time of the first application 110, which may also include: the operating system of the first device 100 increases the priority of the first application 110 among all currently running applications, The higher the priority, the longer the application will live.
  • the operating system of the first device 100 raises the priority of the first application 110 among all currently running applications, which may refer to: raising the priority of the first application 110 among all currently running applications to highest priority.
  • the applications currently running on the first device 100 include: application A, application B, and the first application 110 .
  • the current priorities of application A, application B, and the first application 110 are: application A is higher than application B, and application B is higher than the first application 110 .
  • the operating system of the first device 100 can adjust the priorities of the three applications as follows: the first application 110 is higher than the application A, the application A is higher than the application B, and the operating system of the first device 100 forcibly kills the application when , will kill application B first, and then kill the first application 110 last.
  • the survival time of the first application 110 may be longer.
  • the operating system of the first device 100 increases the priority of the first application 110 among all currently running applications, which may also refer to: increasing the priority of the first application 110 among all currently running applications by at least one priority.
  • the operating system of the first device 100 can adjust the priorities of these three applications as follows: application A is higher than the first application 110, and the first application 110 is higher than the application B.
  • the operating system of the first device 100 forcibly kills the application, it will kill the application B first, and then kill the application A last.
  • the survival time of the first application 110 may also be longer.
  • the embodiment of the present application does not limit the specific manner in which the operating system of the first device 100 extends the survival time of the first application 110 .
  • the operating system of the first device 100 needs to forcibly kill some applications running on the first device 100 to release system resources due to the limitation of system resources, after the operating system of the first device 100 queries the subscription list of the first object, Since the subscription list of the first object does not include the identification information of the second application 210, the operating system of the first device 100 does not need to prolong the survival time of the first application 110, for example, the first application 110 can be killed directly, or the first application 110 can be maintained. Apply the priority of 110.
  • FIG. 4 is another schematic flowchart of the method for keeping an application alive according to an embodiment of the present application. As shown in FIG. 4, the method may include S401-S405.
  • the second application 210 receives an operation of canceling viewing of the first information in the first application 110 by the user.
  • a second control may be provided in the application interface of the second application 210 , and when the user clicks the second control, the second application 210 may be triggered to stop acquiring the first information from the first application 110 .
  • the operation of the user clicking on the second control is the operation of canceling the viewing of the first information in the first application 110 by the user described in S401 .
  • the second application 210 After the second application 210 receives the operation of canceling the viewing of the first information in the first application 110 by the user, it no longer acquires the first information from the first application 110, and simultaneously executes S402.
  • the second application 210 sends an unsubscribe request to the first application 110 according to the unique identifier of the first object.
  • the first application 110 receives the unsubscribe request from the second application 210 .
  • the unsubscribe request is used to instruct the first application 110 to unsubscribe the second application 210 from the first object, and the unsubscribe request may also include identification information of the second application 210 .
  • the first application 110 deletes the identification information of the second application 210 from the subscription list of the first object according to the unsubscribe request.
  • the first application 110 After the first application 110 deletes the identification information of the second application 210 from the subscription list of the first object, it means that there is no collaborative relationship between the first application 110 and the second application 210 .
  • the subscription list of the first object no longer includes the second application 210
  • the identification information can indicate that the first device 100 does not need to extend the survival time of the first application 110 any more. For example, see S404-S405.
  • the operating system of the first device 100 does not need to extend the survival time of the first application 110.
  • the operating system of the first device 100 does not need to prolong the survival time of the first application 110, which may refer to: when the operating system of the first device 100 needs to forcibly kill the application running on the first device 100 due to the limitation of system resources. When some applications release system resources, the operating system of the first device 100 does not need to adjust the priority of the first application 110, or directly kill the first application 110.
  • the first device in the process of viewing the first information in the first application 110 through the second application 210, when the operating system of the first device 100 needs to forcibly kill the first information on the first device 100 due to the limitation of system resources
  • the first device can first query the subscription list of the first object, if the subscription list of the first object includes the identification information of the second application 210, it indicates that the There is a cooperative relationship between an application 110 and a second application 210 , and the first device 100 can prolong the survival time of the first application 110 to prevent the application cooperation function between the first application 110 and the second application 210 from being affected.
  • this method can establish a cooperative relationship between the first application 110 and the second application 210 in a simple manner without requiring periodic heartbeats. Therefore, the power consumption of the first device 100 and the second device 200 may be lower. In addition, compared with the method in which the first application 110 is re-launched after being killed, the user experience can be better.
  • the gallery application 2 can receive the user's operation of viewing pictures in the gallery application 1.
  • the gallery application 2 may acquire and display a picture from the gallery application 1 in response to the user's operation of viewing the picture in the gallery application 1 .
  • the gallery application 1 may create a first object and generate a unique identifier of the first object.
  • the gallery application 1 may send (share) the unique identifier of the first object to the gallery application 2 .
  • the gallery application 2 sends a subscription request to the gallery application 1 according to the unique identifier of the first object.
  • the gallery application 1 may add the identification information of the gallery application 2 to the subscription list of the first object according to the subscription request.
  • the gallery application 1 adds the identification information of the gallery application 2 to the subscription list of the first object, it indicates that a collaborative relationship (or referred to as a dependency relationship) is established between the gallery application 1 and the gallery application 2 .
  • the operating system of the mobile phone can first query the subscription list of the first object. If the subscription list of the first object includes the identification information of the gallery application 2, the operating system of the mobile phone can prolong the survival time of the gallery application 1.
  • the application keep-alive method can prolong the survival time of the gallery application 1, so as to avoid the application collaboration function between the gallery application 1 and the gallery application 2 from being affected, thereby ensuring user experience. Also, the power consumption of mobile phones and smart watches can be lower.
  • the second application 210 may first check the unique identifier of the first object to determine the second application 210 Whether there is permission to read the unique identifier of the first object.
  • the second application 210 determines that it has the right to read the unique identifier of the first object, the second application 210 performs subsequent steps, such as S305.
  • the permission for the second application 210 to read the unique identifier of the first object may be given to the second application 210 by the user on the second device 200 .
  • the second device 200 may display the first interface , the first interface may include prompt information: "whether to allow the second application 210 to read information from the first application 110", and a "confirm” button and a "cancel” button.
  • the second application 210 may be given the permission to read the unique identifier of the first object.
  • the second application 210 does not have the right to read the unique identifier of the first object.
  • the second application 210 after receiving the unique identifier of the first object from the first application 110, the second application 210 first verifies the unique identifier of the first object, and after confirming that it has the unique identifier for reading the first object After obtaining the permission of the identifier, you can perform the next steps to better protect the user's privacy.
  • the first application 110 may first verify the subscription request to determine whether the second application 210 has the right to subscribe to the first object.
  • the subsequent steps such as S306, are performed.
  • the permission of the second application 210 to subscribe to the first object may be given to the second application 210 by the user on the first device 100 .
  • the first device 100 may display the second interface, in which the second interface It may include prompt information: "whether to allow the second application 210 to subscribe to the first object", and a "confirm” button and a "cancel” button.
  • the second application 210 may be given the right to subscribe to the first object.
  • the second application 210 does not have the right to subscribe to the first object.
  • the first application 110 will not perform subsequent steps.
  • the first application 110 after receiving the subscription request from the second application 210, the first application 110 first verifies the subscription request, and after confirming that the second application 210 has the right to subscribe to the first object, the subsequent steps are performed. User privacy can be better protected.
  • the application keep-alive method provided by the embodiment of the present application involves the running data of the application, the method can realize the application keep-alive only after the user agrees and grants corresponding permissions, so as to better protect the user's privacy.
  • the above embodiments mainly describe the specific implementation process of the application keep-alive method provided by the embodiments of the present application in the application scenario shown in FIG. 1 .
  • the first application 110 and the second application 210 are respectively installed on two different devices (the first device 100 and the second device 200 ).
  • the application keep-alive method provided in the embodiment of the present application is also applicable to two applications installed on the same device to achieve keep-alive.
  • the specific process is similar to the interaction process between the first application 110 and the second application 210 described in the foregoing embodiment, and will not be repeated.
  • the embodiments of the present application are described by taking the implementation of the application coordination function between the first application and the second application as an example, it should be understood that the application that realizes the coordination function with the first application may include multiple. Each application can implement a collaboration function with the first application, and subscribe to the first object created by the first application according to the process described in the foregoing embodiment. The first application may add the identification information of all applications that have subscribed to the first object to the subscription list of the first object.
  • the operating system of the first device when the operating system of the first device (or the device where the first application is located) needs to be forcibly killed due to the limitation of system resources, running on the first device
  • the operating system of the first device can first query the subscription list of the first object, and if the subscription list of the first object includes the identification information of other applications, it indicates that the first application
  • the object is subscribed by other applications, there is a cooperative relationship between the first application and other applications, and the operating system of the first device can prolong the survival time of the first application.
  • the aforementioned second application may include multiple applications (such as third applications).
  • third applications When some applications release system resources, if the subscription list of the first object includes the identification information of at least one third application, it indicates that the first object is subscribed by the third application, and there is a relationship between the first application and the third application. In the cooperative relationship, the operating system of the first device can prolong the survival time of the first application.
  • the third application may be referred to as a subscriber.
  • the technical solution of the embodiment of the present application can actually be understood as: when another application reads (obtains) the first information , the first application records the identification information of other applications in the subscription list of the first object (for details, refer to the foregoing embodiment). If the subscription list of the first object includes identification information of other applications, it indicates that the first information is being read by other applications. so.
  • the survival time of the first application may be appropriately extended.
  • the embodiment of the present application further provides an application keep-alive device, and the device can be applied to the first device, for example, the device can be shared with the first application in the form of code. Deployed in the aforementioned first device, the first device can call the code to implement the function of the first application in the aforementioned application keep-alive method. There is an application coordination function between the first application and the second application.
  • FIG. 5 is a schematic structural diagram of an application keep-alive device provided by an embodiment of the present application. As shown in Figure 5, the apparatus may include:
  • the object management module 501 is configured to create a first object when it is detected that the second application acquires the first information in the first application, and generate a unique identifier of the first object; for detecting that the second application acquires the first information; When the first information in an application is used, a first object is created, and a unique identifier of the first object is generated.
  • the transceiver module 502 is configured to send the unique identifier of the first object to the second application; and receive a subscription request sent by the second application according to the unique identifier of the first object, where the subscription request includes identification information of the second application.
  • the keep-alive management module 503 is configured to add the identification information of the second application to the subscription list of the first object according to the subscription request.
  • the operating system of the first device When the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object includes the identification information of the second application, the operating system of the first device extends the survival time of the first application.
  • the operating system of the first device is specifically configured to increase the priority of the first application among all applications currently running in the first device by at least one priority, and the higher the priority, the longer the survival time of the application. long.
  • the operating system of the first device is specifically configured to elevate the priority of the first application among all applications currently running in the first device to the highest priority.
  • the subscription request is sent to the first application by the second application after verifying that the second application has the permission to read the unique identifier of the first object.
  • FIG. 6 is another schematic structural diagram of the device for keeping an application alive according to an embodiment of the present application.
  • the apparatus may further include: a permission checking module 504 for checking whether the second application has permission to subscribe to the first object; After verifying that the second application has the right to subscribe to the first object, the identification information of the second application is added to the subscription list of the first object according to the subscription request.
  • the transceiver module 502 is further configured to receive an unsubscribe request sent by the second application according to the unique identifier of the first object, where the unsubscribe request includes identification information of the second application.
  • the keep-alive management module 503 is further configured to delete the identification information of the second application from the subscription list of the first object according to the unsubscribe request.
  • the operating system of the first device needs to forcibly kill some applications running on the first device to release system resources due to the limitation of system resources, for the first application, the operating system of the first device queries the subscription list of the first object , if the subscription list of the first object does not include the identification information of the second application, the operating system of the first device does not need to extend the survival time of the first application.
  • the unique identifier of the first object includes device information of the first device, application information of the first application, object information of the first object, and timestamp information when the first object is created.
  • the devices where the first application and the second application are located are the same device or different devices.
  • the second application includes a plurality of third applications; the operating system of the first device is specifically configured to, if the subscription list of the first object includes identification information of at least one third application, the operating system of the first device is extended. The lifetime of the first application.
  • units in the above apparatus is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated.
  • all the units in the device can be realized in the form of software calling through the processing element; also can all be realized in the form of hardware; some units can also be realized in the form of software calling through the processing element, and some units can be realized in the form of hardware.
  • each unit can be a separately established processing element, or can be integrated in a certain chip of the device to be implemented, and can also be stored in the memory in the form of a program, which can be called by a certain processing element of the device and execute the unit's processing. Function.
  • all or part of these units can be integrated together, and can also be implemented independently.
  • the processing element described here may also be called a processor, which may be an integrated circuit with signal processing capability.
  • each step of the above method or each of the above units may be implemented by an integrated logic circuit of hardware in the processor element or implemented in the form of software being invoked by the processing element.
  • the units in the above apparatus may be one or more integrated circuits configured to implement the above method, eg, one or more application specific integrated circuits (ASICs), or, one or more A digital signal processor (DSP), or, one or more field programmable gate arrays (FPGA), or a combination of at least two of these integrated circuit forms.
  • ASICs application specific integrated circuits
  • DSP digital signal processor
  • FPGA field programmable gate arrays
  • the processing element can be a general-purpose processor, such as a CPU or other processors that can invoke programs.
  • these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • the unit of the above apparatus for implementing each corresponding step in the above method may be implemented in the form of a processing element scheduler.
  • the apparatus may include a processing element and a storage element, and the processing element invokes a program stored in the storage element to execute the method described in the above method embodiments.
  • the storage element may be a storage element on the same chip as the processing element, ie, an on-chip storage element.
  • the program for performing the above method may be in a storage element on a different chip from the processing element, ie, an off-chip storage element.
  • the processing element calls or loads the program from the off-chip storage element to the on-chip storage element, so as to call and execute the methods described in the above method embodiments.
  • an embodiment of the present application may further provide an apparatus, such as an electronic device, which may include a processor, and a memory for storing instructions executable by the processor.
  • an electronic device which may include a processor, and a memory for storing instructions executable by the processor.
  • the processor When the processor is configured to execute the above-mentioned instructions, the electronic device implements the application keep-alive method described in the foregoing embodiments.
  • the memory may be located within the electronic device or external to the electronic device.
  • the processor includes one or more.
  • the electronic device may be the above-mentioned first device.
  • the unit of the apparatus implementing each step in the above method may be configured as one or more processing elements, where the processing elements may be integrated circuits, such as: one or more ASICs, or, one or more Multiple DSPs, or, one or more FPGAs, or a combination of these types of integrated circuits. These integrated circuits can be integrated together to form chips.
  • an embodiment of the present application further provides a chip, which can be applied to the above-mentioned electronic device.
  • the chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit, so as to realize the above-mentioned embodiments. Apply the keep alive method.
  • Embodiments of the present application further provide a computer program product, including computer-readable codes, which, when the computer-readable codes are run in an electronic device, enable the electronic device to implement the application keep-alive method described in the foregoing embodiments.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the software product is stored in a program product, such as a computer-readable storage medium, and includes several instructions to cause a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) to execute all of the methods described in the various embodiments of the present application. or part of the steps.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, and other media that can store program codes.
  • the embodiments of the present application may further provide a computer-readable storage medium on which computer program instructions are stored.
  • the electronic device is made to implement the application keep-alive method described in the foregoing embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Stored Programmes (AREA)

Abstract

本申请提供一种应用保活方法、电子设备及存储介质,涉及电子设备领域。该方法可以应用于第一设备,第一设备包括第一应用。该方法包括:当第一应用检测到第二应用获取第一应用中的第一信息时,创建第一对象,并生成第一对象的唯一标识符发送给第二应用。第一应用接收第二应用根据第一对象的唯一标识符发送的订阅请求。第一应用根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,先查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则延长第一应用的存活时间。通过该方法可以延长第一应用的存活时间。

Description

应用保活方法、电子设备及存储介质
本申请要求于2021年04月25日提交国家知识产权局、申请号为202110449195.8、申请名称为“应用保活方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及电子设备领域,尤其涉及一种应用保活方法、电子设备及存储介质。
背景技术
应用协同功能是指两个应用程序(application,App)之间协同为用户提供服务的功能,通过应用协同功能可以给用户带来丰富的体验。应用程序可以简称应用。例如,第一设备上安装有第一应用,第二设备上安装有第二应用。当第一设备与第二设备连接时,第一应用和第二应用之间可以协同为用户提供服务,用户可以在第二设备上通过第二应用查看第一设备上的第一应用中的信息。
在第一应用和第二应用协同为用户提供服务的过程中,第一设备的操作系统可能会由于系统资源的限制(系统资源不足),而强行杀死第一设备上运行的某些应用来释放系统资源。当第一设备杀死的应用中包括第一应用(第一应用可以称为应用协同功能的关联应用)时,会导致第一应用和第二应用之间的应用协同功能受到影响,影响用户体验。
目前,针对上述第一应用和第二应用之间的应用协同功能受到影响的问题,一种实现方式中:第二应用可以注册第一应用的死亡通知,当第一应用被第一设备杀死时,第二应用可以接收到第一应用的死亡通知,并重新拉起第二应用,以继续实现第一应用和第二应用之间的应用协同功能。但是,这种实现方式中,只有第一应用被杀死后,第二应用才会接收到第一应用的死亡通知,此时,第一应用和第二应用之间的应用协同功能已经受到影响了。
另一种实现方式中:第一应用和第二应用之间可以建立心跳关系,第二应用可以周期性向第一应用发送心跳信息。第一设备的操作系统强行杀死第一设备上运行的某些应用来释放系统资源时,如果监测到第二应用周期性向第一应用发送的心跳信息,则可以延长第一应用的存活时间。这种实现方式虽然可以避免第一应用和第二应用之间的应用协同功能受到影响,但是会大大增加第一设备和第二设备的功耗。
发明内容
为解决上述提到的问题,本申请实施例提供一种应用保活方法、电子设备及存储介质。本申请实施例的技术方案可以适用于上述第一应用和第二应用之间实现应用协同功能的场景中,延长第一应用的存活时间,以避免第一应用和第二应用之间的应用协同功能受到影响。而且,第一应用和第二应用所在的设备的功耗较低。
第一方面,本申请实施例提供一种应用保活方法,所述方法应用于第一设备,第一设备包括第一应用,第一应用与第二应用之间具有应用协同功能;所述方法包括: 当第一应用检测到第二应用获取第一应用中的第一信息时,第一应用创建第一对象,并生成第一对象的唯一标识符。第一应用向第二应用发送第一对象的唯一标识符。第一应用接收第二应用根据第一对象的唯一标识符发送的订阅请求,订阅请求包括第二应用的标识信息。第一应用根据订阅请求,在所述第一对象的订阅列表中添加所述第二应用的标识信息。当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
本申请实施例中,在用户通过第二应用查看第一应用中的第一信息的过程中,当第一设备的操作系统由于系统资源的限制,需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则表明第一应用和第二应用之间存在协同关系,第一设备可以延长第一应用的存活时间,以避免第一应用和第二应用之间的应用协同功能受到影响。
可以看到,该方法可以通过简单的方式建立第一应用和第二应用之间的协同关系,而不需要周期性的心跳。因此,第一设备和第二设备的功耗可以较低。另外,该方法相对于第一应用被杀死后重新拉起的方式而言,用户体验可以更好。
根据第一方面,所述第一设备的操作系统延长第一应用的存活时间,包括:第一设备的操作系统,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,优先级越高,应用的存活时间越长。
可选地,所述第一设备的操作系统,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,包括:第一设备的操作系统,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至最高优先级。
根据第一方面,或者以上第一方面的任意一种实现方式,订阅请求是第二应用在校验到第二应用具有读取第一对象的唯一标识符的权限后,发送给第一应用的。
本实施方式中,第二应用接收到来自第一应用的第一对象的唯一标识符后,先对第一对象的唯一标识符进行校验,在确认具有读取第一对象的唯一标识符的权限后,再执行后续步骤(即发送订阅请求),可以更好的保护用户隐私。
根据第一方面,或者以上第一方面的任意一种实现方式,所述第一应用根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息,包括:第一应用校验第二应用是否具有订阅第一对象的权限;当第一应用校验到第二应用具有订阅第一对象的权限后,第一应用根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。
本实施方式中,第一应用接收到来自第二应用的订阅请求后,先对订阅请求进行校验,在确认第二应用有权限订阅第一对象后,再执行后续步骤,也可以更好的保护用户隐私。
换言之,由于该应用保活方法涉及到应用的运行数据,所以,该方法可以只在用户同意并赋予相应的权限后,再实现应用保活,以更好的保护用户隐私。
根据第一方面,或者以上第一方面的任意一种实现方式,所述方法还包括:第一应用接收第二应用根据第一对象的唯一标识符发送的取消订阅请求,取消订阅请求包 括第二应用的标识信息。第一应用根据取消订阅请求,在第一对象的订阅列表中删除第二应用的标识信息。当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中不包括第二应用的标识信息,则第一设备的操作系统无需延长第一应用的存活时间。
根据第一方面,或者以上第一方面的任意一种实现方式,第一对象的唯一标识符包括第一设备的设备信息、第一应用的应用信息、第一对象的对象信息、以及创建第一对象时的时间戳信息。
需要说明的是,本申请对第一对象的唯一标识符的具体格式不作限制。
根据第一方面,或者以上第一方面的任意一种实现方式,第一应用和第二应用所在的设备为同一设备或不同设备。
例如,一种实施方式中,第二应用可以安装于第二设备上,第一设备与第二设备不同。
又例如,另一种实施方式中,第二应用也可以安装于第一设备上。
根据第一方面,或者以上第一方面的任意一种实现方式,第二应用包括多个第三应用;所述如果第一对象的订阅列表中包括第二应用的标识信息,则第一设备的操作系统延长第一应用的存活时间,包括:如果第一对象的订阅列表中包括至少一个第三应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
例如,对于与第一应用之间实现协同功能的应用包括多个的情况,当第一设备的操作系统由于系统资源的限制,需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括其他应用的标识信息,则表明第一对象有被其他应用订阅,第一应用和其他应用之间存在协同关系,第一设备的操作系统可以延长第一应用的存活时间。
第二方面,本申请实施例提供一种应用保活装置,所述装置应用于第一设备,第一设备可以通过该装置实现第一方面所述的应用保活方法中第一应用的功能。第一应用与第二应用之间具有应用协同功能。
该装置可以包括:对象管理模块,用于当检测到第二应用获取第一应用中的第一信息时,创建第一对象,并生成所述第一对象的唯一标识符;用于检测到第二应用获取第一应用中的第一信息时,创建第一对象,并生成第一对象的唯一标识符。收发模块,用于向第二应用发送第一对象的唯一标识符;接收第二应用根据第一对象的唯一标识符发送的订阅请求,订阅请求包括第二应用的标识信息。保活管理模块,用于根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。
当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
一些实施例中,第一设备的操作系统具体用于,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,优先级越高,应用的存活时间越 长。
可选地,第一设备的操作系统具体用于,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至最高优先级。
可选地,订阅请求是第二应用在校验到第二应用具有读取第一对象的唯一标识符的权限后,发送给第一应用的。
可选地,该装置还可以包括:权限校验模块,用于校验第二应用是否具有订阅第一对象的权限;保活管理模块,具体用于当权限校验模块校验到第二应用具有订阅第一对象的权限后,根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。
可选地,收发模块,还用于接收第二应用根据第一对象的唯一标识符发送的取消订阅请求,取消订阅请求包括第二应用的标识信息。保活管理模块,还用于根据取消订阅请求,在第一对象的订阅列表中删除第二应用的标识信息。当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中不包括第二应用的标识信息,则第一设备的操作系统无需延长第一应用的存活时间。
可选地,第一对象的唯一标识符包括第一设备的设备信息、第一应用的应用信息、第一对象的对象信息、以及创建第一对象时的时间戳信息。
可选地,第一应用和第二应用所在的设备为同一设备或不同设备。
可选地,第二应用包括多个第三应用;第一设备的操作系统具体用于,如果第一对象的订阅列表中包括至少一个第三应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
第三方面,本申请实施例提供一种电子设备,包括:处理器;存储器;以及计算机程序;其中,计算机程序存储在存储器上,当计算机程序被处理器执行时,使得电子设备实现如第一方面及第一方面中任意一种实现方式所述的应用保活方法。
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备实现如第一方面及第一方面中任意一种实现方式所述的应用保活方法。
第五方面,本申请实施例还提供一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备上运行时,使得电子设备实现如第一方面及第一方面中任意一种实现方式所述的应用保活方法。
上述第三方面至第五方面中,电子设备可以是第一方面中提到的第一设备。
第二方面及第二方面的任意一种实现方式、第三方面及第三方面的任意一种实现方式、第四方面及第四方面的任意一种实现方式、第五方面及第五方面的任意一种实现方式,所对应的技术效果可参见上述第一方面及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的应用场景示意图;
图2为本申请实施例提供的第一设备的结构示意图;
图3为本申请实施例提供的应用保活方法的流程示意图;
图4为本申请实施例提供的应用保活方法的另一流程示意图;
图5为本申请实施例提供的应用保活装置的结构示意图;
图6为本申请实施例提供的应用保活装置的另一结构示意图。
具体实施方式
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
应用协同功能是指两个应用程序(application,App)之间协同为用户提供服务的功能,通过应用协同功能可以给用户带来丰富的体验。应用程序可以简称应用。例如,第一设备上安装有第一应用,第二设备上安装有第二应用。当第一设备与第二设备连接时,第一应用和第二应用之间可以协同为用户提供服务,用户可以在第二设备上通过第二应用查看第一设备上的第一应用中的信息。
在第一应用和第二应用协同为用户提供服务的过程中,第一设备的操作系统可能会由于系统资源的限制(系统资源不足),而强行杀死第一设备上运行的某些应用来释放系统资源。杀死应用是指结束应用的进程。当第一设备的操作系统杀死的应用中包括第一应用(第一应用可以称为应用协同功能的关联应用)时,会导致第一应用和第二应用之间的应用协同功能受到影响,影响用户体验。
举例说明,假设第一设备为手机,第一应用为手机上安装的图库应用1;第二设备为智能手表,第二应用为智能手表上安装的图库应用2。当手机和智能手表连接时,图库应用1和图库应用2之间可以协同为用户提供服务,用户可以在智能手表上通过图库应用2查看手机上的图库应用1中的图片。
在图库应用1和图库应用2协同为用户提供服务的过程中,手机的操作系统可能 会由于系统资源的限制,而强行杀死手机上运行的某些应用来释放系统资源。如果手机杀死的应用中包括图库应用1,则会导致图库应用1和图库应用2之间的应用协同功能受到影响,图库应用1和图库应用2无法继续协同为用户提供服务。此时,用户在智能手表上通过图库应用2查看手机上的图库应用1中的图片的操作,可能会被强制中断,导致用户无法继续在智能手表上通过图库应用2查看手机上图库应用1中的图片,严重影响了用户体验。
目前,针对上述第一应用和第二应用之间的应用协同功能受到影响的问题,一种实现方式中:第二应用可以注册第一应用的死亡通知,当第一应用被第一设备杀死时,第二应用可以接收到第一应用的死亡通知,并重新拉起第二应用,以继续实现第一应用和第二应用之间的应用协同功能。但是,这种实现方式中,只有第一应用被杀死后,第二应用才会接收到第一应用的死亡通知,此时,第一应用和第二应用之间的应用协同功能已经受到影响了。
另一种实现方式中:第一应用和第二应用之间可以建立心跳关系,第二应用可以周期性向第一应用发送心跳信息。第一设备的操作系统强行杀死第一设备上运行的某些应用来释放系统资源时,如果监测到第二应用周期性向第一应用发送的心跳信息,则可以延长第一应用的存活时间。这种实现方式虽然可以避免第一应用和第二应用之间的应用协同功能受到影响,但是会大大增加第一设备和第二设备的功耗。
在此背景技术下,本申请实施例提供了一种应用保活方法,可以适用于上述第一应用和第二应用之间实现应用协同功能的场景中。该方法可以包括:当第二应用接收到用户查看第一应用中的第一信息的操作时,第二应用从第一应用中获取第一信息,并展示给用户。当第一应用检测到第二应用获取第一信息时,第一应用创建第一对象,并生成第一对象的唯一标识符。在生成第一对象的唯一标识符后,第一应用将第一对象的唯一标识符发送(分享)给第二应用。第二应用根据第一对象的唯一标识符,向第一应用发送订阅请求。订阅请求用于向第一应用指示第二应用订阅了第一对象,订阅请求可以包括第二应用的标识信息。第一应用在接收到订阅请求后,根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。当第一应用在第一对象的订阅列表中添加了第二应用的标识信息后,即表明第一应用和第二应用之间建立了协同关系(或称为依赖关系)。
在用户通过第二应用查看第一应用中的第一信息的过程中,当第一设备的操作系统由于系统资源的限制,需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则表明第一应用和第二应用之间存在协同关系,第一设备的操作系统可以延长第一应用的存活时间。通过该应用保活方法可以延长第一应用的存活时间,以避免第一应用和第二应用之间的应用协同功能受到影响。而且,第一设备和第二设备的功耗可以较低。
下面结合附图对本申请实施例的技术方案进行示例性说明。
图1为本申请实施例提供的应用场景示意图。如图1所示,本申请实施例的应用场景可以包括:第一设备100和第二设备200。第一设备100和第二设备200之间可通过有线或无线的方式建立连接。第一设备100上安装有第一应用110,第二设备200 上安装有第二应用210。当第一设备100和第二设备200连接时,第一应用110和第二应用210之间可以协同为用户提供服务,用户可以在第二设备200上通过第二应用210查看第一设备100上的第一应用110中的信息。
可选地,第一设备100和第二设备200之间采用无线方式建立连接时采用的无线通信协议可以为无线保真(wireless fidelity,Wi-Fi)协议、蓝牙(bluetooth)协议、ZigBee协议、近距离无线通信(near field communication,NFC)协议,各种蜂窝网协议等,在此不作具体限制。
在具体实现时,上述第一设备100和/或第二设备200,可以为手机,平板电脑,手持计算机,PC,蜂窝电话,个人数字助理(personal digital assistant,PDA),可穿戴式设备(如:智能手表、智能手环),智能家居设备(如:电视机),车机(如:车载电脑),智慧屏,游戏机,耳机,人工智能(artificial intelligence,AI)音箱、以及增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备等,本申请实施例对第一设备100和第二设备200的具体设备形态不作特殊限制。
可选地,在一些实施例中,第一设备100和第二设备200的设备形态可以相同。例如,第一设备100和第二设备200均为手机。
或者,另外一些实施例中,第一设备100和第二设备200的设备形态也可以不同。例如,第一设备100可以手机,第二设备200可以为智能手表。
上述第一设备100和第二设备200可以是触屏设备,也可以是非触屏设备。
可选地,第一设备100和/或第二设备200的操作系统,可以是安卓TM(android)系统、iosTM系统、windowsTM系统、macTM系统、linuxTM系统等。更具体的,还可以小米TM系统、EMUITM系统、Android WearTM系统、Lite OSTM、TizenTM系统、watch osTM系统等。
一些实施例中,第一设备100和第二设备200的操作系统可以相同。另外一些实施例中,第一设备100和第二设备200的操作系统也可以不同。本申请实施例对第一设备100和/或第二设备200的操作系统,不作具体限制。
作为一种示例,第一设备100,第二设备200分别可以包括存储器,处理器和显示器。其中,存储器可以用于存储操作系统,处理器可以用于运行存储器中存储的操作系统。显示器可以用于显示各种用户界面(user interface,UI)。第一设备100的显示可以用于显示第一设备100上安装的第一应用的应用界面、以及第一设备100的操作系统的用户交互界面。
示例性地,图2为本申请实施例提供的第一设备的结构示意图。如图2所示,以第一设备100为手机为例,第一设备100可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit, GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是手机的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。
本申请实施例提供的应用保活方法可以通过在处理器210中写入代码或程序来实现。当处理器210执行该代码或程序时,第一设备100可以实现本申请实施例提供的应用保活方法。如:第一设备100中第一应用110可以实现下述图3中所示的S303、S304、S306等步骤。第一设备100的操作系统可以实现下述图3中所示的S307和S308。
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM接口,和/或USB接口等。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行手机的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机使用过程中所创建的数据(比如图像数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
充电管理模块240用于从充电器接收充电输入。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为手机供电。电源管理模块241用于连接电池242,充电管理模块240,以及处理器210。电源管理模块241也可接收电池242的输入为手机供电。
手机的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。手机中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一 些实施例中,天线可以和调谐开关结合使用。
手机可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,气压传感器280C,磁传感器280D,加速度传感器280E,距离传感器280F,接近光传感器280G,指纹传感器280H,温度传感器280J,触摸传感器280K,环境光传感器280L,骨传导传感器280M等。
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机可以包括1个或M个显示屏294,M为大于1的正整数。例如,显示屏294可以用于显示应用程序的显示界面。
手机通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
可以理解的是,图2所示的结构并不构成对手机的具体限定。在一些实施例中,手机也可以包括比图2所示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置等。又或者,图2所示的一些部件可以以硬件,软件或软件和硬件的组合实现。
另外,当第一设备100是平板电脑,手持计算机,PC,蜂窝电话,PDA,可穿戴式设备,智能家居设备,车机,智慧屏,游戏机,耳机,AI音箱、以及AR/VR设备等其他终端设备时,这些其他终端设备的具体结构也可以参考图2所示。示例性地,其他终端设备可以是在图2给出的结构的基础上增加或减少了组件,在此不再一一赘述。
当第二设备200与第一设备100的设备形态相同时,第二设备200的结构与第一设备100的结构相同。当第二设备200与第一设备100的设备形态不同时,第二设备200的结构也可以参考图2所示,可以是在图2给出的结构的基础上增加或减少了组件,在此也不再赘述。
可选地,第一应用110和第二应用210的应用类型可以相同或不同。例如,第一应用110和第二应用210都可以是图库应用。或者,第一应用110可以是文件管理应用,第二应用210可以是图库应用。本申请在此不作限制。
本申请实施例提供的应用保活方法,可以应用图1中所示的应用场景中。
下面结合图3所示的流程,对本申请实施例提供的应用保活方法,在图1所示的应用场景中的具体实现过程进行示例性说明。图3为本申请实施例提供的应用保活方法的流程示意图。如图3所示,该方法可以包括S301-S308。
S301、第二应用210接收用户查看第一应用110中的第一信息的操作。
例如,第二应用210的应用界面中可以提供一个第一控件,当用户点击第一控件 时,可以触发第二应用210从第一应用110中获取第一信息,并展示给用户。用户点击第一控件的操作即为S301中所述的用户查看第一应用110中的第一信息的操作。
第一信息是指第一应用110中包含的信息,例如,当第一应用110是图库应用时,第一信息可以是第一应用110中存储的图片。
S302、第二应用210从第一应用110中获取第一信息,并展示给用户。
第一应用110检测到第二应用210获取第一信息时,可以执行S303-S304。
示例性地,第二应用210可以通过向第一应用110发送第一信息的获取请求。第一应用110接收到该第一信息的获取请求后,可以向第二应用210返回第一信息。第一应用110接收到该第一信息的获取请求时,即可以检测到第二应用210获取第一信息。
S303、第一应用110创建第一对象,并生成第一对象的唯一标识符。
一些实施例中,第一对象可以是第一应用110创建的虚拟对象,如虚拟对象可以是文本、数字等,该虚拟对象可以由第一应用110随机生成或按照某种规则生成,在此不作限制。
另外一些实施例中,第一对象也可以是第一应用110根据第一信息创建的,或者,第一对象可以是第一信息。例如,当第一应用110是图库应用,第一信息是第一应用110中存储的图片1时,第一对象可以是根据图片1创建的文本数据,或者,第一对象可以是图片1。
第一对象的唯一标识符可以由第一应用110根据第一设备100的设备信息、第一应用110的应用信息、第一对象的对象信息、创建第一对象时的时间戳信息等生成。第一对象的唯一标识符可以包括:第一设备100的设备信息、第一应用110的应用信息、第一对象的对象信息、以及创建第一对象时的时间戳信息。
示例性地,第一设备100的设备信息可以是第一设备100的设备名称或设备型号。第一应用110的应用信息可以是第一应用110的应用名称或应用类型。第一对象的对象信息可以是第一对象的名称。
例如,假设第一应用110创建的第一对象为“Object”,第一设备100的设备型号为“12345”,第一应用110的应用名称为“photo”,创建第一对象时的时间戳为“20201027”,则第一对象的唯一标识符可以为“12345_photo_Object_20201027”。
需要说明的是,本申请实施例对第一对象的唯一标识符的具体格式不作限制。
S304、第一应用110向第二应用210发送第一对象的唯一标识符。
相应地,第二应用210接收来自第一应用110的第一对象的唯一标识符。
S305、第二应用210根据第一对象的唯一标识符,向第一应用110发送订阅请求。
相应地,第一应用110接收来自第二应用210的订阅请求。
其中,订阅请求用于向第一应用110指示第二应用210订阅了第一对象,订阅请求可以包括第二应用210的标识信息。
示例性地,第二应用210的标识信息可以是第二应用210的名称。
S306、第一应用110根据订阅请求,在第一对象的订阅列表中添加第二应用210的标识信息。
当第一应用110在第一对象的订阅列表中添加了第二应用210的标识信息后,即 表明第一应用110和第二应用210之间建立了协同关系。
在用户通过第二应用210查看第一应用110中的第一信息的过程中,当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,第一对象的订阅列表中包含的第二应用210的标识信息,可以用于指示第一设备100延长第一应用110的存活时间。例如,可以参见S307-S308。
S307、当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,第一设备100的操作系统查询第一对象的订阅列表。
以第一设备100的操作系统为安卓 TM系统为例,安卓 TM系统中包括一个lowmemorykiller组件,该lowmemorykiller组件可以用于强行杀死第一设备100上运行的某些应用来释放系统资源。
S308、当第一对象的订阅列表中包括第二应用210的标识信息时,第一设备100的操作系统延长第一应用110的存活时间。
一些实施例中,第一设备100的操作系统延长第一应用110的存活时间,可以包括:第一设备100的操作系统不强行杀死第一应用110。
另外一些实施例中,第一设备100的操作系统延长第一应用110的存活时间,也可以包括:第一设备100的操作系统提升第一应用110在所有当前正在运行的应用中的优先级,优先级越高,应用的存活时间越长。
可选地,第一设备100的操作系统提升第一应用110在所有当前正在运行的应用中的优先级,可以是指:将第一应用110在所有当前正在运行的应用中的优先级提升至最高优先级。例如,假设第一设备100上当前正在运行的应用包括:应用A、应用B、以及第一应用110。应用A、应用B、以及第一应用110的当前优先级为:应用A高于应用B、应用B高于第一应用110。则,第一设备100的操作系统可以调整这三个应用的优先级依次为:第一应用110高于应用A,应用A高于应用B,第一设备100的操作系统在强行杀死应用时,会先杀死应用B,最后杀死第一应用110。从而,第一应用110的存活时间可以更长。
或者,第一设备100的操作系统提升第一应用110在所有当前正在运行的应用中的优先级,也可以是指:将第一应用110在所有当前正在运行的应用中的优先级提升至少一个优先级。例如,同样以第一设备100上当前正在运行的应用包括:应用A、应用B、以及第一应用110为例,第一设备100的操作系统可以调整这三个应用的优先级依次为:应用A高于第一应用110,第一应用110高于应用B,第一设备100的操作系统在强行杀死应用时,会先杀死应用B,最后杀死应用A。第一应用110的存活时间也可以更长。
需要说明的是,本申请实施例对第一设备100的操作系统延长第一应用110的存活时间的具体方式不作限制。
另外,应当理解,本申请实施例中,当第二应用210并未接收用户查看第一应用110中的第一信息的操作时,在第一对象的订阅列表中则没有第二应用210的标识信息,表明第一应用110和第二应用210之间没有协同关系。当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资 源时,第一设备100的操作系统查询第一对象的订阅列表后,由于第一对象的订阅列表不包括第二应用210的标识信息,所以第一设备100的操作系统无需延长第一应用110的存活时间,如可以直接杀死第一应用110、或者可以维持第一应用110的优先级。
基于这样的理解,本申请实施例中,当第二应用210接收到用户取消查看第一应用中的信息的操作时,可以触发第一应用110在第一对象的订阅列表中删除第二应用210的标识信息,以使得第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,也无需延长第一应用110的存活时间。例如,图4为本申请实施例提供的应用保活方法的另一流程示意图。如图4所示,该方法可以包括S401-S405。
S401、第二应用210接收用户取消查看第一应用110中的第一信息的操作。
例如,第二应用210的应用界面中可以提供一个第二控件,当用户点击第二控件时,可以触发第二应用210不再从第一应用110中获取第一信息。用户点击第二控件的操作即为S401中所述的用户取消查看第一应用110中的第一信息的操作。
第一信息可以参见S301中所述。
第二应用210接收到用户取消查看第一应用110中的第一信息的操作后,不再从第一应用110中获取第一信息,并同时执行S402。
S402、第二应用210根据第一对象的唯一标识符,向第一应用110发送取消订阅请求。
相应地,第一应用110接收来自第二应用210的取消订阅请求。
其中,取消订阅请求用于向第一应用110指示第二应用210取消订阅第一对象,取消订阅请求也可以包括第二应用210的标识信息。
S403、第一应用110根据取消订阅请求,在第一对象的订阅列表中删除第二应用210的标识信息。
当第一应用110在第一对象的订阅列表中删除了第二应用210的标识信息后,即表明第一应用110和第二应用210之间没有了协同关系。
此时,当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,第一对象的订阅列表不再包含第二应用210的标识信息,能够指示第一设备100无需再延长第一应用110的存活时间。例如,可以参见S404-S405。
S404、当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,第一设备100的操作系统查询第一对象的订阅列表。
S405、当第一对象的订阅列表中不包括第二应用210的标识信息时,第一设备100的操作系统无需延长第一应用110的存活时间。
可选地,第一设备100的操作系统无需延长第一应用110的存活时间,可以是指:当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,第一设备100的操作系统无需再调整第一应用110的优先级,或者,直接杀死第一应用110。
本申请实施例中,在用户通过第二应用210查看第一应用110中的第一信息的过 程中,当第一设备100的操作系统由于系统资源的限制,需要强行杀死第一设备100上运行的某些应用来释放系统资源时,对于第一应用110,第一设备可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用210的标识信息,则表明第一应用110和第二应用210之间存在协同关系,第一设备100可以延长第一应用110的存活时间,以避免第一应用110和第二应用210之间的应用协同功能受到影响。
可以看到,该方法可以通过简单的方式建立第一应用110和第二应用210之间的协同关系,而不需要周期性的心跳。因此,第一设备100和第二设备200的功耗可以较低。另外,该方法相对于第一应用110被杀死后重新拉起的方式而言,用户体验可以更好。
举例说明,以第一设备100为手机,第一应用110为手机上安装的图库应用1,第二设备200为智能手表,第二应用210为智能手表上安装的图库应用2为例,当手机和智能手表连接时,图库应用2可以接收用户查看图库应用1中的图片的操作。图库应用2可以响应于用户查看图库应用1中的图片的操作,从图库应用1中获取图片并显示。当图库应用1检测到图库应用2获取图片时,图库应用1可以创建第一对象,并生成第一对象的唯一标识符。在生成第一对象的唯一标识符后,图库应用1可以将第一对象的唯一标识符发送(分享)给图库应用2。图库应用2根据第一对象的唯一标识符,向图库应用1发送订阅请求。图库应用1在接收到订阅请求后,可以根据订阅请求,在第一对象的订阅列表中添加图库应用2的标识信息。当图库应用1在第一对象的订阅列表中添加了图库应用2的标识信息后,即表明图库应用1和图库应用2之间建立了协同关系(或称为依赖关系)。
在用户通过图库应用2查看图库应用1中的图片的过程中,当手机的操作系统由于系统资源的限制,需要强行杀死手机上运行的某些应用来释放系统资源时,对于图库应用1,手机的操作系统可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括图库应用2的标识信息,则手机的操作系统可以延长图库应用1的存活时间。通过该应用保活方法可以延长图库应用1的存活时间,以避免图库应用1和图库应用2之间的应用协同功能受到影响,进而保证用户体验。而且,手机和智能手表的功耗可以较低。
可选地,本申请实施例中,第二应用210接收到来自第一应用110的第一对象的唯一标识符后,可以先对第一对象的唯一标识符进行校验,以确定第二应用210是否有权限读取第一对象的唯一标识符。当第二应用210确定有权限读取第一对象的唯一标识符时,第二应用210再执行后续步骤,如S305。
其中,第二应用210读取第一对象的唯一标识符的权限可以由用户在第二设备200上赋予第二应用210。例如,第二应用210第一次接收到来自第一应用110的第一对象的唯一标识符时,或者,第一设备100与第二设备200建立连接时,第二设备200可以显示第一界面,第一界面中可以包括提示信息:“是否允许第二应用210读取来自第一应用110的信息”、以及“确认”按键和“取消”按键。当用户点击“确认”按键时,可以赋予第二应用210读取第一对象的唯一标识符的权限。当用户点击“取消”按键时,第二应用210则没有读取第一对象的唯一标识符的权限。
可以理解,如果用户没有赋予第二应用210读取第一对象的唯一标识符的权限, 则第二应用210不再执行后续步骤。
本申请实施例中,第二应用210接收到来自第一应用110的第一对象的唯一标识符后,先对第一对象的唯一标识符进行校验,在确认具有读取第一对象的唯一标识符的权限后,再执行后续步骤,可以更好的保护用户隐私。
可选地,本申请实施例中,第一应用110接收到来自第二应用210的订阅请求后,也可以先对订阅请求进行校验,以确定第二应用210是否有权限订阅第一对象。当第一应用110确定第二应用210有权限订阅第一对象时,再执行后续步骤,如S306。
类似地,第二应用210订阅第一对象的权限可以由用户在第一设备100上赋予第二应用210。例如,第一应用110第一次接收到来自第二应用210的订阅请求时,或者,第一设备100与第二设备200建立连接时,第一设备100可以显示第二界面,第二界面中可以包括提示信息:“是否允许第二应用210订阅第一对象”、以及“确认”按键和“取消”按键。当用户点击“确认”按键时,可以赋予第二应用210订阅第一对象的权限。当用户点击“取消”按键时,第二应用210则没有订阅第一对象的权限。
可以理解,如果用户没有赋予第二应用210订阅第一对象的权限,则第一应用110不再执行后续步骤。
本申请实施例中,第一应用110接收到来自第二应用210的订阅请求后,先对订阅请求进行校验,在确认第二应用210有权限订阅第一对象后,再执行后续步骤,也可以更好的保护用户隐私。
换言之,由于本申请实施例提供的应用保活方法涉及到应用的运行数据,所以,该方法可以只在用户同意并赋予相应的权限后,再实现应用保活,以更好的保护用户隐私。
以上实施例主要说明了本申请实施例提供的应用保活方法,在图1所示的应用场景中的具体实现过程。其中,第一应用110和第二应用210是分别安装在两个不同的设备(第一设备100和第二设备200)上的。但需要说明的是,本申请实施例提供的该应用保活方法,同样适用于安装于同一设备上的两个应用之间,实现保活。当该应用保活方法应用于安装于同一设备上的两个应用之间时,具体流程与前述实施例所述的第一应用110和第二应用210之间的交互流程类似,不再赘述。
最后,还需要说明的是,本申请实施例虽然是以第一应用和第二应用之间实现应用协同功能为例进行说明,但应当理解,与第一应用之间实现协同功能的应用可以包括多个。每个应用均可以与第一应用之间实现协同功能,并按照前述实施例中所述的流程,订阅第一应用创建的第一对象。第一应用可以将订阅了第一对象的所有应用的标识信息均加入第一对象的订阅列表。对于与第一应用之间实现协同功能的应用包括多个的情况,当第一设备(或者说第一应用所在的设备)的操作系统由于系统资源的限制,需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统可以先查询第一对象的订阅列表,如果第一对象的订阅列表中包括其他应用的标识信息,则表明第一对象有被其他应用订阅,第一应用和其他应用之间存在协同关系,第一设备的操作系统可以延长第一应用的存活时间。
换言之,本申请实施例中,前述提到的第二应用可以包括多个应用(如第三应用),当第一设备的操作系统由于系统资源的限制,需要强行杀死第一设备上运行的某些应 用来释放系统资源时,如果第一对象的订阅列表中包括至少一个第三应用的标识信息,则表明第一对象有被第三应用订阅,第一应用和该第三应用之间存在协同关系,第一设备的操作系统可以延长第一应用的存活时间。这里,第三应用可以被称为订阅方。
可选地,本申请实施例中,当第一对象是第一应用中的第一信息时,本申请实施例的技术方案实际可以理解为:当有其他应用读取(获取)第一信息时,第一应用在第一对象的订阅列表中记录了其他应用的标识信息(具体参见前述实施例)。第一对象的订阅列表中包含其他应用的标识信息,则表明第一信息正在被其他应用读取。所以。第一设备的操作系统需要强行杀死第一设备上运行的某些应用来释放系统资源时,可以适当延长第一应用的存活时间。
对应于前述实施例中所述的应用保活方法,本申请实施例还提供一种应用保活装置,该装置可以应用于第一设备,如:该装置可以以代码的方式与第一应用共同部署于前述第一设备中,第一设备可以调用该代码,实现前述应用保活方法中第一应用的功能。第一应用与第二应用之间具有应用协同功能。图5为本申请实施例提供的应用保活装置的结构示意图。如图5所示,该装置可以包括:
对象管理模块501,用于当检测到第二应用获取第一应用中的第一信息时,创建第一对象,并生成所述第一对象的唯一标识符;用于检测到第二应用获取第一应用中的第一信息时,创建第一对象,并生成第一对象的唯一标识符。收发模块502,用于向第二应用发送第一对象的唯一标识符;接收第二应用根据第一对象的唯一标识符发送的订阅请求,订阅请求包括第二应用的标识信息。保活管理模块503,用于根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。
当第一设备的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中包括第二应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
一些实施例中,第一设备的操作系统具体用于,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,优先级越高,应用的存活时间越长。
可选地,第一设备的操作系统具体用于,将第一应用在第一设备中所有当前正在运行的应用中的优先级提升至最高优先级。
可选地,订阅请求是第二应用在校验到第二应用具有读取第一对象的唯一标识符的权限后,发送给第一应用的。
可选地,图6为本申请实施例提供的应用保活装置的另一结构示意图。如图6所示,该装置还可以包括:权限校验模块504,用于校验第二应用是否具有订阅第一对象的权限;保活管理模块503,具体用于当权限校验模块504校验到第二应用具有订阅第一对象的权限后,根据订阅请求,在第一对象的订阅列表中添加第二应用的标识信息。
可选地,收发模块502,还用于接收第二应用根据第一对象的唯一标识符发送的取消订阅请求,取消订阅请求包括第二应用的标识信息。保活管理模块503,还用于根据取消订阅请求,在第一对象的订阅列表中删除第二应用的标识信息。当第一设备 的操作系统,由于系统资源的限制需要强行杀死第一设备上运行的某些应用来释放系统资源时,对于第一应用,第一设备的操作系统查询第一对象的订阅列表,如果第一对象的订阅列表中不包括第二应用的标识信息,则第一设备的操作系统无需延长第一应用的存活时间。
可选地,第一对象的唯一标识符包括第一设备的设备信息、第一应用的应用信息、第一对象的对象信息、以及创建第一对象时的时间戳信息。
可选地,第一应用和第二应用所在的设备为同一设备或不同设备。
可选地,第二应用包括多个第三应用;第一设备的操作系统具体用于,如果第一对象的订阅列表中包括至少一个第三应用的标识信息,则第一设备的操作系统延长第一应用的存活时间。
可以理解的,该装置中,各模块的具体实现原理,可以参考前述方法实施例中所述。
应理解以上装置中单元或模块(以下均称为单元)的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且装置中的单元可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分单元以软件通过处理元件调用的形式实现,部分单元以硬件的形式实现。
例如,各个单元可以为单独设立的处理元件,也可以集成在装置的某一个芯片中实现,此外,也可以以程序的形式存储于存储器中,由装置的某一个处理元件调用并执行该单元的功能。此外这些单元全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件又可以称为处理器,可以是一种具有信号的处理能力的集成电路。在实现过程中,上述方法的各步骤或以上各个单元可以通过处理器元件中的硬件的集成逻辑电路实现或者以软件通过处理元件调用的形式实现。
在一个例子中,以上装置中的单元可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个专用集成电路(application specific integrated circuit,ASIC),或,一个或多个数字信号处理器(digital signal process,DSP),或,一个或者多个现场可编辑逻辑门阵列(field programmable gate array,FPGA),或这些集成电路形式中至少两种的组合。
再如,当装置中的单元可以通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如CPU或其它可以调用程序的处理器。再如,这些单元可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。
在一种实现中,以上装置实现以上方法中各个对应步骤的单元可以通过处理元件调度程序的形式实现。例如,该装置可以包括处理元件和存储元件,处理元件调用存储元件存储的程序,以执行以上方法实施例所述的方法。存储元件可以为与处理元件处于同一芯片上的存储元件,即片内存储元件。
在另一种实现中,用于执行以上方法的程序可以在与处理元件处于不同芯片上的存储元件,即片外存储元件。此时,处理元件从片外存储元件调用或加载程序于片内存储元件上,以调用并执行以上方法实施例所述的方法。
例如,本申请实施例还可以提供一种装置,如:电子设备,可以包括:处理器, 用于存储该处理器可执行指令的存储器。该处理器被配置为执行上述指令时,使得该电子设备实现如前述实施例所述的应用保活方法。该存储器可以位于该电子设备之内,也可以位于该电子设备之外。且该处理器包括一个或多个。
示例性地,该电子设备可以是上述第一设备。
在又一种实现中,该装置实现以上方法中各个步骤的单元可以是被配置成一个或多个处理元件,这里的处理元件可以为集成电路,例如:一个或多个ASIC,或,一个或多个DSP,或,一个或者多个FPGA,或者这些类集成电路的组合。这些集成电路可以集成在一起,构成芯片。
例如,本申请实施例还提供一种芯片,该芯片可以应用于上述电子设备。芯片包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;处理器通过接口电路从电子设备的存储器接收并执行计算机指令,以实现如前述实施例所述的应用保活方法。
本申请实施例还提供一种计算机程序产品,包括计算机可读代码,当计算机可读代码在电子设备中运行时,使得电子设备实现如前述实施例所述的应用保活方法。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,如:程序。该软件产品存储在一个程序产品,如计算机可读存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
例如,本申请实施例还可以提供一种计算机可读存储介质,其上存储有计算机程 序指令。当计算机程序指令被电子设备执行时,使得电子设备实现如前述实施例所述的应用保活方法。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (11)

  1. 一种应用保活方法,其特征在于,所述方法应用于第一设备,所述第一设备包括第一应用,所述第一应用与第二应用之间具有应用协同功能;所述方法包括:
    当所述第一应用检测到所述第二应用获取所述第一应用中的第一信息时,所述第一应用创建第一对象,并生成所述第一对象的唯一标识符;
    所述第一应用向所述第二应用发送所述第一对象的唯一标识符;
    所述第一应用接收所述第二应用根据所述第一对象的唯一标识符发送的订阅请求,所述订阅请求包括所述第二应用的标识信息;
    所述第一应用根据所述订阅请求,在所述第一对象的订阅列表中添加所述第二应用的标识信息;
    当所述第一设备的操作系统,由于系统资源的限制需要强行杀死所述第一设备上运行的某些应用来释放系统资源时,对于所述第一应用,所述第一设备的操作系统查询所述第一对象的订阅列表,如果所述第一对象的订阅列表中包括所述第二应用的标识信息,则所述第一设备的操作系统延长所述第一应用的存活时间。
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备的操作系统延长所述第一应用的存活时间,包括:
    所述第一设备的操作系统,将所述第一应用在所述第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,优先级越高,应用的存活时间越长。
  3. 根据权利要求2所述的方法,其特征在于,所述第一设备的操作系统,将所述第一应用在所述第一设备中所有当前正在运行的应用中的优先级提升至少一个优先级,包括:
    所述第一设备的操作系统,将所述第一应用在所述第一设备中所有当前正在运行的应用中的优先级提升至最高优先级。
  4. 根据权利要求1所述的方法,其特征在于,所述订阅请求是所述第二应用在校验到所述第二应用具有读取所述第一对象的唯一标识符的权限后,发送给所述第一应用的。
  5. 根据权利要求1所述的方法,其特征在于,所述第一应用根据所述订阅请求,在所述第一对象的订阅列表中添加所述第二应用的标识信息,包括:
    所述第一应用校验所述第二应用是否具有订阅所述第一对象的权限;
    当所述第一应用校验到所述第二应用具有订阅所述第一对象的权限后,所述第一应用根据所述订阅请求,在所述第一对象的订阅列表中添加所述第二应用的标识信息。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:
    所述第一应用接收所述第二应用根据所述第一对象的唯一标识符发送的取消订阅请求,所述取消订阅请求包括所述第二应用的标识信息;
    所述第一应用根据所述取消订阅请求,在所述第一对象的订阅列表中删除所述第二应用的标识信息;
    当所述第一设备的操作系统,由于系统资源的限制需要强行杀死所述第一设备上运行的某些应用来释放系统资源时,对于所述第一应用,所述第一设备的操作系统查询所述第一对象的订阅列表,如果所述第一对象的订阅列表中不包括所述第二应用的 标识信息,则所述第一设备的操作系统无需延长所述第一应用的存活时间。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述第一对象的唯一标识符包括所述第一设备的设备信息、所述第一应用的应用信息、所述第一对象的对象信息、以及创建所述第一对象时的时间戳信息。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述第一应用和所述第二应用所在的设备为同一设备或不同设备。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述第二应用包括多个第三应用;
    所述如果所述第一对象的订阅列表中包括所述第二应用的标识信息,则所述第一设备的操作系统延长所述第一应用的存活时间,包括:
    如果所述第一对象的订阅列表中包括至少一个所述第三应用的标识信息,则所述第一设备的操作系统延长所述第一应用的存活时间。
  10. 一种电子设备,其特征在于,包括:处理器;存储器;以及计算机程序;其中,所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备实现如权利要求1-9任一项所述的方法。
  11. 一种计算机可读存储介质,所述计算机可读存储介质包括计算机程序,其特征在于,当所述计算机程序在电子设备上运行时,使得所述电子设备实现如权利要求1-9任一项所述的方法。
PCT/CN2022/086101 2021-04-25 2022-04-11 应用保活方法、电子设备及存储介质 WO2022228098A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22794569.8A EP4310672A1 (en) 2021-04-25 2022-04-11 Application keep-alive method, electronic device and a storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110449195.8A CN115328566A (zh) 2021-04-25 2021-04-25 应用保活方法、电子设备及存储介质
CN202110449195.8 2021-04-25

Publications (1)

Publication Number Publication Date
WO2022228098A1 true WO2022228098A1 (zh) 2022-11-03

Family

ID=83846641

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086101 WO2022228098A1 (zh) 2021-04-25 2022-04-11 应用保活方法、电子设备及存储介质

Country Status (3)

Country Link
EP (1) EP4310672A1 (zh)
CN (1) CN115328566A (zh)
WO (1) WO2022228098A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262670A1 (en) * 2010-11-26 2013-10-03 Fujitsu Limited Management system, management apparatus and management method
CN108737161A (zh) * 2018-04-20 2018-11-02 中国人民解放军国防科技大学 面向智能体协同体系的实时数据总线管理方法及系统
CN110798349A (zh) * 2019-10-28 2020-02-14 国家计算机网络与信息安全管理中心 一种配置分发、接收方法、设备及计算机可读存储介质
CN110958151A (zh) * 2018-09-26 2020-04-03 上海欣诺通信技术股份有限公司 保活检测方法、装置、节点、存储介质及通信系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262670A1 (en) * 2010-11-26 2013-10-03 Fujitsu Limited Management system, management apparatus and management method
CN108737161A (zh) * 2018-04-20 2018-11-02 中国人民解放军国防科技大学 面向智能体协同体系的实时数据总线管理方法及系统
CN110958151A (zh) * 2018-09-26 2020-04-03 上海欣诺通信技术股份有限公司 保活检测方法、装置、节点、存储介质及通信系统
CN110798349A (zh) * 2019-10-28 2020-02-14 国家计算机网络与信息安全管理中心 一种配置分发、接收方法、设备及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4310672A4

Also Published As

Publication number Publication date
EP4310672A4 (en) 2024-01-24
CN115328566A (zh) 2022-11-11
EP4310672A1 (en) 2024-01-24

Similar Documents

Publication Publication Date Title
WO2020108356A1 (zh) 一种应用显示方法及电子设备
EP4084486A1 (en) Cross-device content projection method, and electronic device
WO2021147406A1 (zh) 一种音频输出方法及终端设备
WO2021253975A1 (zh) 应用程序的权限管理方法、装置和电子设备
EP4020210A1 (en) Multi-thread synchronization method and electronic device
WO2020238728A1 (zh) 智能终端的登录方法及电子设备
WO2020150917A1 (zh) 一种应用权限的管理方法及电子设备
WO2021043046A1 (zh) 一种资源管控方法及设备
WO2021223539A1 (zh) 射频资源分配方法及装置
WO2021159746A1 (zh) 文件共享方法、系统及相关设备
WO2021052204A1 (zh) 基于通讯录的设备发现方法、音视频通信方法及电子设备
WO2021052200A1 (zh) 一种设备能力调度方法及电子设备
WO2021179924A1 (zh) 一种显示蓝牙设备标识的方法及电子设备
WO2021258795A1 (zh) 原子能力调用方法及终端设备
WO2021052415A1 (zh) 资源调度方法及电子设备
WO2021017935A1 (zh) 一种唤醒锁的管理方法及电子设备
WO2021093855A1 (zh) 一种移动设备管理方法及设备
WO2021052311A1 (zh) 一种根据后壳颜色显示用户界面的方法和电子设备
WO2022089121A1 (zh) 处理推送消息的方法和装置
WO2022127632A1 (zh) 一种资源管控方法及设备
WO2021238387A1 (zh) 一种执行应用的方法及装置
WO2021042991A1 (zh) 一种非侵入式交互方法及电子设备
WO2021057982A1 (zh) 应用程序的处理方法及相关产品
WO2021073183A1 (zh) 始终显示方法及移动设备
WO2021143168A1 (zh) 可信执行环境操作系统崩溃处理方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794569

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022794569

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022794569

Country of ref document: EP

Effective date: 20231016

WWE Wipo information: entry into national phase

Ref document number: 18556968

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE