IP Library Granted Patent US 12,693,910
Granted Patent B2
US 12,693,910 · App. 18/033,647 · Granted Jul 28, 2026

Video application keepalive method and electronic device

Inventor: Xiaolong Zhou (Shenzhen, CN)
Assignee: Honor Device Co., Ltd.
G06F9/542G06F9/451
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,693,910
App. No.
18/033,647
Granted
Jul 28, 2026
Kind
B2
Abstract

This application provides a video application keepalive method and an electronic device. The video application keepalive method includes: when running memory usage of a system exceeds a first threshold, the electronic device determines whether the first application is of a video type. In a case in which the first application is of a video type, it is determined whether the first application is in a video hold state. If the first application is in a video hold state, and the application meets a ranking condition, the electronic device keeps the first application alive within keepalive duration.

Claims (98)

1 . A video application keepalive method, the method comprising:

displaying a main interface of a video application on an electronic device;

receiving a first operation of a user on a first video in the main interface of the video application;

displaying a playback interface of the first video in response to the first operation;

switching the video application to a background;

determining a system stress level of the electronic device;

determining whether the video application satisfies a ranking condition based on the system stress level of the electronic device, wherein the determining whether the video application satisfies the ranking condition based on the system stress level of the electronic device comprises:

acquiring a system pressure coefficient of the electronic device, wherein the system pressure coefficient of the electronic device includes at least one of: an input/output (IO) pressure coefficient of the electronic device, a central processing unit (CPU) pressure coefficient of the electronic device, or a memory pressure coefficient of the electronic device;

obtaining a memory usage of a system operation of the electronic device; and

determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device, wherein the determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device comprises:

based on the system pressure coefficient of the electronic device being greater than a fourth threshold and the memory usage of the system operation of the electronic device being greater than or equal to a fifth threshold, determining that the system stress level of the electronic device is a first-level stress; and

based on the system pressure coefficient of the electronic device being greater than the fourth threshold and the memory usage of the system operation of the electronic device being less than the fifth threshold, determining that the system stress level of the electronic device is a secondary stress;

based on the video application satisfying the ranking condition and a duration from receiving the first operation to the switching the video application to the background being greater than or equal to a first preset threshold, keeping alive the video application; and

based on the duration from receiving the first operation to the switching the video application to the background being less than the first preset threshold, not keeping alive the video application.

2 . The method according to claim 1 , wherein the displaying the main interface of the video application comprises:

receiving a second operation of the user on an application icon of the video application; and

in response to the second operation, displaying the main interface of the video application.

3 . The method according to claim 1 , wherein the switching the video application to the background comprises:

receiving a third operation of the user on the video application; and

in response to the third operation, switching the video application to the background.

4 . The method according to claim 1 , wherein the switching the video application to the background comprises:

receiving an incoming call; and

in response to the incoming call, switching the video application to the background.

5 . The method according to claim 1 , wherein at a time when the video application is switched to the background, a playback progress of the video application is a first progress, the method further comprising:

switching the video application to a foreground after keeping the video application alive;

wherein in response to the switching the video application to the foreground, the video application continues to play video content of the first video from the first progress.

6 . The method according to claim 1 ,

wherein while the video application displays the playback interface of the first video, the video application applies for audio focus; and

wherein keeping alive the video application comprises:

based on the video application satisfying the ranking condition and a time difference between time T1 and time T2 being greater than or equal to the first preset threshold, keeping alive the video application, wherein the time T1 is a time at which the video application applies for audio focus, and the time T2 is a time at which the video application is switched to the background.

7 . The method according to claim 1 , wherein the determining whether the video application satisfies the ranking condition based on the system stress level of the electronic device comprises:

determining that the video application satisfies the ranking condition based on the system stress level of the electronic device being the first-level stress and a ranking of the video application in a first application queue is within a second threshold; or

determining that the video application satisfies the ranking condition based on the system stress level of the electronic device being the secondary stress and the ranking of the video application in the first application queue is within a third threshold, wherein the first-level stress is greater than the secondary stress.

8 . The method according to claim 1 , further comprising:

determining that the memory usage of a system operation of the electronic device is greater than a first threshold, before keeping alive the video application.

9 . An electronic device, comprising:

a touch screen;

one or more processors; and

one or more memories, wherein the one or more processors are coupled to the touch screen and the one or more memories, wherein the one or more memories are configured to store computer program code that includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs operations comprising:

displaying a main interface of a video application on the electronic device;

receiving a first operation of a user on a first video in the main interface of the video application;

displaying a playback interface of the first video in response to the first operation;

switching the video application to a background;

determining a system stress level of the electronic device;

determining whether the video application satisfies a ranking condition based on the system stress level of the electronic device, wherein the determining whether the video application satisfies the ranking condition based on the system stress level of the electronic device comprises:

acquiring a system pressure coefficient of the electronic device, wherein the system pressure coefficient of the electronic device includes at least one of: an input/output (IO) pressure coefficient of the electronic device, a central processing unit (CPU) pressure coefficient of the electronic device, or a memory pressure coefficient of the electronic device;

obtaining a memory usage of a system operation of the electronic device; and

determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device, wherein the determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device comprises:

based on the system pressure coefficient of the electronic device being greater than a fourth threshold and the memory usage of the system operation of the electronic device being greater than or equal to a fifth threshold, determining that the system stress level of the electronic device is a first-level stress; and

based on the system pressure coefficient of the electronic device being greater than the fourth threshold and the memory usage of the system operation of the electronic device being less than the fifth threshold, determining that the system stress level of the electronic device is a secondary stress;

based on the video application satisfying the ranking condition and a duration from receiving the first operation to the switching the video application to the background being greater than or equal to a first preset threshold, keeping alive the video application; and

based on the duration from receiving the first operation to the switching the video application to the background being less than the first preset threshold, not keeping alive the video application.

10 . The electronic device according to claim 9 , wherein the displaying the main interface of the video application comprises:

receiving a second operation of the user on an application icon of the video application; and

in response to the second operation, displaying the main interface of the video application.

11 . The electronic device according to claim 9 , wherein the switching the video application to the background comprises:

receiving a third operation of the user on the video application; and

in response to the third operation, switching the video application to the background.

12 . The electronic device according to claim 9 , wherein the switching the video application to the background comprises:

receiving an incoming call; and

in response to the incoming call, switching the video application to the background.

13 . The electronic device according to claim 9 , wherein at a time when the video application is switched to the background, a playback progress of the video application is a first progress, and when the one or more processors execute the computer instructions, the electronic device further performs operations comprising:

switching the video application to a foreground after keeping the video application alive;

wherein in response to the switching the video application to the foreground, the video application continues to play video content of the first video from the first progress.

14 . The electronic device according to claim 9 ,

wherein while the video application displays the playback interface of the first video, the video application applies for audio focus; and

wherein keeping alive the video application comprises:

based on the video application satisfying the ranking condition and a time difference between time T1 and time T2 being greater than or equal to the first preset threshold, keeping alive the video application, wherein the time T1 is a time at which the video application applies for audio focus, and the time T2 is a time at which the video application is switched to the background.

15 . A non-transitory computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform operations comprising:

displaying a main interface of a video application on the electronic device;

receiving a first operation of a user on a first video in the main interface of the video application;

displaying a playback interface of the first video in response to the first operation;

switching the video application to a background;

determining a system stress level of the electronic device;

determining whether the video application satisfies a ranking condition based on the system stress level of the electronic device, wherein the determining whether the video application satisfies the ranking condition based on the system stress level of the electronic device comprises:

acquiring a system pressure coefficient of the electronic device, wherein the system pressure coefficient of the electronic device includes at least one of: an input/output (IO) pressure coefficient of the electronic device, a central processing unit (CPU) pressure coefficient of the electronic device, or a memory pressure coefficient of the electronic device;

obtaining a memory usage of a system operation of the electronic device; and

determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device, wherein the determining the system stress level of the electronic device according to the system pressure coefficient of the electronic device and the memory usage of the system operation of the electronic device comprises:

based on the system pressure coefficient of the electronic device being greater than a fourth threshold and the memory usage of the system operation of the electronic device being greater than or equal to a fifth threshold, determining that the system stress level of the electronic device is a first-level stress; and

based on the system pressure coefficient of the electronic device being greater than the fourth threshold and the memory usage of the system operation of the electronic device being less than the fifth threshold, determining that the system stress level of the electronic device is a secondary stress;

based on the video application satisfying the ranking condition and a duration from receiving the first operation to the switching the video application to the background being greater than or equal to a first preset threshold, keeping alive the video application; and

based on the duration from receiving the first operation to the switching the video application to the background being less than the first preset threshold, not keeping alive the video application.

16 . The computer-readable storage medium according to claim 15 , wherein the displaying the main interface of the video application comprises:

receiving a second operation of the user on an application icon of the video application; and

in response to the second operation, displaying the main interface of the video application.

17 . The computer-readable storage medium according to claim 15 , wherein the switching the video application to the background comprises:

receiving a third operation of the user on the video application; and

in response to the third operation, switching the video application to the background.

18 . The computer-readable storage medium according to claim 15 , wherein the switching the video application to the background comprises:

receiving an incoming call; and

in response to the incoming call, switching the video application to the background.

19 . The computer-readable storage medium according to claim 15 , wherein at a time when the video application is switched to the background, a playback progress of the video application is a first progress, and wherein the instructions, when executed on the electronic device, cause the electronic device to perform operations comprising:

switching the video application to a foreground after keeping the video application alive;

wherein in response to the switching the video application to the foreground, the video application continues to play video content of the first video from the first progress.

20 . The computer-readable storage medium according to claim 15 ,

wherein while the video application displays the playback interface of the first video, the video application applies for audio focus; and

wherein keeping alive the video application comprises:

based on the video application satisfying the ranking condition and to a time difference between time T1 and time T2 being greater than or equal to the first preset threshold, keeping alive the video application, wherein the time T1 is a time at which the video application applies for audio focus, and the time T2 is a time at which the video application is switched to the background.