CN112114965A - Application program running method and device, terminal and storage medium - Google Patents

Application program running method and device, terminal and storage medium Download PDF

Info

Publication number
CN112114965A
CN112114965A CN202010964747.4A CN202010964747A CN112114965A CN 112114965 A CN112114965 A CN 112114965A CN 202010964747 A CN202010964747 A CN 202010964747A CN 112114965 A CN112114965 A CN 112114965A
Authority
CN
China
Prior art keywords
memory
application program
running state
state
running
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202010964747.4A
Other languages
Chinese (zh)
Inventor
李俊良
黄明国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010964747.4A priority Critical patent/CN112114965A/en
Publication of CN112114965A publication Critical patent/CN112114965A/en
Pending legal-status Critical Current

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/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/5016Allocation 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 the resource being the memory
    • 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/451Execution arrangements for user interfaces
    • 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
    • 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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/482Application

Abstract

The application belongs to the technical field of terminals, and particularly relates to an application program running method, an application program running device, a terminal and a storage medium. The running method of the application program comprises the following steps: receiving an instruction for switching the running state of the first application program; responding to the instruction, and switching the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program in the running state is not equal to the memory occupied by the first application program in the running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero. When the first application program is in different running states, the terminal can configure the corresponding memory for the running of the first application program, so that the waste of memory resources can be reduced, and the utilization rate of the memory resources can be improved.

Description

Application program running method and device, terminal and storage medium
Technical Field
The application belongs to the technical field of terminals, and particularly relates to an application program running method, an application program running device, a terminal and a storage medium.
Background
With the development of science and technology, more and more functions are supported by the terminal, and the terminal is more and more convenient for users to use. In order to improve the use experience of the user, the terminal can set a certain application program as a resident application program. When the terminal receives the starting instruction of the application program, the terminal can set the memory of the application program as a resident memory, so that the next starting time of the application program can be shortened. However, when the application is a resident application, the utilization rate of the memory resource is low.
Disclosure of Invention
The embodiment of the application provides an application program running method, an application program running device, a terminal and a storage medium, and the utilization rate of memory resources can be improved. The technical scheme comprises the following steps:
in a first aspect, an embodiment of the present application provides an application program running method, where the method includes:
receiving an instruction for switching the running state of the first application program;
responding to the instruction, and switching the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program in the running state is not equal to the memory occupied by the first application program in the running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero.
In a second aspect, an embodiment of the present application provides an apparatus for running an application, where the apparatus includes:
the instruction receiving unit is used for receiving an instruction for switching the running state of the first application program;
a state switching unit, configured to switch, in response to the instruction, an operating state of the first application from a first operating state to a second operating state, where a memory occupied by the first application when operating in the first operating state is not equal to a memory occupied by the first application when operating in the second operating state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero.
In a third aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method of any one of the above first aspects when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used for implementing any one of the methods described above when executed by a processor.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application provides an application program running method, which can switch a running state of a first application program from a first running state to a second running state in response to a received instruction for switching the running state of the first application program.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 illustrates a schematic structural diagram of a terminal provided in an exemplary embodiment of the application;
fig. 2 is a flowchart illustrating an operation method of an application according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating an example of a terminal interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an example of a terminal interface according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for running an application according to an embodiment of the present application;
FIG. 6 is a flow chart illustrating a method for running an application according to an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an example of a terminal interface according to an embodiment of the present application;
FIG. 8 is a flow chart illustrating a method for operating an application according to an embodiment of the present application;
fig. 9 is a flowchart illustrating an operation method of an application according to an embodiment of the present application;
FIG. 10 is a flow chart illustrating a method for operating an application according to an embodiment of the present application;
fig. 11 is a flowchart illustrating an operation method of an application according to an embodiment of the present application;
fig. 12 is a schematic structural diagram illustrating an application running apparatus according to an embodiment of the present application;
fig. 13 shows a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the development of science and technology, more and more functions are supported by the terminal, and the terminal is more and more convenient for users to use. The starting time of the application program in the terminal becomes the focus of the user's attention. Therefore, in order to improve the use experience of the user, the terminal can set a certain application program as a resident application program. When the terminal receives the starting instruction of the application program, the terminal can set the memory of the application program as a resident memory, so that the starting time of the application program can be shortened. When the terminal sets the application program as the resident application program and the running state of the application program is the background running state, the application program cannot be killed, namely the application program always occupies the memory occupied by the application program when the running state of the application program is the foreground running state, the memory resource is wasted, and the memory resource utilization rate is low. In addition, when the application program occupies the memory all the time, when the terminal runs other application programs, the other application programs cannot be used because the terminal does not have enough free memory, and the situations of memory leakage and memory resource waste of the application program occur.
According to some embodiments, when the terminal runs an application, the application may be coupled with other resident applications, including but not limited to a desktop. After the terminal couples the application program and the resident application, the application program can be a plug-in of other resident application programs, that is, when other common application programs are resident applications, the application program is also resident applications, so that the starting time of the application program can be reduced. However, when the running state of the application program is the background running state, the application program always occupies the memory occupied by the application program when the running state of the application program is the foreground running state, so that the memory resource is wasted, and the memory resource utilization rate is low. In addition, when the application program is coupled with other resident application programs, the updated iterative versions of the application programs are mutually dependent, and the problem that the version of the application program is difficult to upgrade occurs.
It is easy to understand that, the terminal can keep alive the whole application interface of the application program by using the keep-alive strategy, so that the starting time of the application program can be reduced, that is, when the running state of the application program is the background running state, the memory occupied by the foreground running state of the application program is the same as the memory occupied by the background running state. Because the memory occupied by the whole application interface of the application program is large, when the running state of the application program is the background running state, the application program always occupies the memory occupied by the application program when the running state of the application program is the foreground running state, the memory occupied by the whole application interface of the application program cannot be released, the memory resource is wasted, and the memory resource utilization rate is low. The embodiment of the application provides an application program running method, which can improve the utilization rate of memory resources.
Referring to fig. 1, a schematic structural diagram of a terminal provided in an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire terminal using various interfaces and lines, and performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The memory 120 may be divided into an operating system space, where an operating system runs, and a user space, where native and third-party applications run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The terminal of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. The user can view information such as displayed text, images, video, etc. using the display device on the terminal 101. The terminal may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the terminal shown in fig. 1, the processor 110 may be configured to call the application program stored in the memory 120, and specifically execute the application program running method according to the embodiment of the present application.
When the terminal receives an instruction for switching the running state of the first application program, the terminal can respond to the instruction to switch the running state of the first application program from the first running state to the second running state, wherein the memory occupied by the first application program when running in the first running state is not equal to the memory occupied by the first application program when running in the second running state; the memory occupied by the first application program when the first application program operates in the first operation state and the memory occupied by the first application program when the first application program operates in the second operation state are both not zero, so that the memory occupied by the application program when the application program operates can be reduced, and the utilization rate of memory resources is improved.
In the following method embodiments, for convenience of description, only the main execution body of each step is described as a terminal.
The following describes in detail an operation method of an application program provided in an embodiment of the present application with reference to fig. 2 to fig. 10. The execution bodies of the embodiments shown in fig. 2-10 may be terminals, for example.
Referring to fig. 2, a flowchart of an application running method is provided in an embodiment of the present application. As shown in fig. 2, the method of the embodiment of the present application may include the following steps S101 to S102.
S101, receiving an instruction for switching the running state of the first application program.
According to some embodiments, the first application refers to any application installed in the terminal, and does not refer to a fixed application. Fig. 3 shows an exemplary schematic diagram of a terminal interface according to an embodiment of the present application. For example, when the application installed in the terminal includes a wechat application, a QQ application, a video application, an audio application, an album application, and a beauty application, the first application may be a wechat application, and the first application may also be a QQ application, for example.
It is to be understood that the running state refers to a running state of the first application, and the running state includes, but is not limited to, a foreground running state, a background running state, a third running state, and the like.
The foreground running state refers to a state that the terminal displays the running interface of the first application program on the display screen, and when the first application program is in the foreground running state, a user can see the running interface of the first application program on the display screen of the terminal. The background running state refers to a state that the terminal does not display the running interface of the first application program on the display screen, and the user cannot interact with the running interface of the first application program, but the first application program still occupies system resources of the terminal when in the background running state.
According to some embodiments, when the terminal runs the first application, the terminal may receive an instruction to switch the running state of the first application, that is, the terminal may receive a switching instruction for the first application. The instructions include, but are not limited to, voice instructions, text instructions, click instructions, and the like. The instruction may also be, for example, an instruction sent by the terminal via another terminal to switch the operating state of the first application. For example, the terminal receives a voice instruction sent by the user through the intelligent wearable device to switch the running state of the first application program. The intelligent wearable device comprises but is not selected from a smart watch, a smart bracelet and the like.
Optionally, the instruction for switching the operating state of the first application program received by the terminal may be, for example, a voice instruction. The terminal can directly receive the voice command input by the user. The terminal can also receive a voice instruction input by the user based on the click voice control of the user. Fig. 4 shows an exemplary schematic diagram of a terminal interface according to an embodiment of the present application. As shown in fig. 4, when the terminal detects that the user clicks the voice capture control, the terminal may start capturing voice. When the terminal detects that the user clicks the voice acquisition control again, the terminal can stop acquiring voice, and at the moment, the terminal can receive a voice instruction for switching the running state of the first application program.
According to some embodiments, the instruction for switching the running state of the first application refers to an instruction for changing the running state of the first application, and does not refer to an instruction for switching a fixed state to another fixed state. For example, the instruction for switching the running state of the first application program may be an instruction for switching the running state of the first application program from a foreground running state to a background running state, or an instruction for switching the running state of the first application program from the background running state to the foreground running state.
S102, responding to an instruction, and switching the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program in the running state is not equal to the memory occupied by the first application program in the running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both nonzero.
According to some embodiments, the first running state refers to a running state before the first application switches the running state, and does not refer to a fixed running state. For example, the first running state may be a foreground running state, and the first running state may also be a background running state. The second operation state refers to an operation state after the first application program switches the operation state, and is not particularly limited to a certain fixed operation state. For example, the second running state may be a foreground running state, and the second running state may also be a background running state. However, the second running state and the first running state may not be the same running state at the same time, that is, when the first running state is the foreground running state, the second running state may not be the foreground running state, the second running state may be the background running state, or may be other running states.
It is easy to understand that, neither the memory occupied by the first application program when running in the first running state nor the memory occupied by the first application program when running in the second running state is zero means that the running state of the first application program is not a complete exit state, that is, the first application program is not in a complete exit state, and the first application program occupies the running memory of the terminal. The memory occupied by the first application program when running in the first running state is not equal to the memory occupied by the first application program when running in the second running state. For example, the memory occupied by the first application program when operating in the foreground operating state may not be equal to the memory occupied by the first application program when operating in the background operating state. Specifically, the memory occupied by the first application program in the foreground operation state is larger than the memory occupied by the first application program in the background operation state.
According to some embodiments, when the terminal receives an instruction to switch the running state of the first application program, the terminal may acquire the running state after the switching of the first application program based on the instruction. In response to the instruction to switch the operating state of the first application, the terminal may switch the operating state of the first application from the first operating state to the second operating state. Because the memory occupied by the first application program when operating in the first running state is not equal to the memory occupied by the first application program when operating in the second running state, the memory occupied by the first application program when not operating can be changed, the memory resource can be reasonably used, and the utilization rate of the memory resource is improved.
It is easy to understand that, when the terminal is based on the opening instruction of the first application program input by the user, the terminal may open the first application program and display an application interface corresponding to the first application program on the display screen, where the first application program is in a foreground running state. The background running state means that the application interface of the first application program is not displayed on the display screen and is in a background running state, and at this time, the first application program is not in an exit state. At this time, for example, the instruction for switching the running state of the first application received by the terminal is a voice switching instruction, and the voice switching instruction is, for example, "switching the running state of the first application to the background running state. The terminal can switch the running state of the first application program from the foreground running state to the background running state. The memory occupied by the first application program in the foreground running state is larger than the memory occupied by the first application program in the background running state, so that the memory occupied by the first application program in the background application state can be reduced, and the utilization rate of the memory is improved.
The embodiment of the application provides an application program running method, which can switch a running state of a first application program from a first running state to a second running state in response to a received instruction for switching the running state of the first application program. In addition, because the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero, the loading duration of the memory when the application program is started can be reduced, the starting duration of the application program can be reduced, and the use experience of a user can be improved, relative to the loading duration from zero memory to the memory after the application program is started. And secondly, the first application program does not need to be coupled with the resident memory, so that the memory leakage condition is reduced, the first application program is convenient to upgrade, and the use experience of a user is improved.
Referring to fig. 5, a flowchart of an application running method is provided in an embodiment of the present application. As shown in fig. 5, the method of the embodiment of the present application may include the following steps S201 to S202.
S201, receiving an instruction for switching the running state of the first application program.
The specific process is as described above, and is not described herein again.
According to some embodiments, the instruction to switch the running state of the first application includes, but is not limited to, an instruction to switch the running state of the first application from a foreground running state to a background running state, an instruction to switch the running state of the first application from a background running state to a foreground running state, and the like.
According to some embodiments, please refer to fig. 6, which is a flowchart illustrating an operation method of an application according to an embodiment of the present application. As shown in fig. 6, the method according to the embodiment of the present application may further include the following steps S301 to S302 before receiving an instruction to switch the operating state of the first application. S301, receiving a starting instruction aiming at a first application program; s302, responding to the starting instruction, when the running state of the first application program is switched from the third running state to the foreground running state, loading the first memory according to the preset steps, wherein the third running state is the quitting state of the first application program.
According to some embodiments, before the terminal receives the instruction to switch the running state of the first application program, the terminal may receive a start instruction for the first application program. The start instruction includes, but is not limited to, a click start instruction, a voice start instruction, a text start instruction, and the like. The start instruction of the first application received by the terminal may be, for example, a voice start instruction. The first application may be, for example, a WeChat application. The voice start instruction received by the terminal may be, for example, "start a WeChat application". Fig. 7 shows an exemplary schematic diagram of a terminal interface according to an embodiment of the present application. As shown in fig. 7, the start instruction of the first application received by the terminal may be, for example, a click start instruction.
According to some embodiments, the third running state is an exit state of the first application, and the exit state may be a complete exit state of the first application or an incomplete exit state of the first application. The incomplete exit state may refer to that the first application still occupies a part of the memory of the terminal, but the memory is smaller than the memory occupied by the first application when the background running state is running. The first memory is a memory occupied by the first application program when the first application program runs in a foreground running state.
It is easy to understand that, when the terminal receives a start instruction for the first application program, the terminal may switch the running state of the first application program from the third running state to the foreground running state in response to the start instruction. When the terminal switches the running state of the first application program from the third running state to the foreground running state, the terminal may load the first memory according to the preset step. And when the third running state is the complete exit state of the first application program, the memory corresponding to the third running state is zero.
Optionally, the starting step of the application includes, but is not limited to, creating an empty process object, loading an application window, rendering a running interface corresponding to the application, and the like. The step of starting the wechat application may include, for example, creating an empty process object, loading a wechat application window, and rendering a running interface corresponding to the wechat application. When the terminal receives a starting instruction of the WeChat application program and switches the running state of the WeChat application program from the third running state to the foreground running state, when the terminal can load a first memory occupied by the WeChat application program in the foreground running state, the terminal can load and create a memory corresponding to an empty process object, then load a memory corresponding to a WeChat application program window, and finally render a memory corresponding to a running interface corresponding to the WeChat application program.
S202, responding to the instruction, when the running state of the first application program is switched from the foreground running state to the background running state, releasing a first difference memory between a first memory and a second memory, and reserving the second memory, wherein the first memory is a memory occupied by the first application program when the foreground running state runs, the second memory is a memory occupied by the first application program when the background running state runs, and the first memory is larger than the second memory.
According to some embodiments, the first operating state is a foreground operating state and the second operating state is a background operating state. The foreground running state refers to a state that the terminal displays the running interface of the first application program on the display screen, and when the first application program is in the foreground running state, a user can see the running interface of the first application program on the display screen of the terminal. The background running state refers to a state that the terminal does not display the running interface of the first application program on the display screen, and the user cannot interact with the running interface of the first application program, but the first application program still occupies system resources of the terminal when in the background running state.
According to some embodiments, the first memory refers to a memory occupied by the first application program when the first application program operates in a foreground operating state, and does not refer to a fixed memory. For example, when the first application program changes, the first memory also changes correspondingly. For example, when the first application is a WeChat application, the first memory may be the A1 memory. When the first application is a QQ application, the first memory is B1 memory.
It is easy to understand that the second memory refers to a memory occupied by the first application program when the first application program operates in the background running state, and does not refer to a fixed memory. For example, when the first application program changes, the second memory also changes correspondingly. For example, when the first application is a WeChat application, the second memory may be the A2 memory. When the first application is a QQ application, the second memory is a B2 memory.
According to some embodiments, the first memory in this embodiment is larger than the second memory, that is, the memory occupied by the first application program when operating in the foreground operating state is larger than the memory occupied by the first application program when operating in the background operating state. The first difference memory refers to a difference memory between the first memory and the second memory, and is not particularly limited to a fixed difference memory. When the first memory and the second memory are changed, the first difference memory is also changed correspondingly.
Optionally, the instruction for switching the running state of the first application received by the terminal according to the embodiment of the present application may be, for example, an instruction for switching the running state of the first application from a foreground running state to a background running state. When the terminal responds to the instruction and switches the running state of the first application program from the foreground running state to the background running state, the terminal can release the first difference memory between the first memory and the second memory and reserve the second memory. Therefore, the terminal switches the running state of the first application program from the foreground running state to the background running state, waste of memory resources can be reduced, and the utilization rate of the memory resources is improved.
It is easily understood that, for example, when the first application is a wechat application, the first memory may be an a1 memory, the first memory may be, for example, a memory corresponding to a run interface corresponding to creating an empty process object, loading a wechat application window, and rendering the wechat application, the second memory may be an a2 memory, the first memory may be, for example, a memory corresponding to creating an empty process object and loading a wechat application window, the first difference memory may be, for example, an A3 memory, and the third memory may be, for example, a memory corresponding to a run interface corresponding to rendering the wechat application. When the terminal responds to the instruction for switching the running state of the WeChat application program and switches the running state of the first difference memory application program from the foreground running state to the background running state, the terminal can release the first difference memory A3 memory between the first memory and the second memory and reserve the second memory A2 memory.
According to some embodiments, please refer to fig. 8, which provides a flowchart illustrating an operation method of an application program according to an embodiment of the present application. As shown in fig. 8, when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, the method according to the embodiment of the present application releases the first difference memory between the first memory and the second memory, and may further include the following steps S401 to S402 after the second memory is reserved. S401, when a wake-up instruction aiming at the first application program is not received within a preset time length, releasing a second memory; s402, restarting the first application program, and loading a third memory, wherein the third memory is a memory occupied by the first application program when the first application program operates in a fourth operation state, and the third memory is smaller than the second memory.
According to some embodiments, when the terminal responds to the instruction and switches the running state of the first application program from the foreground running state to the background running state, the terminal releases the first difference memory between the first memory and the second memory, and after the second memory is reserved, the terminal can also detect whether a wake-up instruction for the first application program is received within a preset time period. The wake-up command includes, but is not limited to, a voice wake-up command, a text wake-up command, a click wake-up command, and the like. And when the terminal does not receive the awakening instruction aiming at the first application program within the preset time length, the terminal can release the second memory. After the terminal releases the second memory, the terminal may restart the first application program and load a third memory, where the third memory is a memory occupied by the first application program when the first application program operates in the fourth operating state, and the third memory is smaller than the second memory. Therefore, the memory occupied by the first application program in the background running state for a long time can be reduced, the waste of memory resources can be reduced, and the utilization rate of the memory resources can be improved.
It is to be understood that the fourth operation state may be one of operation states of the first application program, but the third memory occupied by the first application program when operating in the fourth operation state is smaller than the second memory occupied by the first application program when operating in the background operation state.
Alternatively, the preset time period may be 24 hours, for example. When the terminal does not receive a wake-up command for the wechat application within 24 hours, the terminal may release the second memory a 2. After the terminal releases the second memory, the terminal may restart the wechat application and load the third memory a4, where the third memory a4 is smaller than the second memory a 2. The third memory may be, for example, a memory corresponding to an empty process object corresponding to the terminal-created wechat application, and the second memory may be, for example, a sum of a memory corresponding to an empty process object corresponding to the loaded-created wechat application and a memory corresponding to the wechat application window.
According to some embodiments, please refer to fig. 9, which provides a flowchart illustrating an operation method of an application program according to an embodiment of the present application. As shown in fig. 9, when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, the method according to the embodiment of the present application releases the first difference memory between the first memory and the second memory, and may further include the following steps S501 to S502 after the second memory is reserved. S501, receiving an exit instruction aiming at each application program with a background running state; s502, responding to the quit instruction, when the first application program belongs to the preset type of application program, switching the running state of the first application program from the background running state to a fourth running state, releasing a second difference memory between the second memory and a third memory, and reserving the third memory, wherein the third memory is a memory occupied by the first application program when the first application program runs in the fourth running state, and the third memory is smaller than the second memory.
According to some embodiments, when the terminal switches the running state of the first application program from the foreground running state to the background running state in response to the instruction, the terminal releases the first difference memory between the first memory and the second memory, and after the second memory is reserved, the terminal may receive an exit instruction for each application program whose running state is the background running state. The exit instruction of each application program with the running state being the background running state may be a one-key killing instruction of each application program with the running state being the background running state. The instructions include, but are not limited to, voice exit instructions, text exit instructions, click exit instructions, and the like. When the terminal receives the exit instruction, the terminal may detect whether the first application program belongs to a preset type of application program.
Optionally, the preset type of application is an application that the terminal cannot completely release the memory of the application. The setting of the application program of the preset type may be set by the terminal based on a preset application program setting instruction, may be set by the terminal when leaving a factory, or may be set based on installation information of the application program. For example, when a user desires certain applications to be resident applications, the user may set the applications to be preset types of applications. When the application program belongs to the application program of the preset type and the running state of the application program is the background running state, and the terminal receives the exit instruction of each application program of which the running state is the background running state, the application program cannot be in the complete exit state, and the application program can be in the fourth application state.
It is easy to understand that when the terminal receives the quit instruction, the terminal responds to the quit instruction, and when the first application program belongs to the application program of the preset type, the terminal can switch the running state of the first application program from the background running state to the fourth running state, release the second difference memory between the second memory and the third memory, and reserve the third memory, so that the memory occupied by the first application program can be reduced, and the utilization rate of the memory resource can be improved. The third memory is a memory occupied by the first application program when the first application program operates in the fourth operation state, and the third memory is smaller than the second memory.
According to some embodiments, the second memory in this embodiment is larger than the third memory, that is, the memory occupied by the first application program when operating in the background running state is larger than the memory occupied by the first application program when operating in the fourth running state. The second difference memory refers to a difference memory between the second memory and the third memory, and is not particularly limited to a fixed difference memory. When the second memory and the third memory are changed, the second difference memory is also changed correspondingly.
Optionally, for example, when the first application is a WeChat application, the second memory may be an A2 memory, the third memory may be an A4 memory, and the first difference memory may be an A5 memory. When the terminal receives an exit instruction for each application program with the running state being the background running state, the terminal responds to the exit instruction, and when the WeChat application program belongs to the application program with the preset type, the running state of the WeChat application program is switched from the background running state to the fourth running state, a second difference memory A5 between the second memory and the third memory is released, and the third memory A4 is reserved.
According to some embodiments, please refer to fig. 10, which provides a flowchart illustrating an operation method of an application program according to an embodiment of the present application. As shown in fig. 10, when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, the method according to the embodiment of the present application releases the first difference memory between the first memory and the second memory, and may further include the following steps S601 to S602 after the second memory is reserved. S501, receiving a starting instruction aiming at a second application program; s502, based on the starting instruction, when detecting that the idle memory in the terminal is smaller than a fifth memory, releasing the second memory, wherein the fifth memory is a memory occupied by the second application program when the second application program operates in a foreground operation state.
According to some embodiments, when the terminal switches the running state of the first application program from the foreground running state to the background running state in response to the instruction, the terminal releases the first difference memory between the first memory and the second memory, and after the second memory is reserved, the terminal may receive a start instruction for the second application program. The second application refers to an application installed on the terminal, and does not refer to a fixed application. The launch instruction of the second application includes, but is not limited to, a voice launch instruction, a text launch instruction, a click launch instruction, and the like.
It is easy to understand that, when the terminal receives the start instruction, the terminal may detect whether the idle memory in the terminal is smaller than the fifth memory based on the start instruction, and when the terminal detects that the idle memory in the terminal is smaller than the fifth memory, the terminal may release the second memory occupied by the first application program when the background operation state is running. And the fifth memory is a memory occupied by the second application program when the second application program runs in the foreground running state. Therefore, the condition of memory leakage of the application program can be reduced, the waste of memory resources can be reduced, and the utilization rate of the memory resources can be further improved.
Optionally, when the terminal receives a start instruction for the QQ application, the terminal obtains that the fifth memory occupied by the QQ application when the foreground is running is 20M. When the terminal acquires that the idle memory in the terminal is 5M, and the terminal detects that the idle memory in the terminal is 5M less than the fifth memory 20M, the terminal can release the second memory occupied by the WeChat application program when the WeChat application program operates in the background operation state. The second memory may be, for example, 70M.
The embodiment of the application provides an application program running method, when an instruction for switching the running state of a first application program is received, when the running state of the first application program is switched from a foreground running state to a background running state, a first difference memory between a first memory and a second memory is released, the second memory is reserved, the first memory is a memory occupied by the first application program in the foreground running state, the second memory is a memory occupied by the first application program in the background running state, and the first memory is larger than the second memory.
Referring to fig. 11, a flowchart of an application running method is provided in an embodiment of the present application. As shown in fig. 11, the method of the embodiment of the present application may include the following steps S601 to S602.
S601, receiving an instruction for switching the running state of the first application program.
The specific process is as described above, and is not described herein again.
S602, in response to the instruction, when the operating state of the first application program is switched from the background operating state to the foreground operating state, loading the memory occupied by the first application program from the first memory to the second memory, where the first memory is the memory occupied by the first application program when the first application program operates in the background operating state, the second memory is the memory occupied by the first application program when the first application program operates in the foreground operating state, and the first memory is smaller than the second memory.
According to some embodiments, the first operating state is a background operating state and the second operating state is a foreground operating state. The first memory is the memory occupied by the first application program when the first application program operates in the background operation state, and the second memory is the memory occupied by the first application program when the first application program operates in the foreground operation state. In this embodiment, the first memory is smaller than the second memory, that is, the memory occupied by the first application program when the first application program operates in the background running state is smaller than the memory occupied by the first application program when the first application program operates in the foreground running state.
It is easy to understand that the instruction for switching the running state of the first application received by the terminal may be, for example, switching the running state of the first application from a background running state to a foreground running state. When the terminal receives the instruction, the terminal can switch the running state of the first application program from the background running state to the foreground running state. When the terminal switches the running state of the first application program from the background running state to the foreground running state, the terminal can load the memory occupied by the first application program from the first memory to the second memory.
Optionally, the first memory may be 70M, for example, and the second memory may be 300M, for example. When the terminal receives an instruction for switching the operating state of the wechat application, the terminal can switch the operating state of the wechat application from a background operating state to a foreground operating state, and at this time, the terminal can load the memory occupied by the wechat application from the first memory 70M to the second memory 300M.
The embodiment of the application provides an application program running method, when an instruction for switching the running state of a first application program is received, the running state of the first application program can be switched from a background running state to a foreground running state, a memory occupied by the first application program is loaded from a first memory to a second memory, the first memory is a memory occupied by the first application program when the first application program runs in a background running state, the second memory is a memory occupied by the first application program when the first application program runs in a foreground running state, the first memory is smaller than the second memory, the memory occupied by the first application program does not need to be loaded from zero to the second memory, the memory loading duration can be reduced, the switching duration for switching the first application program into the foreground running state can be improved, and the use experience of a user is improved.
The following describes in detail an application running device provided in an embodiment of the present application with reference to fig. 12. It should be noted that, the running device of the application shown in fig. 12 is used for executing the method of the embodiment shown in fig. 2 to fig. 10 of the present application, for convenience of description, only the portion related to the embodiment of the present application is shown, and details of the technology are not disclosed, please refer to the embodiment shown in fig. 2 to fig. 10 of the present application.
Please refer to fig. 12, which illustrates a schematic structural diagram of an application running device according to an embodiment of the present application. The application running means 1200 may be implemented by software, hardware or a combination of both as all or part of the user terminal. According to some embodiments, the application running apparatus 1200 includes an instruction receiving unit 1201 and a state switching unit 1202, and is specifically configured to:
an instruction receiving unit 1201, configured to receive an instruction to switch an operating state of a first application;
a state switching unit 1202, configured to switch, in response to the instruction, an operating state of the first application from a first operating state to a second operating state, where a memory occupied by the first application when operating in the first operating state is not equal to a memory occupied by the first application when operating in the second operating state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both nonzero.
According to some embodiments, the first operating state is a foreground operating state and the second operating state is a background operating state;
a state switching unit 1202, configured to, in response to the instruction, switch the operation state of the first application program from the first operation state to the second operation state, specifically:
and responding to the instruction, when the running state of the first application program is switched from the foreground running state to the background running state, releasing a first difference memory between a first memory and a second memory, and reserving the second memory, wherein the first memory is a memory occupied by the first application program when the first application program runs in the foreground running state, the second memory is a memory occupied by the first application program when the first application program runs in the background running state, and the first memory is larger than the second memory.
According to some embodiments, the instruction receiving unit 1201 is configured to, before receiving the instruction for switching the operating state of the first application program, further specifically:
receiving a starting instruction aiming at a first application program;
and responding to the starting instruction, and loading the first memory according to preset steps when the running state of the first application program is switched from a third running state to a foreground running state, wherein the third running state is the exit state of the first application program.
According to some embodiments, the state switching unit 1202 is configured to, when the running state of the first application program is switched from the foreground running state to the background running state, release the first difference memory between the first memory and the second memory, and after the second memory is reserved, further specifically configured to:
releasing the second memory when a wake-up instruction aiming at the first application program is not received within a preset time length;
and restarting the first application program, and loading a third memory, wherein the third memory is a memory occupied by the first application program when the first application program operates in a fourth operation state, and the third memory is smaller than the second memory.
According to some embodiments, the state switching unit 1202 is configured to, in response to the instruction, release the first difference memory between the first memory and the second memory when the running state of the first application program is switched from the foreground running state to the background running state, and after the second memory is reserved, further specifically configured to:
receiving an exit instruction aiming at each application program with a background running state;
and responding to the quitting instruction, when the first application program belongs to the preset type of application program, switching the running state of the first application program from the background running state to a fourth running state, releasing a second difference memory between the second memory and a third memory, and reserving the third memory, wherein the third memory is a memory occupied by the first application program when the first application program runs in the fourth running state, and the third memory is smaller than the second memory.
According to some embodiments, the state switching unit 1202, configured to release the first difference memory between the first memory and the second memory when the running state of the first application is switched from the foreground running state to the background running state in response to the instruction, and after the second memory is reserved, further includes:
receiving a starting instruction aiming at a second application program;
and based on the starting instruction, when detecting that the idle memory in the terminal is smaller than a fifth memory, releasing the second memory, wherein the fifth memory is a memory occupied by the second application program when the second application program operates in a foreground operating state.
According to some embodiments, the first operating state is a background operating state and the second operating state is a foreground operating state;
a state switching unit 1202, configured to, in response to the instruction, switch the operation state of the first application program from the first operation state to the second operation state, specifically:
and responding to the instruction, and when the running state of the first application program is switched from the background running state to the foreground running state, loading the memory occupied by the first application program from the first memory to the second memory, wherein the first memory is the memory occupied by the first application program when the first application program runs in the background running state, the second memory is the memory occupied by the first application program when the first application program runs in the foreground running state, and the first memory is smaller than the second memory.
The embodiment of the application provides an application program running device, wherein an instruction receiving unit receives an instruction for switching a running state of a first application program, and a state switching unit responds to the instruction and switches the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program in the running state is not equal to the memory occupied by the first application program in the running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both nonzero. Because the memory occupied by the first application program when running in the first running state is not equal to the memory occupied by the first application program when running in the second running state, when the first application program is in different running states, the terminal can configure the corresponding memory for the running of the first application program, thereby reducing the waste of memory resources and improving the utilization rate of the memory resources.
Please refer to fig. 13, which is a schematic structural diagram of a terminal according to an embodiment of the present application. As shown in fig. 13, the terminal 1300 may include: at least one processor 1301, at least one network interface 1304, a user interface 1303, memory 1305, at least one communication bus 1302.
Wherein a communication bus 1302 is used to enable connective communication between these components.
The user interface 1303 may include a Display screen (Display) and a GPS, and the optional user interface 1303 may also include a standard wired interface and a wireless interface.
The network interface 1304 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Processor 1301 may include one or more processing cores, among other things. The processor 1301 connects various parts throughout the terminal 1300 using various interfaces and lines to perform various functions of the terminal 1300 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1305 and invoking data stored in the memory 1305. Optionally, the processor 1301 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1301 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is to be understood that the modem may not be integrated into the processor 1301, but may be implemented by a single chip.
The Memory 1305 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1305 includes a non-transitory computer-readable medium. The memory 1305 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1305 may optionally be at least one memory device located remotely from the processor 1301. As shown in fig. 13, the memory 1305, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an application program for execution of the application program.
In the terminal 1300 shown in fig. 13, the user interface 1303 is mainly used for providing an input interface for a user to obtain data input by the user; and the processor 1301 may be configured to invoke the running application of the application stored in the memory 1305, and specifically perform the following operations:
receiving an instruction for switching the running state of the first application program;
responding to the instruction, and switching the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program when running in the first running state is not equal to the memory occupied by the first application program when running in the second running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both nonzero.
According to some embodiments, the first operating state is a foreground operating state and the second operating state is a background operating state;
the processor 1301 is configured to, when the operating state of the first application program is switched from the first operating state to the second operating state in response to the instruction, specifically perform the following steps:
and responding to the instruction, when the running state of the first application program is switched from the foreground running state to the background running state, releasing a first difference memory between a first memory and a second memory, and reserving the second memory, wherein the first memory is a memory occupied by the first application program when the first application program runs in the foreground running state, the second memory is a memory occupied by the first application program when the first application program runs in the background running state, and the first memory is larger than the second memory.
According to some embodiments, before the processor 1301 is configured to execute the instruction for switching the operating state of the first application program, the following steps are further specifically performed:
receiving a starting instruction aiming at a first application program;
and responding to the starting instruction, and loading the first memory according to preset steps when the running state of the first application program is switched from a third running state to a foreground running state, wherein the third running state is the exit state of the first application program.
According to some embodiments, the processor 1301 is configured to, in response to the instruction, release the first difference memory between the first memory and the second memory when the running state of the first application program is switched from the foreground running state to the background running state, and after the second memory is reserved, further specifically configured to perform the following steps:
releasing the second memory when a wake-up instruction aiming at the first application program is not received within a preset time length;
and restarting the first application program, and loading a third memory, wherein the third memory is a memory occupied by the first application program when the first application program operates in a fourth operation state, and the third memory is smaller than the second memory.
According to some embodiments, the processor 1301 is configured to, in response to the instruction, release the first difference memory between the first memory and the second memory when the running state of the first application program is switched from the foreground running state to the background running state, and after the second memory is reserved, further specifically configured to perform the following steps:
receiving an exit instruction aiming at each application program with a background running state;
and responding to the quitting instruction, when the first application program belongs to the preset type of application program, switching the running state of the first application program from the background running state to a fourth running state, releasing a second difference memory between the second memory and a third memory, and reserving the third memory, wherein the third memory is a memory occupied by the first application program when the first application program runs in the fourth running state, and the third memory is smaller than the second memory.
According to some embodiments, the processor 1301 is configured to, in response to the instruction, release the first difference memory between the first memory and the second memory when the running state of the first application program is switched from the foreground running state to the background running state, and after the second memory is reserved, further specifically configured to perform the following steps:
receiving a starting instruction aiming at a second application program;
and based on the starting instruction, when detecting that the idle memory in the terminal is smaller than a fifth memory, releasing the second memory, wherein the fifth memory is a memory occupied by the second application program when the second application program operates in a foreground operating state.
According to some embodiments, the first operating state is a background operating state and the second operating state is a foreground operating state;
the processor 1301 is configured to, when the operating state of the first application program is switched from the first operating state to the second operating state in response to the instruction, specifically perform the following steps:
and responding to the instruction, and when the running state of the first application program is switched from the background running state to the foreground running state, loading the memory occupied by the first application program from the first memory to the second memory, wherein the first memory is the memory occupied by the first application program when the first application program runs in the background running state, the second memory is the memory occupied by the first application program when the first application program runs in the foreground running state, and the first memory is smaller than the second memory.
The embodiment of the application provides a terminal, which can respond to a received instruction for switching the running state of a first application program, and can switch the running state of the first application program from a first running state to a second running state.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
Embodiments of the present application also provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of the running method of any one of the application programs as described in the above method embodiments.
It is clear to a person skilled in the art that the solution of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, a Field-ProgrammaBLE Gate Array (FPGA), an Integrated Circuit (IC), or the like.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some service interfaces, devices or units, and may be an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, and the memory may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above description is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure should not be limited thereby. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure are intended to be included within the scope of the present disclosure. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An application program running method, comprising:
receiving an instruction for switching the running state of the first application program;
responding to the instruction, and switching the running state of the first application program from a first running state to a second running state, wherein the memory occupied by the first application program in the running state is not equal to the memory occupied by the first application program in the running state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero.
2. The method of claim 1, wherein the first operating state is a foreground operating state and the second operating state is a background operating state;
the switching the operating state of the first application from a first operating state to a second operating state in response to the instruction comprises:
and in response to the instruction, when the running state of the first application program is switched from the foreground running state to the background running state, releasing a first difference memory between a first memory and a second memory, and reserving the second memory, wherein the first memory is a memory occupied by the first application program when the first application program runs in the foreground running state, the second memory is a memory occupied by the first application program when the first application program runs in the background running state, and the first memory is larger than the second memory.
3. The method according to claim 2, wherein before receiving the instruction for switching the operating state of the first application, the method further comprises:
receiving a starting instruction aiming at the first application program;
and in response to the starting instruction, when the running state of the first application program is switched from a third running state to the foreground running state, loading the first memory according to a preset step, wherein the third running state is an exit state of the first application program.
4. The method according to claim 2, wherein the releasing a first difference memory between a first memory and a second memory when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, and after the reserving the second memory, further comprises:
releasing the second memory when a wake-up instruction aiming at the first application program is not received within a preset time length;
and restarting the first application program, and loading a third memory, wherein the third memory is a memory occupied by the first application program when the first application program operates in a fourth operation state, and the third memory is smaller than the second memory.
5. The method according to claim 2, wherein the releasing a first difference memory between a first memory and a second memory when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, and after the reserving the second memory, further comprises:
receiving an exit instruction aiming at each application program with a background running state;
and responding to the exit instruction, when the first application program belongs to a preset type of application program, switching the running state of the first application program from the background running state to a fourth running state, releasing a second difference memory between the second memory and the third memory, and reserving the third memory, wherein the third memory is a memory occupied by the first application program when running in the fourth running state, and the third memory is smaller than the second memory.
6. The method according to claim 2, wherein the releasing a first difference memory between a first memory and a second memory when the operating state of the first application program is switched from the foreground operating state to the background operating state in response to the instruction, and after the reserving the second memory, further comprises:
receiving a starting instruction aiming at a second application program;
and based on the starting instruction, when detecting that the idle memory in the terminal is smaller than a fifth memory, releasing the second memory, wherein the fifth memory is a memory occupied by the second application program when the second application program operates in a foreground operation state.
7. The method of claim 1, wherein the first operating state is a background operating state and the second operating state is a foreground operating state;
the switching the operating state of the first application from a first operating state to a second operating state in response to the instruction comprises:
and in response to the instruction, when the running state of the first application program is switched from the background running state to the foreground running state, loading the memory occupied by the first application program from a first memory to a second memory, wherein the first memory is the memory occupied by the first application program when the first application program runs in the background running state, the second memory is the memory occupied by the first application program when the first application program runs in the foreground running state, and the first memory is smaller than the second memory.
8. An apparatus for executing an application program, the apparatus comprising:
the instruction receiving unit is used for receiving an instruction for switching the running state of the first application program;
a state switching unit, configured to switch, in response to the instruction, an operating state of the first application from a first operating state to a second operating state, where a memory occupied by the first application when operating in the first operating state is not equal to a memory occupied by the first application when operating in the second operating state; the memory occupied by the first application program when running in the first running state and the memory occupied by the first application program when running in the second running state are both not zero.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of the preceding claims 1 to 7.
CN202010964747.4A 2020-09-15 2020-09-15 Application program running method and device, terminal and storage medium Pending CN112114965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010964747.4A CN112114965A (en) 2020-09-15 2020-09-15 Application program running method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010964747.4A CN112114965A (en) 2020-09-15 2020-09-15 Application program running method and device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN112114965A true CN112114965A (en) 2020-12-22

Family

ID=73802642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010964747.4A Pending CN112114965A (en) 2020-09-15 2020-09-15 Application program running method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112114965A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711477A (en) * 2021-03-29 2021-04-27 北京拓课网络科技有限公司 Method and device for switching application programs and electronic equipment
CN114138147A (en) * 2021-11-16 2022-03-04 努比亚技术有限公司 Application interface display method, terminal and computer readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866908A (en) * 2012-07-25 2013-01-09 广东欧珀移动通信有限公司 Method for cleaning Android background applications and services
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN104375828A (en) * 2014-10-27 2015-02-25 小米科技有限责任公司 Method and device for optimizing memory
CN105117295A (en) * 2015-09-18 2015-12-02 北京金山安全软件有限公司 Memory resource release method and device and electronic equipment
CN107066335A (en) * 2017-03-23 2017-08-18 华南师范大学 A kind of optimization method of cloud platform internal memory and optimization system
CN109614168A (en) * 2018-12-11 2019-04-12 深圳美图创新科技有限公司 Memory Optimize Method and device
CN109891390A (en) * 2017-08-11 2019-06-14 华为技术有限公司 A kind of application switching method and device
CN110018901A (en) * 2018-01-10 2019-07-16 广东欧珀移动通信有限公司 Method for recovering internal storage, device, computer equipment and computer readable storage medium
CN110023906A (en) * 2017-10-13 2019-07-16 华为技术有限公司 A kind of method and device compressed and decompress memory shared by processor
CN111045824A (en) * 2019-12-12 2020-04-21 Oppo广东移动通信有限公司 Application control method and device, electronic equipment and computer readable medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866908A (en) * 2012-07-25 2013-01-09 广东欧珀移动通信有限公司 Method for cleaning Android background applications and services
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN104375828A (en) * 2014-10-27 2015-02-25 小米科技有限责任公司 Method and device for optimizing memory
CN105117295A (en) * 2015-09-18 2015-12-02 北京金山安全软件有限公司 Memory resource release method and device and electronic equipment
CN107066335A (en) * 2017-03-23 2017-08-18 华南师范大学 A kind of optimization method of cloud platform internal memory and optimization system
CN109891390A (en) * 2017-08-11 2019-06-14 华为技术有限公司 A kind of application switching method and device
CN110023906A (en) * 2017-10-13 2019-07-16 华为技术有限公司 A kind of method and device compressed and decompress memory shared by processor
CN110018901A (en) * 2018-01-10 2019-07-16 广东欧珀移动通信有限公司 Method for recovering internal storage, device, computer equipment and computer readable storage medium
CN109614168A (en) * 2018-12-11 2019-04-12 深圳美图创新科技有限公司 Memory Optimize Method and device
CN111045824A (en) * 2019-12-12 2020-04-21 Oppo广东移动通信有限公司 Application control method and device, electronic equipment and computer readable medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711477A (en) * 2021-03-29 2021-04-27 北京拓课网络科技有限公司 Method and device for switching application programs and electronic equipment
CN112711477B (en) * 2021-03-29 2021-06-25 北京拓课网络科技有限公司 Method and device for switching application programs and electronic equipment
CN114138147A (en) * 2021-11-16 2022-03-04 努比亚技术有限公司 Application interface display method, terminal and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11409547B2 (en) Method for rendering user interface and terminal
CN109542614B (en) Resource allocation method, device, terminal and storage medium
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
CN111124668B (en) Memory release method, memory release device, storage medium and terminal
US20160247306A1 (en) Apparatus and method for controlling display in electronic device having processors
US11314391B2 (en) Navigation bar controlling method and terminal
AU2019256257A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN112114965A (en) Application program running method and device, terminal and storage medium
CN112817498A (en) Application authority management method, device, storage medium and terminal
CN111913614B (en) Multi-picture display control method and device, storage medium and display
CN113286349B (en) Personal hot spot connection method, device, terminal and storage medium
CN110730300A (en) Camera control method, device, storage medium and terminal
CN113950043B (en) Communication method, device, storage medium and terminal
CN111949150B (en) Method and device for controlling peripheral switching, storage medium and electronic equipment
CN113568748A (en) Application process processing method and device, storage medium and electronic equipment
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN113010078A (en) Touch method and device, storage medium and electronic equipment
CN112612633A (en) Inter-process communication method, device, storage medium and terminal
CN113495641A (en) Touch screen ghost point identification method and device, terminal and storage medium
CN113098859B (en) Webpage page rollback method, device, terminal and storage medium
WO2022218191A1 (en) Method and apparatus for displaying amount of charge, storage medium, and terminal device
CN112667316A (en) Application loading method and device, terminal and storage medium
CN113535243A (en) Terminal starting method and device, terminal and storage medium
CN116801354A (en) Resource allocation method and device, terminal, server and storage medium
CN112612487A (en) Application installation method and device, storage medium and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination