WO2019028912A1 - 一种应用切换方法及装置 - Google Patents

一种应用切换方法及装置 Download PDF

Info

Publication number
WO2019028912A1
WO2019028912A1 PCT/CN2017/097268 CN2017097268W WO2019028912A1 WO 2019028912 A1 WO2019028912 A1 WO 2019028912A1 CN 2017097268 W CN2017097268 W CN 2017097268W WO 2019028912 A1 WO2019028912 A1 WO 2019028912A1
Authority
WO
WIPO (PCT)
Prior art keywords
target application
terminal
application
memory
target
Prior art date
Application number
PCT/CN2017/097268
Other languages
English (en)
French (fr)
Inventor
党茂昌
符玉襄
周喜渝
李毅
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201780067389.3A priority Critical patent/CN109891390B/zh
Priority to CN202111211373.XA priority patent/CN114153570A/zh
Priority to PCT/CN2017/097268 priority patent/WO2019028912A1/zh
Publication of WO2019028912A1 publication Critical patent/WO2019028912A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/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
    • 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

Definitions

  • the embodiments of the present application relate to the field of communications technologies, and in particular, to an application switching method and apparatus.
  • terminals such as mobile phones and tablets can support the multi-tasking function of the application, that is, the user can run multiple applications at the same time, and each application can be called a task.
  • an application running in the foreground that can directly interact with the user is called a foreground application
  • an application running in the background that cannot directly interact with the user is called a background application.
  • the user can switch the running foreground task to the background through the corresponding button or gesture.
  • the mobile phone runs the WeChat application in the foreground, as shown in (a) of FIG. 1, if the user detects that the user clicks the return button 11, the mobile phone switches the WeChat application as a background application to the background to continue running.
  • the terminal returns to the desktop state, and the user does not see the background application running in the background from the display interface, but the background application still occupies the memory of the mobile phone when running in the background.
  • the embodiment of the present application provides an application switching method and device, which can reduce the memory occupied by the background application and improve the running speed of the terminal.
  • an embodiment of the present application provides an application switching method, including: when a target application is running in a foreground, a terminal acquires a first switching instruction for the target application, where the first switching instruction is used to indicate that the target application is Switching to the background; in response to the first switching instruction, the terminal switches the target application to the background, and releases at least a portion of the memory occupied by the target application, so that the memory occupied by the target application after cutting into the background is reduced, thereby increasing the actual availability of the terminal.
  • the running memory can further improve the running speed of each application in the terminal.
  • the terminal when the terminal releases the memory occupied by the target application, the terminal may release part of the memory occupied by the target application; or, when the terminal releases the memory occupied by the target application, the terminal may also release all the memory occupied by the target application.
  • the embodiment of the present invention does not impose any limitation on this.
  • the terminal may compress the memory data stored in the memory occupied by the target application, and the memory occupied by the target application is reduced due to compression.
  • the part of the memory occupied by the target application is released, so that the terminal can use the released part of the memory when running the other application, thereby improving the running speed of the terminal.
  • the terminal compresses the memory data stored in the memory occupied by the target application, including: the terminal compresses the memory data of the target application by using a compression algorithm corresponding to the target application. That is to say, when the terminal switches different applications to the background, different compression algorithms can be used to compress the memory data in the memory, thereby improving the compression efficiency.
  • the memory data stored in the memory occupied by the target application is After the row compression, the method further includes: the terminal saving a compression identifier associated with the target application, the compression identifier being used to indicate whether the memory data of the target application is compressed, or a compression algorithm used when compressing the memory data of the target application. Subsequently, the terminal may determine, according to the compressed identifier, a corresponding decompression algorithm to decompress the memory data of the target application.
  • the memory occupied by the target application includes a drawing resource for display; therefore, the terminal may release the part occupied by the target application.
  • Drawing resources are all right. Since the target application does not need to be displayed after being switched to the background, the graphics resource is released and cut into the background, which can reduce the memory occupied by the target application after being cut into the background, and can ensure that the target application can run normally in the background after cutting into the background.
  • the terminal may also record current running state information of the target application, where the running state information is used to indicate the running progress of the target application. Subsequently, according to the running status information, the terminal may restore the running progress of the target application to the same state as when the target application switches to the background.
  • the method further includes: the terminal saves the current target application interface map of the target application; or the terminal saves and draws the current application interface of the target application.
  • the target drawing command of the graph In this way, when the target application is restored in the foreground, the user can quickly display the application interface when the target application is last cut into the background, thereby reducing the time for the user to wait for the target application to switch back to the foreground, and improving the smoothness of the application when switching from the background to the foreground.
  • the terminal releases at least a portion of the memory occupied by the target application, including: when the terminal releases the memory occupied by the target application, retaining the memory occupied by the target application interface map or the target drawing command.
  • the method further includes: the terminal acquiring a second switching instruction for the target application, where the second switching instruction is used to indicate that the target application is switched back to the foreground And responding to the second switching instruction, the terminal recovers the memory occupied by the target application; in response to the second switching instruction, the terminal switches the target application back to the foreground to implement seamless switching between the foreground application and the background.
  • the terminal recovers the memory occupied by the target application, including: the terminal decompresses the memory data of the target application by using a decompression algorithm to restore the memory occupied by the target application.
  • the terminal restores the memory occupied by the target application, including: the terminal restores the running progress of the target application to the same state as when the target application switches to the background according to the saved running state information, Restore the memory occupied by the target application.
  • the terminal before the terminal switches the target application back to the foreground, the terminal further includes: displaying, by the terminal, the target application interface map when the target application switches to the background.
  • the terminal further includes: the terminal refreshing the running state of the target application in the foreground, and displaying the running status of the updated application in the foreground when the target application is in the background, so that the user When the target application is switched back to the foreground, the entire change process of the target application from the switch to the background to the running state when switching back to the foreground can be completely viewed.
  • an embodiment of the present application provides a terminal, including: a communication module, configured to: when a target application is running in a foreground, acquire a first switching instruction for the target application, where the first switching instruction is used to indicate that The target application is switched to the background; the processing module is configured to: switch the target application to the background in response to the second switching instruction; And, in response to the second switching instruction, releasing at least a portion of the memory occupied by the target application.
  • the processing module is specifically configured to: compress the memory data stored in the memory occupied by the target application to release part of the memory occupied by the target application.
  • the processing module is specifically configured to compress the memory data of the target application by using a compression algorithm corresponding to the target application.
  • the terminal further includes: a storage module, configured to: save a compression identifier associated with the target application, the compression identifier is used to indicate whether the memory data of the target application is compressed, or compress the The compression algorithm used when the target application's in-memory data.
  • a storage module configured to: save a compression identifier associated with the target application, the compression identifier is used to indicate whether the memory data of the target application is compressed, or compress the The compression algorithm used when the target application's in-memory data.
  • the memory occupied by the target application includes a drawing resource; in this case, the processing module is specifically configured to: release the drawing resource occupied by the target application.
  • the processing module is specifically configured to: release all memory occupied by the target application, and record current running state information of the target application, where the running state information is used to indicate the target application. Running progress.
  • the storage module is further configured to: save a current target application interface map of the target application; or save a target drawing command that draws a current application interface map of the target application.
  • the processing module is specifically configured to: when releasing the memory occupied by the target application, retain the memory occupied by the target application interface map or the target drawing command.
  • the communication module is further configured to: acquire a second switching instruction for the target application, where the second switching instruction is used to indicate that the target application is switched back to the foreground; the processing module is further used And: restoring the memory occupied by the target application in response to the second switching instruction; and, in response to the second switching instruction, switching the target application back to the foreground operation.
  • the processing module is specifically configured to: decompress the memory data of the target application by using a decompression algorithm to restore the memory occupied by the target application.
  • the processing module is specifically configured to: restore the running progress of the target application to the same state as when the target application switches to the background according to the saved running state information, to restore the target application. Occupied memory.
  • the terminal further includes a display module, configured to: display a target application interface map when the target application switches to the background.
  • the processing module is further configured to: refresh the running state of the target application in the foreground.
  • an embodiment of the present application provides a terminal, including: a processor, a memory, a bus, and a communication interface; the memory is configured to store a computer execution instruction, and the processor is connected to the memory through the bus, when the terminal is running The processor executes the computer-executed instructions stored by the memory to cause the terminal to perform any of the application switching methods described above.
  • an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores an instruction, when the instruction is run on any one of the foregoing terminals, causing the terminal to perform any one of the application switching method.
  • an embodiment of the present application provides a computer program product, including an instruction, when the terminal is executed on any of the foregoing terminals, causing the terminal to perform any one of the foregoing application switching methods.
  • the names of the foregoing terminals are not limited to the devices themselves, and in actual implementation, the devices may appear under other names. As long as the functions of the respective devices are similar to the embodiments of the present application, they are within the scope of the claims and their equivalents.
  • FIG. 1 is a schematic diagram of an application scenario when a foreground application is switched to a background in the prior art
  • FIG. 2 is a schematic structural diagram 1 of a terminal according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an application switching method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram 1 of an application scenario of an application switching method according to an embodiment of the present disclosure
  • FIG. 5A is a schematic diagram 2 of an application scenario of an application switching method according to an embodiment of the present disclosure
  • FIG. 5B is a schematic diagram 3 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram 4 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram 5 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram 6 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram 7 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram 8 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic diagram 9 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic diagram of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram 11 of an application scenario of an application switching method according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram 2 of a terminal according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram 3 of a terminal according to an embodiment of the present application.
  • first and second are used for descriptive purposes only, and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining “first” and “second” may include one or more of the features either explicitly or implicitly. In the description of the embodiments of the present application, “multiple” means two or more unless otherwise stated.
  • An application switching method provided by an embodiment of the present application can be applied to a mobile phone, a terminal, an augmented reality (AR), a virtual reality (VR) device, a tablet computer, a notebook computer, a super mobile personal computer (UMPC), a netbook, and a personal number.
  • AR augmented reality
  • VR virtual reality
  • UMPC super mobile personal computer
  • PDA netbook
  • PDA netbook
  • the terminal in the embodiment of the present application may be the mobile phone 100.
  • the embodiment will be specifically described below by taking the mobile phone 100 as an example. It should be understood that the illustrated mobile phone 100 is only one example of the above terminal, and the mobile phone 100 may have more or fewer components than those shown in the figure, two or more components may be combined, or Has a different component configuration.
  • the mobile phone 100 may specifically include: a processor 101, a radio frequency (RF) circuit 102, a memory 103, a touch screen 104, a Bluetooth device 105, one or more sensors 106, a Wi-Fi device 107, a positioning device 108, Components such as audio circuit 109, peripheral interface 110, and power system 111. These parts Communication can occur via one or more communication buses or signal lines (not shown in Figure 2). It will be understood by those skilled in the art that the hardware structure shown in FIG. 2 does not constitute a limitation to the mobile phone, and the mobile phone 100 may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
  • RF radio frequency
  • the processor 101 is a control center of the mobile phone 100, and connects various parts of the mobile phone 100 by using various interfaces and lines, and executes the mobile phone 100 by running or executing an application stored in the memory 103 and calling data stored in the memory 103.
  • the processor 101 may include one or more processing units; for example, the processor 101 may be a Kirin 960 chip manufactured by Huawei Technologies Co., Ltd.
  • the processor 101 may further include a fingerprint verification chip for verifying the collected fingerprint.
  • the processor 101 may further include a graphics processing unit (GPU) 115.
  • the GPU 115 is a microprocessor that performs image computing operations on personal computers, workstations, game consoles, and some mobile devices (such as tablets, smart phones, etc.). It can convert the display information required by the mobile phone 100 and provide a line scan signal to the display 104-2 to control the correct display of the display 104-2.
  • the mobile phone 100 may send a corresponding drawing command to the GPU 115.
  • the drawing command may be “drawing a rectangle having a length and a width of a ⁇ b at the coordinate position (x, y).
  • the GPU 115 can quickly calculate all the pixels of the graphic according to the drawing instruction, and draw corresponding graphics on the specified position on the display 104-2.
  • the GPU 115 may be integrated in the processor 101 in the form of a functional module, or may be disposed in the mobile phone 100 in a separate physical form (for example, a video card).
  • the radio frequency circuit 102 can be used to receive and transmit wireless signals during transmission or reception of information or calls.
  • the radio frequency circuit 102 can process the downlink data of the base station and then process it to the processor 101; in addition, transmit the data related to the uplink to the base station.
  • radio frequency circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency circuit 102 can also communicate with other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to global mobile communication systems, general packet radio services, code division multiple access, wideband code division multiple access, long term evolution, email, short message service, and the like.
  • the memory 103 is used to store applications and data, and the processor 101 executes various functions and data processing of the mobile phone 100 by running applications and data stored in the memory 103.
  • the memory 103 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.); the storage data area can be stored according to the use of the mobile phone. Data created at 100 o'clock (such as audio data, phone book, etc.).
  • the memory 103 may include high speed random access memory (RAM), and may also include nonvolatile memory such as a magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
  • the memory 103 can store various operating systems, for example, developed by Apple. Operating system, developed by Google Inc. Operating system, etc.
  • the above memory 103 may be independent and connected to the processor 101 via the above communication bus; the memory 103 may also be integrated with the processor 101.
  • the random access memory of the mobile phone 100 may also be referred to as a memory or a running memory, and each application installed in the mobile phone 100 needs to occupy a certain memory to run an application related program during the running process. Therefore, when the memory is larger, the mobile phone 100 can run more applications at the same time, can run various applications more quickly, and can switch between different applications more quickly.
  • the memory size of the mobile phone 100 is constant, in order to prevent the background application running in the background from occupying too much mobile phone memory, when the mobile phone 100 switches the foreground application to run in the background, the part occupied by the application may be released. Or all the memory, so that the memory occupied by the application after being cut into the background is reduced, thereby increasing the running memory that the mobile phone 100 can actually use, and improving the running speed of each application in the terminal.
  • the touch screen 104 may specifically include a touch panel 104-1 and a display 104-2.
  • the touch panel 104-1 can collect touch events on or near the user of the mobile phone 100 (for example, the user uses any suitable object such as a finger, a stylus, or the like on the touch panel 104-1 or on the touchpad 104.
  • the operation near -1), and the collected touch information is sent to other devices (for example, processor 101).
  • the touch event of the user in the vicinity of the touch panel 104-1 may be referred to as a hovering touch; the hovering touch may mean that the user does not need to directly touch the touchpad in order to select, move or drag a target (eg, an icon, etc.) And only the user is located near the terminal in order to perform the desired function.
  • the touch panel 104-1 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • a display (also referred to as display) 104-2 can be used to display information entered by the user or information provided to the user as well as various menus of the mobile phone 100.
  • the display 104-2 can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the touchpad 104-1 can be overlaid on the display 104-2, and when the touchpad 104-1 detects a touch event on or near it, it is transmitted to the processor 101 to determine the type of touch event, and then the processor 101 may provide a corresponding visual output on display 104-2 depending on the type of touch event.
  • the touchpad 104-1 and the display 104-2 are implemented as two separate components to implement the input and output functions of the handset 100, in some embodiments, the touchpad 104- 1 is integrated with the display screen 104-2 to implement the input and output functions of the mobile phone 100. It is to be understood that the touch screen 104 is formed by stacking a plurality of layers of materials. In the embodiment of the present application, only the touch panel (layer) and the display screen (layer) are shown, and other layers are not described in the embodiment of the present application. .
  • the touch panel 104-1 may be disposed on the front surface of the mobile phone 100 in the form of a full-board
  • the display screen 104-2 may also be disposed on the front surface of the mobile phone 100 in the form of a full-board, so that the front of the mobile phone can be borderless. Structure.
  • the mobile phone 100 can also have a fingerprint recognition function.
  • the fingerprint reader 112 can be configured on the back of the handset 100 (eg, below the rear camera) or on the front side of the handset 100 (eg, below the touch screen 104).
  • the fingerprint collection device 112 can be configured in the touch screen 104 to implement the fingerprint recognition function, that is, the fingerprint collection device 112 can be integrated with the touch screen 104 to implement the fingerprint recognition function of the mobile phone 100.
  • the fingerprint capture device 112 is disposed in the touch screen 104 and may be part of the touch screen 104 or may be otherwise disposed in the touch screen 104.
  • the main component of the fingerprint collection device 112 in the embodiment of the present application is a fingerprint sensor, which can employ any type of sensing technology, including but not limited to optical, capacitive, piezoelectric or ultrasonic sensing technologies.
  • the mobile phone 100 can also include a Bluetooth device 105 for enabling data exchange between the handset 100 and other short-range terminals (eg, mobile phones, smart watches, etc.).
  • the Bluetooth device in this embodiment of the present application may be Integrated circuit or Bluetooth chip.
  • the handset 100 can also include at least one type of sensor 106, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display of the touch screen 104 according to the brightness of the ambient light, and the proximity sensor may turn off the power of the display when the mobile phone 100 moves to the ear.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.
  • the mobile phone 100 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
  • the Wi-Fi device 107 is configured to provide the mobile phone 100 with network access complying with the Wi-Fi related standard protocol, and the mobile phone 100 can access the Wi-Fi access point through the Wi-Fi device 107, thereby helping the user to send and receive emails, Browsing web pages and accessing streaming media, etc., it provides users with wireless broadband Internet access.
  • the Wi-Fi device 107 can also function as a Wi-Fi wireless access point, and can provide Wi-Fi network access to other terminals.
  • the positioning device 108 is configured to provide a geographic location for the mobile phone 100. It can be understood that the positioning device 108 can be specifically a receiver of a positioning system such as a Global Positioning System (GPS) or a Beidou satellite navigation system, or a Russian GLONASS. After receiving the geographical location transmitted by the positioning system, the positioning device 108 sends the information to the processor 101 for processing, or sends it to the memory 103 for storage.
  • GPS Global Positioning System
  • Beidou satellite navigation system Beidou satellite navigation system
  • Russian GLONASS Russian GLONASS
  • the positioning device 108 may also be a receiver that assists the Global Positioning System (AGPS), which assists the positioning device 108 in performing ranging and positioning services by acting as a secondary server, in which case The secondary location server provides location assistance over a wireless communication network in communication with a location device 108, such as a GPS receiver, of the handset 100.
  • AGPS Global Positioning System
  • the positioning device 108 can also be a Wi-Fi access point based positioning technology. Since each Wi-Fi access point has a globally unique MAC address, the terminal can scan and collect the broadcast signals of the surrounding Wi-Fi access points when Wi-Fi is turned on, so that Wi- can be obtained.
  • the geographic location combined with the strength of the Wi-Fi broadcast signal, calculates the geographic location of the terminal and sends it to the location device 108 of the terminal.
  • the audio circuit 109, the speaker 113, and the microphone 114 can provide an audio interface between the user and the handset 100.
  • the audio circuit 109 can transmit the converted electrical data of the received audio data to the speaker 113 for conversion to the sound signal output by the speaker 113; on the other hand, the microphone 114 converts the collected sound signal into an electrical signal by the audio circuit 109. After receiving, it is converted into audio data, and then the audio data is output to the RF circuit 102 for transmission to, for example, another mobile phone, or the audio data is output to the memory 103 for further processing.
  • the peripheral interface 110 is used to provide various interfaces for external input/output devices (such as a keyboard, a mouse, an external display, an external memory, a subscriber identity module card, etc.).
  • external input/output devices such as a keyboard, a mouse, an external display, an external memory, a subscriber identity module card, etc.
  • a universal serial bus (USB) interface is connected to the mouse, and a metal contact on the card slot of the subscriber identification module is connected to a subscriber identity module card (SIM) card provided by the telecommunications carrier.
  • SIM subscriber identity module card
  • Peripheral interface 110 can be used to input the above external /
  • the output peripheral is coupled to the processor 101 and the memory 103.
  • the mobile phone 100 may further include a power supply device 111 (such as a battery and a power management chip) that supplies power to the various components.
  • the battery may be logically connected to the processor 101 through the power management chip to manage charging, discharging, and power management through the power supply device 111. And other functions.
  • the mobile phone 100 may further include a camera (front camera and/or rear camera), a flash, a micro projection device, a near field communication (NFC) device, and the like, and details are not described herein.
  • a camera front camera and/or rear camera
  • a flash a flash
  • micro projection device a micro projection device
  • NFC near field communication
  • the method includes:
  • the terminal acquires a first switching instruction for the target application, where the first switching instruction is used to indicate that the target application is switched to the background.
  • the target application may be any application installed in the terminal, for example, an application downloaded by the user from the third-party application market, or an application that is provided by the terminal system, and the embodiment of the present invention does not impose any limitation.
  • the terminal runs the target application in the foreground
  • the user can directly operate the target application in the display interface of the terminal, for example, opening a video in a video application, finding a contact in a contact application, and the like.
  • the terminal detects the user's operation.
  • the first switching instruction can be generated, that is, the target application is switched from the foreground to the background.
  • the terminal may also generate a first switching instruction for the foreground application, which is not limited in this embodiment of the present invention.
  • the terminal may perform the following steps 302 and 303 to improve the running speed of the terminal.
  • the terminal saves the current application interface diagram of the target application or draws a drawing command of the application interface diagram.
  • the terminal may save the application interface diagram of the target application when the first switching instruction is obtained, for example, as shown in FIG. 4, when the user clicks the return button 41 of the terminal, the WeChat application
  • the current application interface diagram is a chat window 42 between the user and "Little".
  • the terminal can manage the running foreground application and the background application in the form of an application stack 51.
  • the application stack 51 follows the principle of advanced and outgoing, and the terminal always displays and executes the application located at the top of the stack.
  • the application at the top of the stack is the foreground application.
  • the new application When the terminal starts a new application, the new application is pushed into the top of the stack of the application stack 51 as a new foreground application. At this time, the foreground application originally located at the top of the stack is cut into the background and is not displayed. As shown in FIG. 5A, the application located at the bottom of the stack in the application stack 51 is a short message application, and the application at the top of the stack is a WeChat application (ie, the terminal is executing a WeChat application in the foreground).
  • a target stack dedicated to storing the application interface map can be set in the terminal, and the target stack can be associated with the application stack in the terminal. That is to say, the location of an application in the application stack is the same as the location of the application interface diagram when the application is cut into the background.
  • the application interface diagram 1 of the generated short message application may be saved to the first target stack 52; when the terminal cuts the WeChat application into the background, the generated micro The application interface of the letter application is pressed into the top of the stack of the first target stack 52; when the terminal subsequently cuts other applications into the background, the corresponding application interface map can be pushed onto the top of the stack of the first target stack 52, so that the application The respective applications in the stack 51 correspond one-to-one with the respective application interface maps in the first target stack 52.
  • the terminal may first pop the application interface map associated with the target application from the first target stack 52 to the top of the stack and display it to the user, and the application stack 51 is pressed.
  • the target application pushed onto the stack pops up to the top of the stack, thereby restoring the target application in the foreground.
  • the user can quickly display the application interface when the target application is last cut into the background, thereby reducing the time for the user to wait for the target application to switch back to the foreground, and improving the smoothness of the application when switching from the background to the foreground.
  • the terminal may also draw the target application of the GPU at this time.
  • the drawing command used in the application interface (which may include one or more drawing commands) is saved.
  • the GPU saves the drawing command used when drawing the chat window 42 of the user in FIG. 4 with the "small", so that When the terminal switches the target application back to the foreground, the GPU can quickly draw the chat window 42 according to the saved drawing command to display to the user, thereby reducing the time for the user to wait for the target application to resume when switching back to the foreground.
  • the terminal may also associate and save the above drawing command with the application stack in a stack form, as shown in FIG. 5B.
  • the GPU may draw the application interface of the current short message application.
  • the drawing command 1 is saved to the second target stack 53; when the terminal cuts the WeChat application into the background, the drawing command 2 used by the GPU to draw the application interface diagram 2 of the current WeChat application can be saved to the second target stack 53;
  • the drawing command used by the GPU to draw the current application interface diagram of the application may continue to be pushed into the second target stack 53, so that each application in the application stack 51 and the second target stack
  • the drawing commands of the respective application interface diagrams in 53 correspond one-to-one.
  • the terminal switches the foregoing target application to the background.
  • the terminal releases part or all of the memory occupied by the target application.
  • the operating state of the application in the terminal can be divided into an active state, a pause state, and a stop state.
  • the foreground application running in the foreground is in an active state.
  • the terminal switches the foreground application to the background as a background application
  • the running state of the application can be changed to a suspended state. Subsequently, if the user or the terminal clears the process of the application.
  • the terminal can modify the running state of the application to the stop state.
  • the running state of the application is the pause state, although the application is cut into the background and exits the display interface of the terminal, the application still occupies the memory of the terminal and runs in the background after being cut into the background.
  • the terminal may trigger the terminal to switch the running state of the target application to the suspended state, and the new running task (for example, the task running the desktop) Or the task of running a new application) pushes the top of the stack of the application stack, causing the target application to be switched to the background.
  • the terminal may also release part or all of the memory occupied by the target application, in order to prevent the target application from occupying a large amount of memory after the station. The size of the unoccupied memory in the terminal increases, and the memory size that the terminal can use when running other applications increases, thereby improving the running speed of the terminal.
  • the terminal may compress the memory data saved in the memory 601 occupied by the target application by using a preset compression algorithm, so that The memory 602 occupied by the target application is reduced after compression.
  • the size of the memory 601 is 50M
  • the terminal can merge and sort the fragmented data in the 50M memory by using a compression algorithm, so that the size of the memory 602 occupied by the target application is reduced to 20M after compression.
  • the memory occupied by the target application is reduced by 30M, that is, the terminal releases 30M of memory space, and then the actually available memory of the terminal is increased by 30M, so that the terminal The terminal can also use this 30M memory when running other applications, thereby increasing the speed of the terminal.
  • the compression algorithm may further compress the running state data such as data and stack data generated by the target application running process, and the memory occupied by the target application after the compression is also reduced, so that the target application is switched to the memory occupied by the background. . Subsequently, when the terminal switches the target application back to the foreground, the memory data that has been compressed can be decompressed, and the decompressed memory data is the same as the compressed memory data, thereby ensuring that the target application has the same running state before and after the switching, and the target application is implemented. Seamless connection to improve user experience.
  • the running state data such as data and stack data generated by the target application running process
  • the terminal may reserve the memory data of some application functions preset, that is, not compress the memory data, for example, the process of refreshing the message in the background of the WeChat application, and the music application. Background playback process, etc.
  • the terminal cuts the target application compressed by the memory data into the background, the functions of the target application can still be guaranteed to operate normally, thereby improving the user experience.
  • the terminal can also compress its memory data using different compression algorithms. For example, when the memory size occupied by the target application is greater than the first threshold, the terminal may compress the memory data by using a compression algorithm with a higher compression rate; when the memory size occupied by the target application is smaller than the second threshold (the second threshold is less than or equal to In the foregoing first threshold, the terminal may compress the memory data by using a compression algorithm with a lower compression rate, which is not limited in this embodiment of the present invention.
  • the compressed identifier associated with the target application may also be saved.
  • the compressed identifier is saved at the corresponding location of the target application in the application stack 51.
  • the compression identifier "1" can be set to indicate that the memory data of the target application is compressed, and the compression identifier "0" is used to indicate that the memory data of the target application has not been compressed. Then, when the subsequent terminal restores the target application to the foreground, the compressed identifier may be used to determine whether to decompress the memory data of the target application.
  • the compression identifier may be used to indicate a compression algorithm specifically used when compressing the memory data of the target application. For example, the compression identifier "01" is used to indicate that the compression algorithm used to compress the memory data of the target application is the algorithm 1, and the compression identifier "00" is used to indicate that the compression algorithm used when compressing the memory data of the target application is the algorithm 2. Then, when the subsequent terminal restores the target application to the foreground, the corresponding decompression algorithm may be determined according to the compressed identifier to decompress the memory data of the target application.
  • the memory occupied by the target application runtime may be further divided into a drawing resource 701 and other resources 702 for display on the terminal (for example, resources occupied by the process runtime). , the specifications of the currently displayed elements, etc.). Then, when the terminal switches the target application to the background, the target application is not displayed in the display interface of the terminal when the target application is running in the background. Therefore, the terminal can release the drawing resource 701, thereby reducing the memory occupied by the background application. Improve the speed of the terminal.
  • the terminal saves the current application interface map 42 of the target application (or draws the drawing command of the application interface diagram 42) in the above step 302, then, as shown in FIG. 8, when the terminal switches the target application to the background Only the application interface diagram 42 in the drawing resource 701 (or the drawing command of the application interface diagram 42) may be retained, and the remaining memory in the drawing resource 701 may be released.
  • the application interface diagram 42 displayed in the last frame when the target application is switched to the background may be displayed to the user, and then the drawing resource 701 of the terminal is reloaded, thereby completing the foreground in the foreground. Restore the target app.
  • the restored target application is consistent with the running state when the target application switches to the background. In this way, not only can the memory occupied by the target application in the background be reduced, but also the waiting time of the user can be reduced when the target application is restored in the foreground, and the running speed of the terminal is improved.
  • the drawing resource 701 and other resources 702 occupied by the target application may also be released, thereby minimizing the occupation of the target application after being cut into the background.
  • the terminal may record the running state information of the target application when the target application is switched to the background.
  • the running status information may include a package name of the target application, so that when the terminal subsequently switches the target application back to the foreground, the target application may be restarted in the foreground according to the package name of the target application, so that the target application is While switching between the foreground and the background, the memory occupied by the target application in the background is minimized.
  • the running progress of the target application when cutting into the background may be recorded.
  • the terminal may record the chat information with the user A as the running progress in the running status information.
  • the target application may be restarted in the foreground according to the package name of the target application, and the target application may be restored to the switch according to the running progress recorded in the running state information.
  • the running progress in the background enables the target application to seamlessly connect before and after cutting into the background, which greatly improves the user experience while reducing the target application occupying memory in the background.
  • the terminal saves the current application interface map 42 of the target application (or draws the drawing command of the application interface diagram 42) in the above step 302, then, as shown in FIG. 10, the terminal releases the drawing resource 701 occupied by the target application and When other resources are 702, the above application interface diagram 42 may be retained (or the mapping should be The drawing command of interface 42 is not released.
  • the application interface diagram 42 displayed in the last frame when the target application is switched to the background may be displayed to the user, and then the target application is restored in the foreground according to the recorded running state information. In this way, not only can the memory occupied by the target application in the background be reduced, but also the waiting time of the user can be reduced when the target application is restored in the foreground, and the running speed of the terminal is improved.
  • the terminal may release part or all of the memory occupied by the target application by using the foregoing step 304, so that the target application is switched to the background and does not occupy too much memory resources of the terminal, thereby increasing The amount of memory actually available to the terminal to increase the speed of the terminal.
  • the terminal may perform step 303 to switch the target application to the background, and then perform step 304 to release the memory occupied by the target application in the background, or perform steps 303 and 304 simultaneously through two parallel processes, that is, the terminal switches the target application.
  • the memory occupied by the target application is released at the same time as the background.
  • the embodiment of the present invention does not impose any limitation on this.
  • the steps 303 and 304 may be performed after the terminal responds to the first switching instruction acquired in step 301, that is, after the terminal acquires the first switching instruction, the terminal may be triggered to execute the target application. Switching to the background and releasing the memory occupied by the target application eliminates the need for the user to manually clean up the memory occupied by the application.
  • the terminal acquires a second switching instruction for the target application, where the second switching instruction is used to indicate that the target application is switched back to the foreground operation.
  • the terminal switches the target application to the background, if it detects that the user triggers the operation of opening the target application again, for example, clicking an icon of the target application, or, as shown in FIG. 11, the user clicks in the multitasking interface.
  • the terminal When the target application is located in the target window 801 or the like, the terminal generates a second switching instruction to the target application, that is, the target application is switched back to the foreground running instruction.
  • the terminal displays an application interface diagram when the target application is switched to the background.
  • step 306 after the terminal acquires the second switching instruction that switches the target application back to the foreground, the terminal may first apply the application interface diagram of the target application saved in step 302 (for example, the application of the WeChat application saved in FIG. 4).
  • the interface diagram 42 is displayed to the user.
  • the application interface diagram completely reflects the running state when the terminal switches the target application (ie, the WeChat application) to the background, the user can see the last time.
  • the operation state of the target application at a time then, for the user, not only avoids the feeling of the card when the application switches back to the foreground, but also makes the whole process of the application switching back to the foreground smoother, and realizes the application from cutting into the background to cutting back.
  • the seamless connection between the two processes at the front desk since the application interface diagram completely reflects the running state when the terminal switches the target application (ie, the WeChat application) to the background, the user can see the last time.
  • the operation state of the target application at a time then, for
  • the terminal may pop the target application in the application stack 51 to the top of the stack, and associate the application interface diagram of the first target stack 52 with the target application. Pop up to the top of the stack. At this time, the terminal may display an application interface diagram of the target application located at the top of the first target stack 52.
  • the terminal saves the drawing command used by the GPU to draw the application interface map of the target application in step 302, then in step 306, the GPU may draw the application of the last frame when the target application cuts into the background according to the drawing command.
  • the interface diagram is displayed to the user, which also makes the application process back to the foreground more smooth, and realizes the seamless connection between the application and the process of cutting back to the foreground.
  • the terminal restores memory occupied by the target application.
  • the terminal needs to restore the memory occupied by the target application, so that the terminal can be in the foreground, because the terminal releases the part or all of the memory resources occupied by the target application before the target application is switched to the background. Run the target app. Since the decompressed memory data is the same as the compressed memory data, the target application is consistent in the running state before and after the switching, and the seamless connection of the target application is realized.
  • the terminal may decompress the compressed memory data by using a corresponding decompression algorithm, so that the terminal Restore the memory occupied by the above target application.
  • the terminal may reconstruct the released drawing by reconstructing the drawing context and re-drawing.
  • the resource enables the terminal to recover the memory occupied by the above target application.
  • the restored target application is consistent with the running state when the target application switches to the background.
  • the terminal may restart the target application according to the recorded running state information of the target application and resume the running of the target application.
  • the progress is such that the terminal restores the memory occupied by the above target application.
  • the terminal restores the occupied memory for the target application, so that the target application that has been cut into the background is switched back to the foreground display to restore the interactivity of the target application when running in the foreground.
  • step 307 can be performed simultaneously with the step 306, so as to improve the speed at which the terminal restores the target application in the foreground, so that the smoothness of the target application in the background and foreground switching is improved.
  • the terminal refreshes the running state of the target application in the foreground.
  • the terminal may display the latest running state of the target application in the foreground, that is, refresh the display interface of the target application when the foreground is running.
  • the terminal restores the memory of the WeChat application, and after the WeChat application is switched back to the foreground, the new message (or the icon of the new message) 901 received by the WeChat application in the background can be refreshed in the current display interface.
  • the entire change process of the WeChat application from the time of switching to the background to switching back to the foreground can be completely observed.
  • the above terminal and the like include hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present application can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
  • the embodiment of the present application may perform the division of the function modules on the terminal or the like according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic. Only for a logical function division, there may be another division method in actual implementation.
  • FIG. 14 is a schematic diagram of a possible structure of a terminal involved in the foregoing embodiment, where the terminal includes: an obtaining unit 1101, a saving unit 1102, a releasing unit 1103, and The switching unit 1104, the recovery unit 1105, the display unit 1106, and the refresh unit 1107.
  • the obtaining unit 1101 is configured to support the terminal to perform the processes 301 and 305 in FIG. 3; the saving unit 1102 is configured to support the terminal to execute the process 302 in FIG. 3; the releasing unit 1103 is configured to support the terminal to execute the process 303 in FIG. 3; the switching unit 1104 The support unit performs the process 304 in FIG. 3; the recovery unit 1105 is configured to support the terminal to execute the process 307 in FIG. 3; the display unit 1106 is configured to support the terminal to perform the process 306 in FIG. 3; the refresh unit 1107 is configured to support the terminal to execute Process 308 in FIG. All the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
  • the above-mentioned release unit 1103, switching unit 1104, recovery unit 1105, and refresh unit 1107 can be integrated into a processing module
  • the storage unit 1102 is used as a storage module
  • the acquisition unit 1101 is used as a communication module
  • the display unit 1101 is displayed as a communication module.
  • Unit 1106 acts as a display module.
  • the processing module 1302 is configured to control and manage the action of the terminal.
  • the communication module 1303 is configured to support communication between the terminal and other network entities.
  • the storage module 1301 is configured to save program codes and data of the terminal.
  • the display module 1304 is for displaying information input by the user or information provided to the user and various menus of the terminal.
  • the terminal when the target application is running in the foreground, the terminal may acquire a first switching instruction for the target application by using the communication module 1303, where the first switching instruction is used to indicate that the target application is switched to the background; and further, the processing module 1302 can switch the target application to the background; and release at least a portion of the memory occupied by the target application in the storage module 1301 to improve the running speed of the terminal.
  • the processing module 1302 may be a processor or a controller, for example, may be a central processing unit (CPU), a GPU, a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit. (Application-Specific Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • the communication module 1303 may be a transceiver, a transceiver circuit, an input/output device, a communication interface, or the like.
  • the communication module 1303 may specifically be a Bluetooth device, a Wi-Fi device, a peripheral interface, or the like.
  • the memory module 1301 may be a memory, which may include a high speed random access memory (RAM), and may also include a nonvolatile memory such as a magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
  • RAM high speed random access memory
  • nonvolatile memory such as a magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
  • the display module 1304 can be a display, and the display can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • a touch panel can be integrated on the display for collecting touch events on or near the display, and transmitting the collected touch information to other devices (such as a processor, etc.).
  • the processing module 1302 is a processor and a GPU
  • the communication module 1303 is a radio frequency circuit
  • the storage module 1301 is a memory
  • the display module 1304 is a display
  • the terminal provided by the embodiment of the present invention may be the mobile phone 100 shown in FIG.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transfer to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL), or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

本申请的实施例提供一种应用切换方法及装置,涉及通信技术领域,可降低后台应用运行时占用的内存,提高终端的运行速度。该方法包括:当目标应用在前台运行时,终端获取对该目标应用的第一切换指令,该第一切换指令用于指示将该目标应用切换至后台;响应于第一切换指令,终端将该目标应用切换至后台;响应于第一切换指令,终端释放该目标应用占用的至少一部分内存。

Description

一种应用切换方法及装置 技术领域
本申请实施例涉及通信技术领域,尤其涉及一种应用切换方法及装置。
背景技术
目前,手机和平板电脑等终端均可支持应用的多任务处理功能,即用户可以在同一时间内运行多个应用,每个应用可被称作一个任务。其中,在前台运行的可与用户直接交互的应用称为前台应用,而在后台运行的不能与用户直接交互的应用称为后台应用。
以安卓系统为例,用户可以通过相应的按钮或手势将正在运行的前台任务切换至后台运行。例如,手机在前台运行微信应用时,如图1中的(a)所示,如果检测到用户点击返回按钮11,则手机将微信应用作为后台应用切换至后台继续运行,此时,如图1中的(b)所示,终端返回桌面状态,用户从显示界面中看不到在后台运行的后台应用,但后台应用在后台运行时仍然会占用手机的内存。
那么,当后台运行的后台应用过多时,这些后台应用占用的内存也会增加,导致手机的运行速度降低,手机容易出现卡顿现象。
发明内容
本申请的实施例提供一种应用切换方法及装置,可降低后台应用运行时占用的内存,提高终端的运行速度。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,本申请的实施例提供一种应用切换方法,包括:当目标应用在前台运行时,终端获取对该目标应用的第一切换指令,该第一切换指令用于指示将该目标应用切换至后台;响应于第一切换指令,终端将该目标应用切换至后台,并释放该目标应用占用的至少一部分内存,从而使得目标应用切入后台后占用的内存减小,从而增加终端实际可利用的运行内存,进而可提高终端内各应用的运行速度。
在一种可能的设计方法中,终端在释放目标应用占用的内存时,可释放该目标应用占用部分内存;或者,终端在释放目标应用占用的内存时,也可释放该目标应用占用的全部内存,本发明实施例对此不作任何限制。
当终端释放该目标应用占用的部分内存时,在一种可能的设计方法中,终端可将该目标应用占用的内存中存储的内存数据进行压缩,由于压缩后目标应用占用的内存减小,从而释放该目标应用占用的部分内存,这样,终端在运行其他应用时终端也可使用被释放的这部分内存,从而提高终端的运行速度。
在一种可能的设计方法中,终端将该目标应用占用的内存中存储的内存数据进行压缩,包括:终端使用与该目标应用对应的压缩算法,对该目标应用的内存数据进行压缩。也就是说,当终端将不同的应用切换至后台时,可使用不同的压缩算法对其内存中的内存数据进行压缩,从而提高压缩效率。
在一种可能的设计方法中,在终端将该目标应用占用的内存中存储的内存数据进 行压缩之后,还包括:终端保存与该目标应用关联的压缩标识,该压缩标识用于指示该目标应用的内存数据是否被压缩,或者,压缩该目标应用的内存数据时使用的压缩算法。后续,终端可根据该压缩标识确定相应的解压算法对目标应用的内存数据进行解压。
当终端释放该目标应用占用的部分内存时,在另一种可能的设计方法中,由于目标应用占用的内存中包括用于进行显示的绘图资源;因此,终端可释放该目标应用占用的这部分绘图资源即可。由于目标应用切换至后台后不需要进行显示,因此,将其绘图资源释放后切入后台,既可以降低目标应用切入后台后占用的内存,又可以保证目标应用切入后台后能够正常在后台运行。
当终端释放该目标应用占用的全部内存时,终端还可记录该目标应用当前的运行状态信息,该运行状态信息用于指示该目标应用的运行进度。后续,终端根据该运行状态信息,可将该目标应用的运行进度恢复至与该目标应用切换至后台时相同的状态。
在一种可能的设计方法中,在终端获取对该目标应用的第一切换指令之后,还包括:终端保存该目标应用当前的目标应用界面图;或者,终端保存绘制该目标应用当前的应用界面图的目标绘图命令。这样,在前台恢复该目标应用时可以快速为用户展示目标应用最后一次切入后台时的应用界面,从而减少用户等待目标应用切换回前台时进行恢复的时间,提升应用从后台切换回前台时流畅性。
在一种可能的设计方法中,终端释放该目标应用占用的至少一部分内存,包括:终端释放该目标应用占用的内存时,保留该目标应用界面图或该目标绘图命令占用的内存。
在一种可能的设计方法中,在终端将该目标应用切换至后台之后,还包括:终端获取对该目标应用的第二切换指令,该第二切换指令用于指示将该目标应用切换回前台;响应于第二切换指令,终端恢复该目标应用占用的内存;响应于第二切换指令,终端将该目标应用切换回前台运行,实现目标应用在前台和后台之间的无缝切换。
在一种可能的设计方法中,终端恢复该目标应用占用的内存,包括:终端通过解压算法对该目标应用的内存数据进行解压,以恢复该目标应用占用的内存。
在一种可能的设计方法中,终端恢复该目标应用占用的内存,包括:终端根据保存的运行状态信息,将该目标应用的运行进度恢复至与该目标应用切换至后台时相同的状态,以恢复该目标应用占用的内存。
在一种可能的设计方法中,在终端将该目标应用切换回前台运行之前,还包括:终端显示该目标应用切换至后台时的目标应用界面图。
在一种可能的设计方法中,终端将该目标应用切换回前台运行之后,还包括:终端在前台刷新该目标应用的运行状态,将目标应用在后台时更新的运行状态显示在前台,使用户将目标应用切换回前台时可以完整的观看到目标应用从切换至后台到切换回前台时运行状态的整个变化过程。
第二方面,本申请的实施例提供一种终端,包括:通信模块,用于:当目标应用在前台运行时,获取对该目标应用的第一切换指令,该第一切换指令用于指示将该目标应用切换至后台;处理模块,用于:响应于第二切换指令,将目标应用切换至后台; 以及,响应于第二切换指令,释放该目标应用占用的至少一部分内存。
在一种可能的设计方法中,该处理模块,具体用于:将该目标应用占用的内存中存储的内存数据进行压缩,以释放该目标应用占用的部分内存。
在一种可能的设计方法中,该处理模块,具体用于:使用与该目标应用对应的压缩算法,对该目标应用的内存数据进行压缩。
在一种可能的设计方法中,该终端还包括:存储模块,用于:保存与该目标应用关联的压缩标识,该压缩标识用于指示该目标应用的内存数据是否被压缩,或者,压缩该目标应用的内存数据时使用的压缩算法。
在一种可能的设计方法中,目标应用占用的内存中包括绘图资源;此时,该处理模块,具体用于:释放该目标应用占用的绘图资源。
在一种可能的设计方法中,该处理模块,具体用于:将该目标应用占用的全部内存释放,并且,记录该目标应用当前的运行状态信息,该运行状态信息用于指示该目标应用的运行进度。
在一种可能的设计方法中,该存储模块,还用于:保存该目标应用当前的目标应用界面图;或者,保存绘制该目标应用当前的应用界面图的目标绘图命令。
在一种可能的设计方法中,该处理模块,具体用于:释放该目标应用占用的内存时,保留该目标应用界面图或该目标绘图命令占用的内存。
在一种可能的设计方法中,该通信模块,还用于:获取对该目标应用的第二切换指令,该第二切换指令用于指示将该目标应用切换回前台;该处理模块,还用于:响应于第二切换指令,恢复该目标应用占用的内存;以及,响应于第二切换指令,将该目标应用切换回前台运行。
在一种可能的设计方法中,该处理模块,具体用于:通过解压算法对该目标应用的内存数据进行解压,以恢复该目标应用占用的内存。
在一种可能的设计方法中,该处理模块,具体用于:根据保存的运行状态信息,将该目标应用的运行进度恢复至与该目标应用切换至后台时相同的状态,以恢复该目标应用占用的内存。
在一种可能的设计方法中,该终端还包括显示模块,用于:显示该目标应用切换至后台时的目标应用界面图。
在一种可能的设计方法中,上述处理模块,还用于:在前台刷新该目标应用的运行状态。
第三方面,本申请的实施例提供一种终端,包括:处理器、存储器、总线和通信接口;该存储器用于存储计算机执行指令,该处理器与该存储器通过该总线连接,当终端运行时,该处理器执行该存储器存储的该计算机执行指令,以使终端执行上述任一项应用切换方法。
第四方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在上述任一项终端上运行时,使得终端执行上述任一项应用切换方法。
第五方面,本申请实施例提供一种包含指令的计算机程序产品,当其在上述任一项终端上运行时,使得终端执行上述任一项应用切换方法。
本申请的实施例中,上述终端的名字对设备本身不构成限定,在实际实现中,这些设备可以以其他名称出现。只要各个设备的功能和本申请的实施例类似,即属于本申请权利要求及其等同技术的范围之内。
另外,第二方面至第五方面中任一种设计方式所带来的技术效果可参见上述第一方面中不同设计方法所带来的技术效果,此处不再赘述。
附图说明
图1为现有技术中前台应用切换至后台时的应用场景示意图;
图2为本申请实施例提供的一种终端的结构示意图一;
图3为本申请实施例提供的一种应用切换方法的流程示意图;
图4为本申请实施例提供的一种应用切换方法的应用场景示意图一;
图5A为本申请实施例提供的一种应用切换方法的应用场景示意图二;
图5B为本申请实施例提供的一种应用切换方法的应用场景示意图三;
图6为本申请实施例提供的一种应用切换方法的应用场景示意图四;
图7为本申请实施例提供的一种应用切换方法的应用场景示意图五;
图8为本申请实施例提供的一种应用切换方法的应用场景示意图六;
图9为本申请实施例提供的一种应用切换方法的应用场景示意图七;
图10为本申请实施例提供的一种应用切换方法的应用场景示意图八;
图11为本申请实施例提供的一种应用切换方法的应用场景示意图九;
图12为本申请实施例提供的一种应用切换方法的应用场景示意图十;
图13为本申请实施例提供的一种应用切换方法的应用场景示意图十一;
图14为本申请实施例提供的一种终端的结构示意图二;
图15为本申请实施例提供的一种终端的结构示意图三。
具体实施方式
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请实施例提供的一种应用切换方法,可应用于手机、终端、增强现实(AR)\虚拟现实(VR)设备、平板电脑、笔记本电脑、超级移动个人计算机(UMPC)、上网本、个人数字助理(PDA)等任意终端上,当然,在以下实施例中,对该终端的具体形式不作任何限制。
如图2所示,本申请实施例中的终端可以为手机100。下面以手机100为例对实施例进行具体说明。应该理解的是,图示手机100仅是上述终端的一个范例,并且手机100可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。
如图2所示,手机100具体可以包括:处理器101、射频(RF)电路102、存储器103、触摸屏104、蓝牙装置105、一个或多个传感器106、Wi-Fi装置107、定位装置108、音频电路109、外设接口110以及电源系统111等部件。这些部件 可通过一根或多根通信总线或信号线(图2中未示出)进行通信。本领域技术人员可以理解,图2中示出的硬件结构并不构成对手机的限定,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图2对手机100的各个部件进行具体的介绍:
处理器101是手机100的控制中心,利用各种接口和线路连接手机100的各个部分,通过运行或执行存储在存储器103内的应用程序,以及调用存储在存储器103内的数据,执行手机100的各种功能和处理数据。在一些实施例中,处理器101可包括一个或多个处理单元;举例来说,处理器101可以是华为技术有限公司制造的麒麟960芯片。在本申请一些实施例中,上述处理器101还可以包括指纹验证芯片,用于对采集到的指纹进行验证。
在本发明实施例中,处理器101还可以包括图形处理器(Graphics Processing Unit,GPU)115。其中,GPU 115是一种专门在个人电脑、工作站、游戏机和一些移动设备(如平板电脑、智能手机等)上进行图像运算工作的微处理器。它可将手机100所需要的显示信息进行转换驱动,并向显示器104-2提供行扫描信号,控制显示器104-2的正确显示。
具体的,在显示过程中,手机100可将相应的绘图命令发送给GPU 115,例如,该绘图命令可以为“在坐标位置(x,y)处画个长和宽为a×b大小的长方形”,那么,GPU 115根据该绘图指令便可以迅速计算出该图形的所有像素,并在显示器104-2上指定位置画出相应的图形。
需要说明的是,GPU 115可以以功能模块的形式集成在处理器101内,也可以以独立的实体形态(例如,显卡)设置在手机100内,本发明实施例对此不作任何限制。
射频电路102可用于在收发信息或通话过程中,无线信号的接收和发送。特别地,射频电路102可以将基站的下行数据接收后,给处理器101处理;另外,将涉及上行的数据发送给基站。通常,射频电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频电路102还可以通过无线通信和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统、通用分组无线服务、码分多址、宽带码分多址、长期演进、电子邮件、短消息服务等。
存储器103用于存储应用程序以及数据,处理器101通过运行存储在存储器103的应用程序以及数据,执行手机100的各种功能以及数据处理。存储器103主要包括存储程序区以及存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等);存储数据区可以存储根据使用手机100时所创建的数据(比如音频数据、电话本等)。此外,存储器103可以包括高速随机存取存储器(RAM),还可以包括非易失存储器,例如磁盘存储器件、闪存器件或其他易失性固态存储器件等。存储器103可以存储各种操作系统,例如,苹果公司所开发的
Figure PCTCN2017097268-appb-000001
操作系统,谷歌公司所开发的
Figure PCTCN2017097268-appb-000002
操作系统等。上述存储器103可以是独立的,通过上述通信总线与处理器101相连接;存储器103也可以和处理器101集成在一起。
其中,手机100的随机存取存储器也可被称为内存或运行内存,手机100内安装的各应用在运行过程中均需要占用一定的内存运行应用相关程序。因此,当内存越大时手机100可以同时运行更多的应用,可更为迅速地运行各个应用,也可更加快速地在不同应用之间切换。
在本发明实施例中,当手机100的内存大小一定时,为了避免在后台运行的后台应用占用过多的手机内存,当手机100将前台应用切换至后台运行时,可释放该应用占用的部分或全部内存,使得应用切入后台运行后占用的内存减小,从而增加手机100可实际利用的运行内存,提高终端内各应用的运行速度。
触摸屏104具体可以包括触控板104-1和显示器104-2。
其中,触控板104-1可采集手机100的用户在其上或附近的触摸事件(比如用户使用手指、触控笔等任何适合的物体在触控板104-1上或在触控板104-1附近的操作),并将采集到的触摸信息发送给其他器件(例如处理器101)。其中,用户在触控板104-1附近的触摸事件可以称之为悬浮触控;悬浮触控可以是指,用户无需为了选择、移动或拖动目标(例如图标等)而直接接触触控板,而只需用户位于终端附近以便执行所想要的功能。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型来实现触控板104-1。
显示器(也称为显示屏)104-2可用于显示由用户输入的信息或提供给用户的信息以及手机100的各种菜单。可以采用液晶显示器、有机发光二极管等形式来配置显示器104-2。触控板104-1可以覆盖在显示器104-2之上,当触控板104-1检测到在其上或附近的触摸事件后,传送给处理器101以确定触摸事件的类型,随后处理器101可以根据触摸事件的类型在显示器104-2上提供相应的视觉输出。虽然在图2中,触控板104-1与显示屏104-2是作为两个独立的部件来实现手机100的输入和输出功能,但是在某些实施例中,可以将触控板104-1与显示屏104-2集成而实现手机100的输入和输出功能。可以理解的是,触摸屏104是由多层的材料堆叠而成,本申请实施例中只展示出了触控板(层)和显示屏(层),其他层在本申请实施例中不予记载。另外,触控板104-1可以以全面板的形式配置在手机100的正面,显示屏104-2也可以以全面板的形式配置在手机100的正面,这样在手机的正面就能够实现无边框的结构。
另外,手机100还可以具有指纹识别功能。例如,可以在手机100的背面(例如后置摄像头的下方)配置指纹识别器112,或者在手机100的正面(例如触摸屏104的下方)配置指纹识别器112。又例如,可以在触摸屏104中配置指纹采集器件112来实现指纹识别功能,即指纹采集器件112可以与触摸屏104集成在一起来实现手机100的指纹识别功能。在这种情况下,该指纹采集器件112配置在触摸屏104中,可以是触摸屏104的一部分,也可以以其他方式配置在触摸屏104中。本申请实施例中的指纹采集器件112的主要部件是指纹传感器,该指纹传感器可以采用任何类型的感测技术,包括但不限于光学式、电容式、压电式或超声波传感技术等。
手机100还可以包括蓝牙装置105,用于实现手机100与其他短距离的终端(例如手机、智能手表等)之间的数据交换。本申请实施例中的蓝牙装置可以是 集成电路或者蓝牙芯片等。
手机100还可以包括至少一种传感器106,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节触摸屏104的显示器的亮度,接近传感器可在手机100移动到耳边时,关闭显示器的电源。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机100还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
Wi-Fi装置107,用于为手机100提供遵循Wi-Fi相关标准协议的网络接入,手机100可以通过Wi-Fi装置107接入到Wi-Fi接入点,进而帮助用户收发电子邮件、浏览网页和访问流媒体等,它为用户提供了无线的宽带互联网访问。在其他一些实施例中,该Wi-Fi装置107也可以作为Wi-Fi无线接入点,可以为其他终端提供Wi-Fi网络接入。
定位装置108,用于为手机100提供地理位置。可以理解的是,该定位装置108具体可以是全球定位系统(GPS)或北斗卫星导航系统、俄罗斯GLONASS等定位系统的接收器。定位装置108在接收到上述定位系统发送的地理位置后,将该信息发送给处理器101进行处理,或者发送给存储器103进行保存。在另外的一些实施例中,该定位装置108还可以是辅助全球卫星定位系统(AGPS)的接收器,AGPS系统通过作为辅助服务器来协助定位装置108完成测距和定位服务,在这种情况下,辅助定位服务器通过无线通信网络与终端例如手机100的定位装置108(即GPS接收器)通信而提供定位协助。在另外的一些实施例中,该定位装置108也可以是基于Wi-Fi接入点的定位技术。由于每一个Wi-Fi接入点都有一个全球唯一的MAC地址,终端在开启Wi-Fi的情况下即可扫描并收集周围的Wi-Fi接入点的广播信号,因此可以获取到Wi-Fi接入点广播出来的MAC地址;终端将这些能够标示Wi-Fi接入点的数据(例如MAC地址)通过无线通信网络发送给位置服务器,由位置服务器检索出每一个Wi-Fi接入点的地理位置,并结合Wi-Fi广播信号的强弱程度,计算出该终端的地理位置并发送到该终端的定位装置108中。
音频电路109、扬声器113、麦克风114可提供用户与手机100之间的音频接口。音频电路109可将接收到的音频数据转换后的电信号,传输到扬声器113,由扬声器113转换为声音信号输出;另一方面,麦克风114将收集的声音信号转换为电信号,由音频电路109接收后转换为音频数据,再将音频数据输出至RF电路102以发送给比如另一手机,或者将音频数据输出至存储器103以便进一步处理。
外设接口110,用于为外部的输入/输出设备(例如键盘、鼠标、外接显示器、外部存储器、用户识别模块卡等)提供各种接口。例如通过通用串行总线(USB)接口与鼠标连接,通过用户识别模块卡卡槽上的金属触点与电信运营商提供的用户识别模块卡(SIM)卡进行连接。外设接口110可以被用来将上述外部的输入/ 输出外围设备耦接到处理器101和存储器103。
手机100还可以包括给各个部件供电的电源装置111(比如电池和电源管理芯片),电池可以通过电源管理芯片与处理器101逻辑相连,从而通过电源装置111实现管理充电、放电、以及功耗管理等功能。
尽管图2未示出,手机100还可以包括摄像头(前置摄像头和/或后置摄像头)、闪光灯、微型投影装置、近场通信(NFC)装置等,在此不再赘述。
以下,将结合具体实施例详细阐述本申请实施例提供的一种应用切换方法,如图3所述,该方法包括:
301、当目标应用在前台运行时,终端获取对该目标应用的第一切换指令,该第一切换指令用于指示将该目标应用切换至后台。
其中,上述目标应用可以是终端内安装的任意应用,例如用户从第三方应用市场下载的应用,或者终端系统自带的应用等,本发明实施例对此不作任何限制。
当终端在前台运行目标应用时,用户可以在终端的显示界面中直接操作该目标应用,例如,在视频应用中打开视频,在联系人应用中查找联系人等。那么,如图4所示,当用户点击终端的返回按键41(或HOME按键)时,说明用户想要退出正在前台运行的微信应用(即目标应用),那么,终端检测到用户的这一操作后可生成第一切换指令,即将目标应用从前台切换至后台的指令。
当然,有的应用在在前台运行时会跳转或链接至其他应用,此时,终端也可生成对该前台应用的第一切换指令,本发明实施例对此不作任何限制。
进而,响应于上述第一切换指令,在终端将上述目标应用作为后台应用切换至后台之前,终端可先执行下述步骤302和303,以提高终端的运行速度。
302、终端保存上述目标应用当前的应用界面图或者绘制该应用界面图的绘图命令。
可选的,在步骤302中,终端可以将获取到上述第一切换指令时目标应用的应用界面图保存下来,例如,仍如图4所示,当用户点击终端的返回按键41时,微信应用当前的应用界面图为用户与“小蝌蚪”的聊天窗口42。
如图5A所示,终端可以应用栈(stack)51的形式管理正在运行的前台应用和后台应用,应用栈51遵循先进后出的原则,终端总是显示和执行位于栈顶的应用,该位于栈顶的应用即为前台应用。
当终端启动新的应用时,会将该新的应用作为新的前台应用压入应用栈51的栈顶,此时,原本位于栈顶的前台应用被切入后台不做显示。如图5A所示,应用栈51中位于栈底的应用为短信应用,位于栈顶的应用为微信应用(即终端在前台正在执行微信应用)。
那么,可以在终端内设置一个专门用于存储应用界面图的目标栈,该目标栈可以与终端内的应用栈相关联。也就是说,某个应用在应用栈中的位置,与该应用切入后台时的应用界面图在上述目标栈中的位置相同。
仍如图5A所示,当终端将短信应用切入后台时,可将生成的短信应用的应用界面图1保存至第一目标栈52中;当终端将微信应用切入后台时,可将生成的微 信应用的应用界面图2压入第一目标栈52的栈顶;当终端后续将其他应用切入后台时,可将对应的应用界面图继续压入第一目标栈52的栈顶,这样,应用栈51中的各个应用与第一目标栈52中的各个应用界面图一一对应。
后续,当终端将上述目标应用切换回前台时,终端可先从第一目标栈52中将与该目标应用关联的应用界面图弹出至栈顶显示给用户,并且,将应用栈51中被压入栈的目标应用弹出至栈顶,从而在前台恢复该目标应用。这样,在前台恢复目标应用时可以快速为用户展示目标应用最后一次切入后台时的应用界面,从而减少用户等待目标应用切换回前台时进行恢复的时间,提升应用从后台切换回前台时流畅性。
又或者,由于终端显示界面中显示的应用界面一般都是由GPU通过执行相应的绘图命令绘制的,那么,当终端获取到上述第一切换指令时,终端也可以将此时GPU绘制目标应用的应用界面时使用的绘图命令(该绘图命令中可包括一条或多条绘图命令)保存下来,例如,GPU保存绘制图4中用户与“小蝌蚪”的聊天窗口42时使用的绘图命令,这样,当终端将上述目标应用切换回前台时,GPU可根据保存的绘图命令快速绘制出上述聊天窗口42,以展示给用户,从而减少用户等待目标应用切换回前台时进行恢复的时间。
类似的,终端也可将上述绘图命令以堆栈的形式与应用栈关联并保存,如图5B所示,当终端将短信应用切入后台时,可将GPU绘制当前短信应用的应用界面图1时使用的绘图命令1保存至第二目标栈53中;当终端将微信应用切入后台时,可将GPU绘制当前微信应用的应用界面图2时使用的绘图命令2保存至第二目标栈53中;当终端后续将其他应用切入后台时,可将GPU绘制该应用当前的应用界面图时的使用的绘图命令继续压入第二目标栈53中,这样,应用栈51中的各个应用与第二目标栈53中的各个应用界面图的绘图命令一一对应。
303、终端将上述目标应用切换至后台。
304、终端释放上述目标应用所占用的部分或全部内存。
以安卓系统为例,应用在终端内的运行状态可以划分为活动状态(active)、暂停状态(pause)和停止状态(stop)。一般,在在前台运行的前台应用处于活动状态,当终端将前台应用切换至后台作为后台应用时,可将该应用的运行状态修改为暂停状态,后续,如果用户或终端将该应用的进程清理掉时,终端可将该应用的运行状态修改为停止状态。而当应用的运行状态为暂停状态时,虽然该应用被切入后台退出了终端的显示界面,但该应用被切入后台后仍然占用终端的内存在后台运行着。
那么,在步骤303和304中,当终端获取到对上述目标应用的第一切换指令后,可触发终端将该目标应用的运行状态切换为暂停状态,将新的运行任务(例如运行桌面的任务或者运行新应用的任务)压入应用栈的栈顶,使得目标应用被切换至后台。并且,在终端将上述目标应用切换至后台时或者将上述目标应用切换至后台后,为了避免目标应用在台后占用大量的内存,终端还可以释放该目标应用所占用的部分或全部内存,这样,终端内未被占用的内存大小增加,终端后续在运行其他应用时可使用的内存大小增加,从而可提高终端的运行速度。
在一种可能的设计方法中,如图6所示,在将上述目标应用切换至后台时,终端可以使用预设的压缩算法对上述目标应用占用的内存601中保存的内存数据进行压缩,使得压缩后目标应用占用的内存602减小。
例如,如图6所示,内存601的大小为50M,终端可以通过压缩算法对这50M内存中的碎片化数据进行合并和整理,这样,压缩后上述目标应用占用的内存602大小降低为20M。此时,终端将目标应用切换至后台时,上述目标应用占用的内存减小了30M,即终端释放了30M的内存空间,那么,终端此时实际可用的内存也相应增加了30M,这样,终端在运行其他应用时终端也可使用这30M的内存,从而提高终端的运行速度。
又或者,上述压缩算法还可以是对目标应用运行过程产生的对数据、栈数据等运行状态数据进行压缩,压缩后目标应用占用的内存也将降低,使得上述目标应用切换至后台占用的内存减少。后续,终端将目标应用切换回前台时可对已经被压缩的内存数据进行解压,解压后的内存数据与压缩时的内存数据相同,从而保证目标应用在切换前后的运行状态一致,实现目标应用的无缝接续,提高用户使用体验。
可选的,在上述内存数据的压缩过程中,终端可以对预先设置的一些应用功能的内存数据保留,即对这些内存数据不进行压缩,例如,微信应用在后台刷新消息的进程、音乐应用的后台播放进程等。这样,终端将内存数据压缩后的目标应用切入后台时,仍然能够保证目标应用的这些功能正常运行,从而提高用户体验。
进一步地,对于不同的目标应用,终端还可以使用不同的压缩算法对其内存数据进行压缩。例如,当目标应用占用的内存大小大于第一阈值时,终端可使用压缩率较高的压缩算法对其内存数据进行压缩;当目标应用占用的内存大小小于第二阈值(第二阈值小于或等于上述第一阈值)时,终端可使用压缩率较低的压缩算法对其内存数据进行压缩,本发明实施例对此不作任何限制。
另外,当终端对目标应用的内存数据进行压缩后,还可以保存一个与该目标应用关联的压缩标识,例如,在上述应用栈51中目标应用的对应位置处保存该压缩标识。
示例性的,可设置压缩标识“1”用于指示该目标应用的内存数据被压缩过,压缩标识“0”用于指示该目标应用的内存数据没有被压缩过。那么,后续终端将上述目标应用恢复至前台运行时,可以根据该压缩标识确定是否对上述目标应用的内存数据进行解压。
又或者,当终端内设置有多种压缩算法时,上述压缩标识可以用于指示压缩上述目标应用的内存数据时具体使用的压缩算法。例如,压缩标识“01”用于指示压缩上述目标应用的内存数据时使用的压缩算法为算法1,压缩标识“00”用于指示压缩上述目标应用的内存数据时使用的压缩算法为算法2。那么,后续终端将上述目标应用恢复至前台运行时,可以根据该压缩标识确定相对应的解压算法对上述目标应用的内存数据进行解压。
可以理解的是,本领域技术人员可以根据实际经验或者实际应用场景设置上述压缩算法,本发明实施例对此不做任何限制。
在一种可能的设计方法中,如图7所示,目标应用运行时占用的内存可以进一步划分为用于在终端上进行显示的绘图资源701和其他资源702(例如,进程运行时占用的资源,当前显示的元素的规格等)。那么,当终端将上述目标应用切换至后台时,由于目标应用在后台运行时不会在终端的显示界面中显示,因此,终端可以将上述绘图资源701释放掉,从而降低后台应用占用的内存,提高终端的运行速度。
又或者,如果终端在上述步骤302中保存了目标应用当前的应用界面图42(或者绘制应用界面图42的绘图命令),那么,如图8所示,当终端将上述目标应用切换至后台时,可仅保留绘图资源701中的应用界面图42(或者绘制应用界面图42的绘图命令),而绘图资源701中剩余的内存可以被释放掉。
那么,当终端后续将上述目标应用切换回前台时,可先将目标应用切换至后台时最后一帧显示的应用界面图42展示给用户,进而重新加载终端的绘图资源701,从而在前台完整的恢复该目标应用。此时,由于目标应用占用的内存被恢复后与目标应用切换至后台时占用的内存一致,因此,恢复出的目标应用与目标应用切换至后台时的运行状态一致。这样一来,不仅可以降低目标应用在后台时占用的内存,还可以在前台恢复目标应用时减少用户的等待时间,提升终端的运行速度。
又或者,如图9所示,当终端将上述目标应用切换至后台时,还可以将目标应用占用的绘图资源701和其他资源702都释放掉,从而最大程度的降低目标应用切入后台后占用的内存。此时,终端可以记录将上述目标应用切换至后台时该目标应用的运行状态信息。
例如,该运行状态信息可以包括目标应用的包名(package name),这样,当终端后续将上述目标应用切换回前台时,可根据目标应用的包名在前台重新启动该目标应用,使得目标应用在前台和后台之间实现切换的同时,最大程度的降低目标应用在后台时占用的内存。
又例如,该运行状态信息中除了记录目标应用的包名外,还可以记录目标应用切入后台时的运行进度。例如,以微信应用为目标应用举例,如果将微信应用切入后台时,微信应用停留在与用户A聊天的界面,那么,终端可以将与用户A的聊天信息作为运行进度记录在上述运行状态信息中。这样,当终端后续将上述目标应用切换回前台时,可根据目标应用的包名在前台重新启动该目标应用,并且,还可以根据其运行状态信息中记录的运行进度将目标应用恢复至切换入后台时的运行进度,使得目标应用在切切入后台前后可以实现无缝对接,在降低目标应用在后台占用内存的同时大大提高了用户的使用体验。
当然,如果终端在上述步骤302中保存了目标应用当前的应用界面图42(或者绘制应用界面图42的绘图命令),那么,如图10所示,终端在释放目标应用占用的绘图资源701和其他资源702时,可保留上述应用界面图42(或者绘制应 用界面图42的绘图命令)不被释放。这样,当终端后续将上述目标应用切换回前台时,可先将目标应用切换至后台时最后一帧显示的应用界面图42展示给用户,进而根据记录的运行状态信息在前台恢复该目标应用。这样一来,不仅可以降低目标应用在后台时占用的内存,还可以在前台恢复目标应用时减少用户的等待时间,提升终端的运行速度。
至此,终端在将目标应用切换至后台前,可通过上述步骤304释放上述目标应用所占用的部分或全部内存,这样,目标应用被切换至后台后不会占用终端过多的内存资源,从而增加终端实际可用的内存大小,以提高终端的运行速度。
需要说明的是,本申请实施例中对上述步骤303和304的执行顺序不做任何限定。例如,终端可以先执行步骤303将目标应用切换至后台,再执行步骤304释放目标应用在后台占用的内存,也可以通过并行的两条进程同时执行步骤303和304,即终端在将目标应用切换至后台的同时,释放目标应用占用的内存,本发明实施例对此不作任何限制。
示例性的,步骤303和304均可为终端响应于步骤301中获取到的第一切换指令后执行的,也就是说,当终端获取到上述第一切换指令后,可触发终端执行将目标应用切换至后台以及释放目标应用占用的内存这两个动作,无需用户手动清理应用占用的内存。
305、终端获取对目标应用的第二切换指令,该第二切换指令用于指示将该目标应用切换回前台运行。
可选的,终端将上述目标应用切换至后台后,如果检测到用户再次触发打开该目标应用的操作,例如,点击目标应用的图标,或者,如图11所示,用户在多任务界面中点击目标应用所在的目标窗口801等,则终端此时生成对目标应用的第二切换指令,即将该目标应用切换回前台运行的指令。
306、终端显示上述目标应用切换至后台时的应用界面图。
在步骤306中,当终端获取到上述将目标应用切换回前台的第二切换指令后,终端可首先将步骤302中保存的上述目标应用的应用界面图(例如图4中保存的微信应用的应用界面图42)显示给用户,如图12所示,由于该应用界面图完整的反映了终端将目标应用(即微信应用)切换至后台时的运行状态,因此,用户可以第一时间看到最后一次操作目标应用时的运行状态,那么,对于用户而言,不仅避免了应用切换回前台时出现的卡顿感受,同时使得应用切换回前台的整个过程更加流畅,实现应用从切入后台到切回前台这两个过程的无缝衔接。
具体的,终端获取到上述第二切换指令后,如图5所示,终端可将应用栈51中的目标应用弹出至栈顶,并将第一目标栈52中与目标应用关联的应用界面图弹出至栈顶。此时,终端可显示位于第一目标栈52栈顶的上述目标应用的应用界面图。
当然,如果在步骤302中终端保存的是GPU绘制上述目标应用的应用界面图时使用的绘图命令,那么,在步骤306中,GPU可根据该绘图命令绘制目标应用切入后台时最后一帧的应用界面图并展示给用户,同样可以使得应用切换回前台的整个过程更加流畅,实现应用从切入后台到切回前台这两个过程的无缝衔接。
307、终端恢复上述目标应用占用的内存。
由于在终端在将上述目标应用切换至后台前释放了该目标应用占用的部分或全部内存资源,因此,在步骤307中,终端需要重新恢复上述目标应用占用的内存,以使得终端能够在前台正常运行该目标应用。由于解压后的内存数据与压缩时的内存数据相同,从而保证目标应用在切换前后的运行状态一致,实现目标应用的无缝接续
示例性的,如果在步骤303中终端通过压缩目标应用的内存数据的方法释放了其占用的内存,那么,在步骤307中,终端可以通过相应的解压算法将被压缩的内存数据解压,使得终端恢复上述目标应用占用的内存。
又或者,如果在步骤303中终端通过释放目标应用占用的绘图资源的方法释放了其占用的内存,那么,在步骤307中,终端可以通过重建绘图上下文、以及重新绘图等方式重建被释放的绘图资源,使得终端恢复上述目标应用占用的内存。同样,由于目标应用占用的内存被恢复后与目标应用切换至后台时占用的内存一致,因此,恢复出的目标应用与目标应用切换至后台时的运行状态一致。
又或者,如果在步骤303中终端释放了目标应用占用的绘图资源和其他资源,那么,在步骤307中,终端可以根据记录的目标应用的运行状态信息重新启动该目标应用并恢复目标应用的运行进度,使得终端恢复上述目标应用占用的内存。
至此,通过步骤305-307,终端为目标应用恢复其占用的内存,使得已经切入后台的目标应用重新切换回前台显示,恢复目标应用在前台运行时的可交互性。
需要说明的是,上述步骤307可与步骤306同时执行,从而提高终端在前台恢复目标应用的速度,使得目标应用在后台和前台切换时的流畅性提升。
308、终端在前台刷新上述目标应用的运行状态。
可选的,在步骤308中,终端将目标应用切换回前台之后,终端可在前台显示上述目标应用最新的运行状态,即刷新上述目标应用在前台运行时的显示界面。如图13所示,终端恢复了微信应用的内存,将微信应用重新切换回前台后,可将微信应用在后台运行时接收到的新消息(或新消息的图标)901刷新在当前的显示界面中,那么,用户将微信应用切换回前台时可以完整的观看到微信应用从切换至后台到切换回前台时运行状态的整个变化过程。
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性 的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图14示出了上述实施例中所涉及的终端的一种可能的结构示意图,该终端包括:获取单元1101、保存单元1102、释放单元1103、切换单元1104、恢复单元1105、显示单元1106以及刷新单元1107。
获取单元1101用于支持终端执行图3中的过程301和305;保存单元1102用于支持终端执行图3中的过程302;释放单元1103用于支持终端执行图3中的过程303;切换单元1104用于支持终端执行图3中的过程304;恢复单元1105用于支持终端执行图3中的过程307;显示单元1106用于支持终端执行图3中的过程306;刷新单元1107用于支持终端执行图3中的过程308。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
在采用集成的单元的情况下,可将上述释放单元1103、切换单元1104、恢复单元1105以及刷新单元1107集成为处理模块,将保存单元1102作为存储模块,将获取单元1101作为通信模块,将显示单元1106作为显示模块。
此时,如图15所示,示出了上述实施例中所涉及的终端的一种可能的结构示意图。其中,处理模块1302用于对终端的动作进行控制管理。通信模块1303用于支持终端与其他网络实体的通信。存储模块1301用于保存终端的程序代码和数据。显示模块1304用于显示由用户输入的信息或提供给用户的信息以及终端的各种菜单。
在本发明实施例中,当目标应用在前台运行时,终端可通过通信模块1303获取对目标应用的第一切换指令,该第一切换指令用于指示将目标应用切换至后台;进而,处理模块1302可将目标应用切换至后台;并且,释放存储模块1301中目标应用占用的至少一部分内存,以提高终端的运行速度。
其中,上述应用切换方法涉及的各步骤的所有相关内容均可以援引到上述实施例步骤301-308中的相关描述,在此不再赘述。
示例性的,处理模块1302可以是处理器或控制器,例如可以是中央处理器(Central Processing Unit,CPU),GPU,通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。
通信模块1303可以是收发器、收发电路、输入输出设备或通信接口等。例如,通信模块1303具体可以是蓝牙装置、Wi-Fi装置、外设接口等等。
存储模块1301可以是存储器,该存储器可以包括高速随机存取存储器(RAM),还可以包括非易失存储器,例如磁盘存储器件、闪存器件或其他易失性固态存储器件等。
显示模块1304可以为显示器,具体可以采用液晶显示器、有机发光二极管等形式来配置显示器。另外,显示器上还可以集成触控板,用于采集在其上或附近的触摸事件,并将采集到的触摸信息发送给其他器件(例如处理器等)。
当处理模块1302为处理器和GPU,通信模块1303为射频电路,存储模块1301为存储器,显示模块1304为显示器时,本发明实施例所提供的终端可以为图2所示的手机100。
在上述实施例中,可以全部或部分的通过软件,硬件,固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式出现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,DVD)或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (29)

  1. 一种应用切换方法,其特征在于,包括:
    当目标应用在前台运行时,终端获取对所述目标应用的第一切换指令,所述第一切换指令用于指示将所述目标应用切换至后台;
    响应于所述第一切换指令,所述终端将所述目标应用切换至后台;
    响应于所述第一切换指令,所述终端释放所述目标应用占用的至少一部分内存。
  2. 根据权利要求1所述的方法,其特征在于,所述终端释放所述目标应用占用的至少一部分内存,包括:
    所述终端将所述目标应用占用的内存中存储的内存数据进行压缩,以释放所述目标应用占用的部分内存。
  3. 根据权利要求2所述的方法,其特征在于,所述终端将所述目标应用占用的内存中存储的内存数据进行压缩,包括:
    所述终端使用与所述目标应用对应的压缩算法,对所述目标应用的内存数据进行压缩。
  4. 根据权利要求2或3所述的方法,其特征在于,在所述终端将所述目标应用占用的内存中存储的内存数据进行压缩之后,还包括:
    所述终端保存与所述目标应用关联的压缩标识,所述压缩标识用于指示所述目标应用的内存数据是否被压缩,或者,压缩所述目标应用的内存数据时使用的压缩算法。
  5. 根据权利要求1所述的方法,其特征在于,所述目标应用占用的内存中包括绘图资源;
    其中,所述终端释放所述目标应用占用的至少一部分内存,包括:
    所述终端释放所述目标应用占用的绘图资源。
  6. 根据权利要求1所述的方法,其特征在于,所述终端释放所述目标应用占用的至少一部分内存,包括:
    所述终端将所述目标应用占用的全部内存释放,并且,记录所述目标应用当前的运行状态信息,所述运行状态信息用于指示所述目标应用的运行进度。
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,在终端获取对所述目标应用的第一切换指令之后,还包括:
    所述终端保存所述目标应用当前的目标应用界面图;或者,
    所述终端保存绘制所述目标应用当前的应用界面图的目标绘图命令。
  8. 根据权利要求7所述的方法,其特征在于,所述终端释放所述目标应用占用的至少一部分内存,包括:
    所述终端释放所述目标应用占用的至少一部分内存时,保留所述目标应用界面图或所述目标绘图命令占用的内存。
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,在所述终端将所述目标应用切换至后台之后,还包括:
    所述终端获取对所述目标应用的第二切换指令,所述第二切换指令用于指示将所述目标应用切换回前台;
    响应于所述第二切换指令,所述终端恢复所述目标应用占用的内存;
    响应于所述第二切换指令,所述终端将所述目标应用切换回前台运行。
  10. 根据权利要求9所述的方法,其特征在于,所述终端恢复所述目标应用占用的内存,包括:
    所述终端通过解压算法对所述目标应用的内存数据进行解压,以恢复所述目标应用占用的内存。
  11. 根据权利要求9所述的方法,其特征在于,所述终端恢复所述目标应用占用的内存,包括:
    所述终端根据保存的运行状态信息,将所述目标应用的运行进度恢复至与所述目标应用切换至后台时相同的状态,以恢复所述目标应用占用的内存。
  12. 根据权利要求9-11中任一项所述的方法,其特征在于,在所述终端将所述目标应用切换回前台运行之前,还包括:
    所述终端显示所述目标应用切换至后台时的目标应用界面图。
  13. 根据权利要求9-12中任一项所述的方法,其特征在于,所述终端将所述目标应用切换回前台运行之后,还包括:
    所述终端在前台刷新所述目标应用的运行状态。
  14. 一种终端,其特征在于,包括:
    通信模块,用于:当目标应用在前台运行时,获取对所述目标应用的第一切换指令,所述第一切换指令用于指示将所述目标应用切换至后台;
    处理模块,用于:响应于所述第一切换指令,将所述目标应用切换至后台;以及,响应于所述第一切换指令,释放所述目标应用占用的至少一部分内存。
  15. 根据权利要求14所述的终端,其特征在于,
    所述处理模块,具体用于:将所述目标应用占用的内存中存储的内存数据进行压缩,以释放所述目标应用占用的部分内存。
  16. 根据权利要求15所述的终端,其特征在于,
    所述处理模块,具体用于:使用与所述目标应用对应的压缩算法,对所述目标应用的内存数据进行压缩。
  17. 根据权利要求15或16所述的终端,其特征在于,所述终端还包括:
    存储模块,用于:保存与所述目标应用关联的压缩标识,所述压缩标识用于指示所述目标应用的内存数据是否被压缩,或者,压缩所述目标应用的内存数据时使用的压缩算法。
  18. 根据权利要求14所述的终端,其特征在于,所述目标应用占用的内存中包括绘图资源;
    所述处理模块,具体用于:释放所述目标应用占用的绘图资源。
  19. 根据权利要求14所述的终端,其特征在于,
    所述处理模块,具体用于:将所述目标应用占用的全部内存释放,并且,记录所述目标应用当前的运行状态信息,所述运行状态信息用于指示所述目标应用的运行进度。
  20. 根据权利要求14-19中任一项所述的终端,其特征在于,
    所述存储模块,还用于:保存所述目标应用当前的目标应用界面图;或者, 保存绘制所述目标应用当前的应用界面图的目标绘图命令。
  21. 根据权利要求20所述的终端,其特征在于,
    所述处理模块,具体用于:释放所述目标应用占用的内存时,保留所述目标应用界面图或所述目标绘图命令占用的内存。
  22. 根据权利要求14-21中任一项所述的终端,其特征在于,
    所述通信模块,还用于:获取对所述目标应用的第二切换指令,所述第二切换指令用于指示将所述目标应用切换回前台;
    所述处理模块,还用于:响应于所述第二切换指令,恢复所述目标应用占用的内存;以及,响应于所述第二切换指令,将所述目标应用切换回前台运行。
  23. 根据权利要求22所述的终端,其特征在于,
    所述处理模块,具体用于:通过解压算法对所述目标应用的内存数据进行解压,以恢复所述目标应用占用的内存。
  24. 根据权利要求22所述的终端,其特征在于,
    所述处理模块,具体用于:根据保存的运行状态信息,将所述目标应用的运行进度恢复至与所述目标应用切换至后台时相同的状态,以恢复所述目标应用占用的内存。
  25. 根据权利要求22-24中任一项所述的终端,其特征在于,所述终端还包括:
    显示模块,用于:显示所述目标应用切换至后台时的目标应用界面图。
  26. 根据权利要求22-25中任一项所述的终端,其特征在于,
    所述处理模块,还用于:在前台刷新所述目标应用的运行状态。
  27. 一种终端,其特征在于,包括:处理器、存储器、总线和通信接口;
    所述存储器用于存储计算机执行指令,所述处理器与所述存储器通过所述总线连接,当所述终端运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述终端执行如权利要求1-13中任一项所述的应用切换方法。
  28. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在终端上运行时,使得所述终端执行如权利要求1-13中任一项所述的应用切换方法。
  29. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在终端上运行时,使得所述终端执行如权利要求1-13中任一项所述的应用切换方法。
PCT/CN2017/097268 2017-08-11 2017-08-11 一种应用切换方法及装置 WO2019028912A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201780067389.3A CN109891390B (zh) 2017-08-11 2017-08-11 一种应用切换方法及装置
CN202111211373.XA CN114153570A (zh) 2017-08-11 2017-08-11 一种应用切换方法及装置
PCT/CN2017/097268 WO2019028912A1 (zh) 2017-08-11 2017-08-11 一种应用切换方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/097268 WO2019028912A1 (zh) 2017-08-11 2017-08-11 一种应用切换方法及装置

Publications (1)

Publication Number Publication Date
WO2019028912A1 true WO2019028912A1 (zh) 2019-02-14

Family

ID=65272897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/097268 WO2019028912A1 (zh) 2017-08-11 2017-08-11 一种应用切换方法及装置

Country Status (2)

Country Link
CN (2) CN109891390B (zh)
WO (1) WO2019028912A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134219A (zh) * 2019-05-13 2019-08-16 深圳传音通讯有限公司 应用程序后台耗电处理方法及装置
CN111625351A (zh) * 2020-05-12 2020-09-04 Oppo(重庆)智能科技有限公司 文件页的回收方法和装置、终端和可读存储介质
CN113722087A (zh) * 2021-06-10 2021-11-30 荣耀终端有限公司 虚拟内存管理方法和电子设备
CN117519959A (zh) * 2022-07-30 2024-02-06 华为技术有限公司 内存管理方法及电子设备

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860145B (zh) * 2019-07-30 2022-08-26 华为技术有限公司 一种应用的控制方法与电子设备
CN111367828B (zh) * 2020-02-27 2023-10-20 Oppo广东移动通信有限公司 内存压缩方法、装置、终端及存储介质
CN112114965A (zh) * 2020-09-15 2020-12-22 深圳市欢太科技有限公司 应用程序的运行方法、装置、终端及存储介质
CN114625521A (zh) * 2020-12-08 2022-06-14 深圳Tcl新技术有限公司 一种内存管理方法、智能终端及计算机存储介质
CN115113992A (zh) * 2021-03-22 2022-09-27 深圳市万普拉斯科技有限公司 进程控制方法、装置、计算机设备和存储介质
CN117616390A (zh) * 2022-06-20 2024-02-27 北京小米移动软件有限公司 应用管理方法、装置、电子设备以及存储介质
CN115408164A (zh) * 2022-11-01 2022-11-29 南京翼辉爱智物联技术有限公司 应用程序管理方法、装置、电子设备及存储介质
CN115794413B (zh) * 2023-01-09 2024-05-14 荣耀终端有限公司 一种内存处理方法及相关装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252389A (zh) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 应用程序运行方法、系统及应用程序
CN104375828A (zh) * 2014-10-27 2015-02-25 小米科技有限责任公司 内存优化方法及装置
CN104407981A (zh) * 2014-10-28 2015-03-11 小米科技有限责任公司 内存管理方法和装置
CN104461745A (zh) * 2014-12-23 2015-03-25 中科创达软件股份有限公司 一种内存优化方法及装置
CN105808447A (zh) * 2016-03-29 2016-07-27 海信集团有限公司 一种终端设备的内存回收方法和装置
CN106648811A (zh) * 2017-01-23 2017-05-10 努比亚技术有限公司 一种终端应用启动的方法和终端
CN106775820A (zh) * 2016-11-10 2017-05-31 宇龙计算机通信科技(深圳)有限公司 应用程序管理的方法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10631246B2 (en) * 2011-02-14 2020-04-21 Microsoft Technology Licensing, Llc Task switching on mobile devices
CN102521034B (zh) * 2011-12-27 2014-05-07 惠州Tcl移动通信有限公司 一种基于android系统的多任务管理方法及其系统
CN104793885B (zh) * 2015-04-23 2017-04-05 努比亚技术有限公司 一种移动终端及其内存清理控制方法
CN104850345A (zh) * 2015-04-29 2015-08-19 努比亚技术有限公司 一种移动终端及其任务快速切换方法
CN105677259A (zh) * 2016-02-29 2016-06-15 珠海市魅族科技有限公司 一种移动终端中存储文件的方法及移动终端
CN106201572A (zh) * 2016-06-23 2016-12-07 努比亚技术有限公司 移动终端和内存释放控制方法
CN106354562B (zh) * 2016-08-25 2024-04-12 深圳市泰衡诺科技有限公司 内存清理系统和内存清理方法
CN106803860B (zh) * 2017-01-23 2020-12-29 努比亚技术有限公司 一种终端应用的存储处理方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252389A (zh) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 应用程序运行方法、系统及应用程序
CN104375828A (zh) * 2014-10-27 2015-02-25 小米科技有限责任公司 内存优化方法及装置
CN104407981A (zh) * 2014-10-28 2015-03-11 小米科技有限责任公司 内存管理方法和装置
CN104461745A (zh) * 2014-12-23 2015-03-25 中科创达软件股份有限公司 一种内存优化方法及装置
CN105808447A (zh) * 2016-03-29 2016-07-27 海信集团有限公司 一种终端设备的内存回收方法和装置
CN106775820A (zh) * 2016-11-10 2017-05-31 宇龙计算机通信科技(深圳)有限公司 应用程序管理的方法及装置
CN106648811A (zh) * 2017-01-23 2017-05-10 努比亚技术有限公司 一种终端应用启动的方法和终端

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134219A (zh) * 2019-05-13 2019-08-16 深圳传音通讯有限公司 应用程序后台耗电处理方法及装置
CN110134219B (zh) * 2019-05-13 2024-03-19 深圳传音通讯有限公司 应用程序后台耗电处理方法及装置
CN111625351A (zh) * 2020-05-12 2020-09-04 Oppo(重庆)智能科技有限公司 文件页的回收方法和装置、终端和可读存储介质
CN113722087A (zh) * 2021-06-10 2021-11-30 荣耀终端有限公司 虚拟内存管理方法和电子设备
WO2022257748A1 (zh) * 2021-06-10 2022-12-15 荣耀终端有限公司 虚拟内存管理方法和电子设备
CN117519959A (zh) * 2022-07-30 2024-02-06 华为技术有限公司 内存管理方法及电子设备
WO2024027544A1 (zh) * 2022-07-30 2024-02-08 华为技术有限公司 内存管理方法及电子设备

Also Published As

Publication number Publication date
CN109891390A (zh) 2019-06-14
CN109891390B (zh) 2021-12-14
CN114153570A (zh) 2022-03-08

Similar Documents

Publication Publication Date Title
WO2019028912A1 (zh) 一种应用切换方法及装置
CN114449091B (zh) 一种显示方法及装置
US11985374B2 (en) Method of controlling the sharing of videos and electronic device adapted thereto
US10956280B2 (en) Data backup method, electronic device, and storage medium
US11989383B2 (en) Application window display method and terminal
WO2019104677A1 (zh) 不同屏显示不同的应用快捷菜单
CN114168092B (zh) 一种显示方法及装置
US20150128068A1 (en) Method for operating message application and electronic device implementing the same
CN109074303B (zh) 一种卡顿检测方法及装置
WO2018209635A1 (zh) 一种搜索方法及装置
US20170064352A1 (en) Method and system for collecting statistics on streaming media data, and related apparatus
WO2019061512A1 (zh) 一种任务切换方法及终端
WO2019071600A1 (zh) 一种图像处理方法及装置
US10250818B2 (en) Electronic device including a plurality of cameras and operating method thereof
CN109144723B (zh) 一种分配存储空间的方法和终端
KR102090490B1 (ko) 오디오 채널 설정 방법 및 시스템
KR102092023B1 (ko) 라디오 기능을 구비한 전자 장치 및 그 운영 방법
KR20150039634A (ko) 전자 장치 및 전자 장치의 컨텐츠 제공 방법

Legal Events

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

Ref document number: 17920828

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17920828

Country of ref document: EP

Kind code of ref document: A1