CN109600409B - Resource management method and terminal for application - Google Patents
Resource management method and terminal for application Download PDFInfo
- Publication number
- CN109600409B CN109600409B CN201710940872.XA CN201710940872A CN109600409B CN 109600409 B CN109600409 B CN 109600409B CN 201710940872 A CN201710940872 A CN 201710940872A CN 109600409 B CN109600409 B CN 109600409B
- Authority
- CN
- China
- Prior art keywords
- application
- terminal
- resources
- protocol
- running
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000007726 management method Methods 0.000 title claims abstract description 42
- 230000005540 biological transmission Effects 0.000 claims abstract description 124
- 238000000034 method Methods 0.000 claims abstract description 52
- 230000008569 process Effects 0.000 claims abstract description 22
- 230000004044 response Effects 0.000 claims description 82
- 238000012546 transfer Methods 0.000 claims description 78
- 230000006399 behavior Effects 0.000 claims description 69
- 238000004140 cleaning Methods 0.000 claims description 45
- 230000015654 memory Effects 0.000 claims description 34
- 230000001960 triggered effect Effects 0.000 claims description 27
- 238000013468 resource allocation Methods 0.000 claims description 25
- 238000004891 communication Methods 0.000 claims description 13
- 238000004458 analytical method Methods 0.000 claims description 10
- 101001094649 Homo sapiens Popeye domain-containing protein 3 Proteins 0.000 claims description 3
- 101000608234 Homo sapiens Pyrin domain-containing protein 5 Proteins 0.000 claims description 3
- 101000578693 Homo sapiens Target of rapamycin complex subunit LST8 Proteins 0.000 claims description 3
- 102100027802 Target of rapamycin complex subunit LST8 Human genes 0.000 claims description 3
- 238000001514 detection method Methods 0.000 description 24
- 230000006870 function Effects 0.000 description 22
- 230000033001 locomotion Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 238000012545 processing Methods 0.000 description 13
- 230000003287 optical effect Effects 0.000 description 8
- 238000013461 design Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000010079 rubber tapping Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation 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/5022—Mechanisms to release resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application resource management method and the terminal can manage resources of an application with a file transmission behavior in a background running application in the terminal. The method comprises the following steps: the terminal determines a target application, wherein the target application is an application which runs in a terminal background and has a file transmission behavior; and the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of ensuring the resources of the target application process.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a resource management method and a terminal for an application.
Background
When the user uses the foreground application, the application running in the background can execute the file transmission task. As shown in fig. 1, assuming that a user starts a first application at time T1 and performs file transfer in the first application, when a size of a file to be transferred is large, the user may use other applications while waiting for the file transfer, for example, starting a second application at time T2, starting a third application at time Tn, assuming that the third application is an application displayed on a current interface, the first application and the second application become applications running in the background, and the first application continues file transfer in the background. When the system resources are insufficient, the operating system of the terminal can selectively clean the applications or services in the background, which may cause the first application with file transmission in the background to be cleaned.
Generally, the terminal provides a file transfer function for the application in a manner of a built-in system service to ensure that each file transfer task is executed completely, for example, download management (download manager) in an operating system of android or nserl Session of iOS. However, many existing applications choose to implement file transfer tasks by themselves, and a terminal cannot identify whether file transfer behaviors exist in applications that do not call these built-in system services, so that targeted resource management cannot be implemented on applications that have file transfer behaviors.
At present, the possible file transmission behavior of the application is mainly confirmed through the interaction of network packets of the application of the terminal. On one hand, however, the receiving and sending of the network packet also exist under the condition that the browser reads the common webpage, and the common network behavior of the application is mistakenly identified as the file transmission behavior; on the other hand, when the network rate is slow or the network packet loss is serious, the transceiving of the network packet cannot be detected, and the file transmission behavior of the application cannot be identified.
Therefore, how to manage resources of an application having a file transfer behavior in a background running application in a terminal is a problem to be solved urgently at present.
Disclosure of Invention
According to the resource management method and the terminal for the application, the terminal can manage the resources of the application with the file transmission behavior in the background running application in the terminal.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in one aspect, a method for resource management of an application is provided, where the method includes: the terminal determines a target application, wherein the target application is an application which runs in a background of the terminal and has a file transmission behavior, and the terminal adjusts resources of an application running in a foreground and/or an application running in the background of the terminal on the premise of ensuring resources of a process of the target application. According to the resource management method for the application, the target application is determined, so that the terminal can manage resources of the target application and other applications, resource waste is avoided, and user experience when the terminal is used for file transmission is improved.
In a possible implementation manner, the application with the file transfer behavior satisfies any one of the following conditions: the connection established with the server comprises at least one long connection, and the flow transmitted on any one long connection in the at least one long connection exceeds a first threshold value within a first connection time length; establishing at least one connection with a server through a standard file transfer protocol, wherein the flow transmitted on any one connection in the at least one connection exceeds a second threshold value within a second connection duration; and establishing connection with the server through a hypertext transfer protocol (HTTP) protocol or a hypertext transfer security protocol (HTTPS) protocol, wherein the size of the transmission file exceeds a third threshold value. Based on the scheme, the terminal can judge whether the application is the application with the file transmission behavior through the conditions, so that the terminal can more accurately adjust the resources of the application running in the terminal, and the application with the file transmission behavior is prevented from being cleaned by mistake.
In a possible implementation manner, the determining, by the terminal, that the size of the transmission file is larger than the size of the web page and exceeds the third threshold includes: the terminal acquires a response message, wherein the response message is a response message sent by the terminal to a server or a response message sent by the server to the terminal; the terminal determines the size of the transmission file according to the response message; the terminal determines whether the size of the transmission file exceeds the third threshold. Based on this scheme, it may be determined whether the size of the transmission file exceeds a third threshold.
In a possible implementation manner, the determining, by the terminal, the size of the transmission file according to the response message includes: the terminal acquires the size of the transmission file carried by the response message according to the first indication; or, the terminal determines the size of the data block accumulation transmitted in the response message according to a second indication carried in the response message, where the second indication is used to indicate that the response message is in a block transmission mode. The method comprises the steps that a terminal detects that the application is connected with a server through an HTTP (hyper text transport protocol), the terminal detects a response message sent by the server, the size of a transmission file is obtained according to a first indication, when the server or the terminal adopts a block transmission mode of the HTTP, the terminal obtains the size of the transmission file through determining the accumulated size of transmitted data blocks, and therefore whether the application has a file transmission behavior or not can be determined according to the size of the transmission file, and a basis is provided for the terminal to reasonably manage resources of the application.
In a possible implementation manner, the acquiring, by the terminal, the response message includes: the terminal acquires and analyzes the response message at the transmission object analysis point; if the application establishes connection with the server through the HTTP, the transmission object analysis point is positioned between the HTTP layer and the TCP layer of the transmission control protocol layer; or, if the application establishes a connection with the server through the HTTPS protocol, the transport object parsing point is located between the HTTP layer and the secure socket layer/secure transport layer SSL/TLS layer. Based on the scheme, the terminal can obtain the size of the transmission file at the analysis point of the transmission object, and a basis is provided for the terminal to judge whether the application running in the background has a file transmission behavior. If the connection established between the application and the server adopts an HTTP protocol, the terminal analyzes the response message between the TCP layer and the HTTP layer, and if the connection established between the application and the server adopts an HTTPS protocol, the terminal acquires and decrypts the response message between the SSL/TLS layer and the HTTP layer, so that the size of the transmission file is obtained.
In a possible implementation, the standard file transfer protocol is the file transfer protocol FTP protocol, the peer-to-peer network protocol P2P protocol, the simple mail transfer protocol SMTP protocol, the third edition of the post office protocol POP3 protocol, or the mail access protocol IMAP protocol. Based on the scheme, if the application in the terminal uses at least one of the above protocols, the terminal can determine that the target application exists in the application.
In one possible implementation, adjusting resources of an application running in a foreground and/or an application running in a background of the terminal includes: if the resource distributed to the application running in the foreground is determined to be smaller than a fourth threshold value, cleaning at least one application running in the background except the target application; or, if it is determined that the allocable resources of the terminal are greater than or equal to the fifth threshold, reallocating the resources of the application currently running in the terminal. Based on the scheme, if the resource allocated to the application running in the foreground is determined to be smaller than the fourth threshold, or if the terminal determines that the allocable resource is greater than or equal to the fourth threshold, the resource is dynamically adjusted for the application in the terminal, so that the resource can be added to the target application, the file transmission task is completed as soon as possible, and the user experience is improved.
In a possible implementation manner, the adjusting the resources of the application running in the foreground and/or the application running in the background of the terminal further includes: if the terminal detects a cleaning operation instruction triggered by a user, responding to the cleaning operation instruction, and displaying whether a first display interface of the target application is cleaned or not by the terminal; detecting a first operation instruction triggered by a user on the first display interface, and in response to the first operation instruction, cleaning at least one background running application except the target application by the terminal, wherein the first operation instruction indicates that the target application is not cleaned. Based on the scheme, the terminal can display whether the first display interface of the target application is cleaned or not to the user through a cleaning operation instruction triggered by the user, and when the terminal detects that the cleaning operation triggered by the user on the first display interface is performed, the terminal can clean at least one application running in a background except the target application, so that better experience is provided for the user when the terminal adjusts the resources of the application.
In a possible implementation manner, the adjusting the resources of the application running in the foreground and/or the application running in the background of the terminal further includes: if the terminal detects a second operation instruction triggered by a user, responding to the second operation instruction, and displaying a second display interface by the terminal, wherein the second operation instruction reallocates resources of the currently running application in the terminal; and detecting a third operation instruction triggered by the user on the second display interface, reallocating the resources of the application currently running in the terminal by the terminal, and indicating that the resources are allocated to the application currently running in the terminal by the third operation instruction. Based on the scheme, the terminal can reallocate the resources of the currently running application in the terminal through user triggering, and when the terminal detects a third operation instruction triggered by the user on the second display interface, the terminal can allocate the resources to the currently running application in the terminal, so that better experience is provided for the user when the terminal adjusts the resources of the application.
In a possible implementation manner, the reallocating resources of the application currently running in the terminal includes: determining a first weight factor of the currently running application in the terminal according to whether the currently running application has a file transmission behavior or not; determining a second weight factor of the currently running application in the terminal according to whether the currently running application is a foreground application; determining the resource allocation weight of the current running application according to the first weight factor of the current running application and the second weight factor of the current running application; and allocating resources for at least one current running application according to the resource allocation weight of the current running application. According to the resource management method for the applications, the first weight factor and the second weight factor of each application running in the terminal are determined, and the resource distribution weight of each application running in the terminal can be determined through the first weight factor and the second weight factor of each application, so that the resources of the target application can be managed according to the resource distribution weight of the target application.
In a possible implementation manner, the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of not reducing the resource amount of the process of the target application or on the premise of not changing the resource position currently occupied by the process of the target application. Based on the scheme, the problem of poor user experience caused by application pause when the application reallocates resources can be avoided.
In a possible implementation manner, the indicating that the target application is not cleaned specifically includes: and the first operation instruction indicates that the resources of the application currently running in the terminal are reallocated on the premise of not changing the position of the resources currently occupied by the target application. And the terminal selects the resource target application at other positions to increase the resources.
In still another aspect, a terminal is provided, where the terminal has a function of implementing a terminal behavior in the above method. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In another aspect, a terminal is provided, including: a processor, a memory, and a communication interface; the memory is used for storing computer execution instructions, and when the terminal runs, the processor executes the computer execution instructions stored by the memory, so that the terminal executes the resource management method of the application of the above aspects.
In still another aspect, the present application provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the resource management method of the application of the above aspects.
In yet another aspect, the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the resource management method of the application of the above aspects.
In addition, the technical effect brought by any design manner in the above apparatus embodiment may refer to the technical effect brought by different design manners in the above resource management method embodiment, and details are not described here again.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
Fig. 1 is a schematic timing diagram of a user starting an application according to an embodiment of the present application;
fig. 2 is a schematic diagram of a terminal according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a resource management method for an application according to an embodiment of the present application;
fig. 4 is a schematic diagram of parsing an acknowledgement message according to an embodiment of the present application;
fig. 5 is a schematic diagram of another parsing response message provided in the embodiment of the present application;
fig. 6 is a schematic view of a display interface of a terminal according to an embodiment of the present application;
fig. 7 is a schematic view of a display interface of another terminal according to an embodiment of the present application;
fig. 8 is a schematic view of a display interface of another terminal according to the embodiment of the present application;
fig. 9 is a schematic display interface diagram of another terminal according to an embodiment of the present application;
fig. 10 is a schematic interface diagram of resource allocation by a terminal according to an embodiment of the present disclosure;
fig. 11 is a schematic diagram of a terminal cleaning background running application according to an embodiment of the present application;
fig. 12 is a schematic diagram illustrating a terminal allocating resources to a current application according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
It should be noted that "/" in this context means "or", for example, A/B may mean A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. "plurality" means two or more than two.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion.
It should be noted that in the embodiments of the present application, "of", "corresponding", and "corresponding" may be sometimes used in combination, and it should be noted that the intended meaning is consistent when the difference is not emphasized.
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
As shown in fig. 2, a hardware structure diagram of a terminal 200 provided in the embodiment of the present application includes: memory 201, other input devices 202, display 203, sensors 204, audio circuitry 205, input/output (I/O) subsystem 206, processor 207, and power supply 208.
It should be noted that the structure of the terminal 200 shown in fig. 2 does not constitute a limitation of the device, and may include more or less components than those shown, or combine some components, or split some components, or arrange different components. The various components shown in fig. 2 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits. In addition, the display 203 belongs to a User Interface (UI), and the terminal 200 may include more or less user interfaces than those shown.
It should be noted that the terminal provided in the embodiments of the present application may support various applications such as one or more of the following applications: a contacts application, a phone application, a video conferencing application, an email client application, an instant messaging application, a voice memo application, a camera application, an image management application, a video player application, a music player application, a browser application, a calendar application, a shopping application, a gaming application, a word processing application, a presentation application, or the like.
The various components of terminal 200 are described in detail below with reference to fig. 2:
the memory 201 may be used to store software programs and modules, and the processor 207 may execute various functional applications and data processing of the terminal 200 by operating the software programs and modules stored in the memory 201. Memory 201 may include one or more computer-readable storage media. The memory 201 includes a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (e.g., audio data, a phonebook, etc.) created according to the use of the terminal 200, and the like. Further, the memory 201 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Optionally, the memory 201 may be used to store software programs of an operating system 217, a communication module 218, a contact/movement module 219, a graphics module 220, an attachment editing module 221, a text input module 222, a Global Positioning System (GPS) module 223, a file transfer behavior detection module 224, a resource detection module 225, a resource cleaning module 226, and a resource allocation module 227; the memory 201 may also store software programs for at least one application, which may include a contacts module 228, a phone module 229, a video conferencing module 230, an email client module 231, an instant messaging module 232, a voice memo module 233, a camera module 234, an image management module 235, a video player module 236, a music player module 237, a browser module 238, a calendar module 239, a shopping module 240, a game module 241, a word processing module 242, and a presentation module 243, and applications including a weather widget 244, a calculator widget 245, and/or a dictionary widget 246.
The display screen 203 includes a display panel 214 and a touch panel 215. The touch panel 215, also referred to as a touch screen, a touch sensitive screen, etc., may collect contact or non-contact operations (e.g., operations performed by a user on or near the touch panel 215 using any suitable object or accessory such as a finger or a stylus, and may also include body-sensing operations; the operations include single-point control operations, multi-point control operations 210, etc.) and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 215 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction and gesture of a user, detects signals brought by touch operation and transmits the signals to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into information that can be processed by the processor, sends the information to the processor 207 through the I/O subsystem 206, and receives and executes commands sent from the processor 207 through the I/O subsystem 206. In addition, the touch panel 215 may be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave, and the touch panel 215 may be implemented by any technology developed in the future. Further, touch panel 215 may overlay display panel 214, a user may operate on or near touch panel 215 overlaid on display panel 214 based on content displayed on display panel 214 (including, but not limited to, a soft keyboard, a virtual mouse, virtual keys, icons, etc.), touch panel 215 may, upon detecting an operation on or near touch panel 215, communicate via I/O subsystem 206 to processor 207 to determine a user input, and processor 207 may then provide a corresponding visual output on display panel 214 via I/O subsystem 206 based on the user input.
It should be noted that, although in fig. 2, the touch panel 215 and the display panel 214 are implemented as two independent components to implement the input and output functions of the terminal 200, in some embodiments, the touch panel 215 and the display panel 214 may be integrated to implement the input and output functions of the terminal 200, which is not specifically limited in this embodiment of the present application.
The terminal 200 may also include at least one sensor 204, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 214 according to the brightness of ambient light, and a proximity sensor that captures still images or video in combination with the camera module 234. Optionally, an optical sensor is located behind terminal 200 opposite display screen 203 from the front of the device, so that display screen 203 can be used as a viewfinder for still and/or video image acquisition. Optionally, an optical sensor is located in front of the terminal 200 to enable the user to obtain images of the user for video conferencing while the user is viewing other video conference participants on the display screen 203. The position of the optical sensor may be changed by the user (e.g., by rotating a lens and sensor within the device housing) so that the optical sensor may be used with the display screen 203 and the video conferencing module 230 for video conferencing and still and/or video image acquisition. The proximity sensor may turn off the display panel 214 and/or the backlight when the terminal 200 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 200, detailed descriptions thereof are omitted.
Optionally, the terminal 200 may further include a Radio Frequency (RF) circuit 216. The RF circuit 216 may be used for receiving and transmitting signals during information transmission or communication; typically, the RF circuitry includes antennas, amplifiers, transceivers, couplers, low noise amplifiers, duplexers, and the like. In addition, the RF circuitry 216 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global System for mobile communication (GSM), Code Division Multiple Access (CDMA), General Packet Radio Service (GPRS), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
Audio circuitry 205, speaker 212, and microphone 213 can provide an audio interface between a user and terminal 200. The audio circuit 205 may transmit the converted signal of the received audio data to the speaker 212, and the converted signal is converted into a sound signal by the speaker 212 and output; on the other hand, the microphone 213 converts the collected sound signals into signals, which are received by the audio circuit 205 and converted into audio data, which are then output to the RF circuit 216 for transmission to another device or to the memory 201 for further processing.
The I/O subsystem 206 is used to control input and output peripheral devices including other input device controllers 209, sensor controllers 210, and display controllers 211. Optionally, one or more other input device controllers 209 receive signals from other input devices 202 and/or transmit signals to other input devices 202. The display controller 206 in the I/O subsystem 206 receives signals from the display screen 203 and/or sends signals to the display screen 203. After the display screen 203 detects the user input, the display controller 206 converts the detected user input into an interaction with a user interface object displayed on the display screen 203, i.e., implements a human-computer interaction. The sensor controller 210 may receive signals from one or more sensors 204 and/or send signals to one or more sensors 204.
The processor 207 is a control center of the terminal 200, connects various parts of the entire terminal 200 using various interfaces and lines, and performs various functions of the terminal 200 and processes data by running or executing software programs and/or modules stored in the memory 201 and calling data stored in the memory 201, thereby performing overall monitoring of the terminal 200. Optionally, for a smoother processing speed, the processor 207 may have a storage unit therein, and the storage unit is configured to store various operation instructions for the processor 207 to call. Optionally, the processor 207 may include one or more processing units; optionally, the processor 207 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 207.
The terminal 200 also includes a power supply 208 (e.g., a battery) for powering the various components, which may optionally be logically connected to the processor 207 via a power management system to manage charging, discharging, and power consumption via the power management system. Although not shown, the terminal 200 may further include a camera, bluetooth, a menu key, etc., which will not be described herein.
Hereinafter, the respective modules stored in the memory 201 will be briefly described with reference to the respective components in the terminal 200:
the operating system 217 includes various software components and/or drivers for controlling and managing general system tasks (e.g., memory management, storage device control, power management, etc.) and facilitates communication between the various hardware and software components.
The communication module 218 communicates with other devices via one or more external ports and also contains various software components for processing data received by the RF circuitry 216 and/or the external ports.
The contact/movement module 219 may detect contact with the display screen 203 (in conjunction with the display controller 211) and other touch sensitive devices (e.g., a touchpad). Alternatively, the contact/movement module 219 and the display controller 211 may be combined to detect contact on a touchpad.
The graphics module 220 contains various known software components for rendering and displaying graphics on a touch screen or other display. Where "graphics" includes any object that may be displayed to a user, including, but not limited to, text, web pages, icons (such as user interface objects including soft keys), digital images, videos, animations and the like. Optionally, the graphics module 220 stores data representing graphics to be used. The graphic module 220 receives one or more codes specifying a graphic to be displayed together with coordinate data and other graphic attribute data if necessary from an application or the like, and then generates screen image data to be output to the display controller 211.
The text input module 222 may be a component of the graphics module 220 that provides a soft keyboard for entering text in various applications, such as the contacts module 228, the email client module 231, the instant messaging module 232, the browser module 238, and any other application that requires text input.
The GPS module 223 may be used to determine the location of the terminal 200 and provide this information for use in various applications (e.g., providing to the phone module 229 for use in location-based dialing, providing to the camera module 234 as picture/video metadata, and providing to applications such as maps/navigation that provide location-based services).
The file transfer behavior detection module 224 may be configured to identify whether a file transfer behavior exists in an application in the terminal. Optionally, the file transmission includes file uploading and file downloading. For example, a user may initiate a file download task by clicking a download link in a browser, or by entering a Uniform Resource Locator (URL) address of the file to be downloaded in the download software.
The resource detection module 225 may be used to detect resource usage of each application in the terminal and remaining resource in the terminal.
The resource cleaning module 226 is used to clean applications or services running in the terminal, and may be used in combination with the resource detection module 225 and/or the file transfer behavior detection module 224.
The resource allocation module 227 is used for allocating various resources in the terminal for each application. Optionally, the resources in this embodiment of the present application include a CPU, a memory, or a network bandwidth of the terminal, it should be noted that this embodiment of the present application may also include other resources, and the resource types allocable by the resource allocation module 227 are not specifically limited in this embodiment of the present application.
An application may contain the following modules (or sets of instructions) or a subset or superset thereof: a contacts module 228 (also referred to as an address book or contact list); a telephone module 229; a video conferencing module 230; an email client module 231; an instant message module 232; a voice memo module 233; a camera module 234 for capturing still and/or video images; an image management module 235; a video player module 236; a music player module 237; a browser module 238; a calendar module 239; shopping module 240, game module 241, word processing module 242, presentation module 243, and weather widget 244, calculator widget 245 and/or dictionary widget 246, among others.
The contacts module 228 may provide a phone number or an email address, and the contacts module 228 may be integrated with the display screen 203, the display controller 211, the contact/movement module 219, the graphics module 220, and the text input module 222. The user may use the contacts module 228 to manage an address book or contact list, or use the contacts module in conjunction with the phone module 229, the video conference module 230, the email client module 230, or the instant messaging module 231, among others.
The phone module 229 may be used to type a series of characters corresponding to a phone number, access one or more phone numbers in the contacts module 228, modify the phone number that has been typed, dial a corresponding phone number, make a call, and disconnect or hang up when the call is completed. The phone module 229 may be integrated with the RF circuitry 216, the audio circuitry 205, the speaker 212, the microphone 213, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, and/or the text input module 222.
The video conference module 230 may be used to initiate, conduct, and terminate video conferences between a user and one or more other participants. The videoconferencing module 230 may be integrated with the RF circuitry 216, the audio circuitry 205, the speaker 212, the microphone 213, the display screen 203, the display controller 206, the optical sensor controller, the contact/movement module 219, the graphics module 220, the text input module 222, the contacts module 228, and/or the telephony module 229.
The email client module 231 may be used to create, send, receive, and manage emails. The email client module 231 may be integrated with the RF circuitry 216, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, and/or the text input module 222. The e-mail client module 231, in conjunction with the image management module 235, can make it very easy to create and send e-mails with still or video images captured by the camera module 234.
The instant message module 232 may be used to type a series of characters corresponding to an instant message, modify previously-typed characters, transmit a corresponding instant message (e.g., using an SMS or Multimedia Messaging Service (MMS) protocol for a phone-based instant message or using an extensible messaging and presentation protocol (XMPP) for an internet-based instant message, a SIMPLE protocol (session initiation protocol for instant messaging and presentation rendering, plsime), or a service of instant messaging and status Information (IMPS)), receive an instant message, and view the received instant message. The instant message module 232 may be integrated with the RF circuitry 216, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, and/or the text input module 222; it is noted that the transmitted and/or received instant messages may contain graphics, photographs, audio files, video files, and/or other attachments. Instant messages refer to both telephony-based messages (e.g., messages sent using SMS or MMS) and internet-based messages (e.g., messages sent using XMPP, SIMPLE, or IMPS).
The camera module 234 may be used to capture still images or video (including video streams), the camera module 234 being integrated with the display screen 203, the display controller 206, the optical sensor(s), the optical sensor controller, the contact/movement module 219, the graphics module 220, and/or the image management module 235 and storing them in the memory 201, modifying characteristics of the still images or video, or deleting the still images or video from the memory 201.
The image management module 235 may be used to configure, modify (e.g., edit) or otherwise manipulate, annotate, delete, render (e.g., in a digital slide show or photo album), and store still and/or video images. The image management module 235 is integrated with the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, the text input module 222, and/or the camera module 234.
The video player module 236 may be used to display, render, or otherwise playback video (e.g., on a touch screen or on an externally connected display through an external port), the video player module 236 in conjunction with the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, the audio circuitry 205, and/or the speaker 212.
The music player module 237 allows a user to download and play back recorded music and other sound files stored in one or more file formats of an MP3(moving picture experts group audio layer-3) format or Advanced Audio Coding (AAC) file. The music player module 237, in conjunction with the display screen 203, display controller 206, contact/movement module 219, graphics module 220, audio circuitry 205, speaker 212, RF circuitry 216, and/or browser module 238, optionally, the terminal 200 may also incorporate the functionality of an MP3 player.
The browser module 238 may be used to browse the internet including searching for, linking to, receiving and displaying web pages or portions thereof and attachments and other files linked to web pages. The browser module 238 may be integrated with the RF circuitry 216, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, and/or the text input module 222.
The calendar module 239 may be used to generate, display, modify, and store calendars and calendar-related data (e.g., calendar entries, to-do lists, etc.). The calendar module 239 is integrated with the RF circuitry 216, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, the text input module 222, the email client module 231, and/or the browser module 238.
The widget module is a mini-application that may be downloaded and used by a user, and may be integrated with the RF circuitry 216, the display screen 203, the display controller 206, the contact/movement module 219, the graphics module 220, the text input module 221, and/or the browser module 238.
These modules (i.e., sets of instructions) need not be implemented as separate software programs, procedures or modules, and various subsets of these modules may be combined or otherwise reconfigured in various embodiments. For example, the video player module 236 may be combined with the music player module 237 into a single module. In some embodiments, memory 201 may store a subset of the modules and data structures identified above. Also, memory 201 may store other modules and data structures not described above.
It should be noted that the device according to the embodiment of the present application may be any device that has the above-mentioned specific functional modules, such as a mobile phone (or referred to as a "cellular" phone), a tablet computer, and the like, and the embodiment of the present application is not limited to this.
The resource management method for an application provided in the embodiment of the present application will be specifically described below with reference to fig. 2.
Fig. 3 is a schematic flowchart of a resource management method for an application according to an embodiment of the present application, including steps S101 to S102:
s101, the terminal determines a target application.
The target application is an application which runs in a terminal background and has a file transmission behavior.
Optionally, the application with the file transfer behavior meets any one of the following conditions:
the first condition is that: the connection established with the server includes at least one long connection, and traffic transmitted on any one of the at least one long connection exceeds a first threshold for a first connection duration.
The first connection duration and the first threshold corresponding to the first connection duration may also be determined according to an empirical value, or may also be set on the terminal by the user. For example, the first condition may be that 20MB of traffic is transmitted on one long connection within 1min, and the first condition may also be that 80MB of traffic is transmitted on one long connection within 5min, and the embodiment of the present application is not limited to the first connection duration and the value of the first threshold.
In general, a long connection means that multiple packets can be sent continuously over one connection, and during the connection hold period, if no packet is sent, a link check packet needs to be sent in both directions.
Illustratively, a brief example of a long Transport Control Protocol (TCP) connection is given. Suppose that a client (client) initiates a connection to a server (server), the server accepts the connection initiated by the client, the server establishes a connection with the client, after the client and the server complete one read-write operation, the connection between the client and the server is not actively closed, and the subsequent read-write operation between the client and the server continues to use the connection. Generally, during the interaction process of the application, the client or the server may be unexpectedly powered off, halted, crashed, or restarted; or the network has been interrupted and the client and server sides are unaware of it. To determine if a TCP connection is broken, current TCP protocols provide TCP keep-alive functionality, primarily provided for server applications that wish to determine if a client host crashes so that resources can be used on behalf of a client. If the client has disappeared and a semi-open TCP connection is maintained on the server waiting for data from the client, the keep-alive function attempts to detect this semi-open TCP connection on the server side, thereby ensuring that the semi-open TCP connection can be released in the event of an accident.
It should be noted that the HTTP long connection and the HTTP short connection are essentially TCP long connection and TCP short connection. The HTTP belongs to an application layer protocol, and the TCP belongs to a transport layer protocol, and the embodiment of the present application does not specifically limit which layer the connection is.
Optionally, when the application in the terminal transmits a file, one connection may be established with the server to perform file transmission, and multiple connections may also be established to perform file transmission.
The second condition is that: and establishing at least one connection with the server through a standard file transfer protocol, wherein the flow transmitted on any one connection in the at least one connection exceeds a second threshold value in the second connection duration.
The second connection duration and the second threshold corresponding to the second connection duration may be determined according to an empirical value, or may be set on the terminal by the user. For example, if the traffic is set to be transmitted within 1min over the connection for more than 20MB, or the traffic is set to be transmitted within 2min over the connection for 30MB, the embodiment of the present application does not specifically limit the second connection duration and the value of the second threshold.
It should be noted that, in this embodiment of the present application, the first connection duration and the second connection duration may be the same or different, and the first threshold and the second threshold may be the same or different, which is not specifically limited in this embodiment of the present application.
The file transfer protocol is a standard protocol for file transfer over a network.
Optionally, the standard file transfer protocol is a File Transfer Protocol (FTP) protocol, a peer-to-peer (P2P) protocol, a Simple Mail Transfer Protocol (SMTP) protocol, a post office protocol (POP 3) protocol, or an Internet Mail Access Protocol (IMAP).
If the application in the terminal establishes at least one connection by using at least one of the above protocols, and the traffic transmitted on any one of the at least one connection exceeds the second threshold value within the second connection duration, the terminal may determine that the target application exists in the application.
The file transfer protocol also includes an HTTP protocol and a hypertext transfer protocol over secure socket layer (HTTPs) protocol. Both communication parties using the HTTPS protocol communicate using the HTTP protocol at an HTTP upper layer, and a data packet is encrypted by a Secure Socket Layer (SSL)/secure Transport Layer (TLS) protocol at a lower layer.
Alternatively, the file transfer protocol used by a connection may be determined in any of the following ways.
1. And identifying the file transfer protocol used by the connection through the port number corresponding to the connection.
For example, if the port corresponding to a connection is port 20/21, it is determined that the file transfer protocol used by the connection is the FTP protocol; if the port corresponding to one connection is the port 80 or the port 8080, determining that the file transfer protocol used by the connection is the HTTP protocol; if the port corresponding to one connection is the port 25, determining that the file transfer protocol used by the connection is an SMTP protocol; if the port corresponding to one connection is the port 110, determining that the file transfer protocol used by the connection is the POP3 protocol; if the port corresponding to a connection is the port 143, it is determined that the file transfer protocol used by the connection is the IMAP protocol.
2. The file transfer protocol used by the connection is identified by monitoring the first few packets of a packet on the connection.
For example, if it is detected that the 1 st packet on the connection is a Hello message, and 1 byte of the first 6 bytes is a protocol identifier, 1 byte is a message type, and 4 bytes are a message length, it is determined that the file transfer protocol used by the connection is the eMule protocol (a commonly used P2P protocol).
The third condition is that: and establishing connection with the server through an HTTP protocol or an HTTPS protocol, wherein the size of the transmission file exceeds a third threshold value.
Note that the third threshold may be set to several tens of megabits or more.
Generally, conventional services require less traffic, such as browsing web pages, which are typically several hundred KB to several MB in size, and the third threshold may be set to be more than ten times the size of the web page. The specific value corresponding to the third threshold in the embodiment of the present application is not particularly limited.
Optionally, in this embodiment of the application, the terminal may determine whether the application is a target application after opening one application each time, may also determine whether a target application exists in the application running in the background every other period, or may determine whether a target application exists in the background application before the terminal detects that resources are not enough and an application (such as an application of a browser, music, video, game, or word processing, etc.) or a service running in the foreground and the background is required to be cleaned up, and determine whether the target application exists in the background application before the cleaning; or when the user manually triggers cleaning, the terminal determines whether the target application exists in the background application before cleaning; the terminal may also determine the target application in other situations, and the embodiment of the present application is not particularly limited to when the target application is determined.
S102, the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of ensuring the resources of the target application process.
Optionally, the resources in this embodiment of the present application include resources such as a CPU of the terminal, a memory of the terminal, and an electric quantity or a network bandwidth of the terminal.
Specifically, the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of not reducing the resource amount of the target application process. Or the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of not changing the resource position currently occupied by the target application process.
It should be noted that the resources of the application process may include states in the memory, such as the size of the occupied memory, the location in the memory, and the like. The terminal may keep the size and the location occupied by the application in the memory, add additional resources to the application on the premise that the size and the location occupied by the application are not changed, and may reallocate more resources to the application on the premise that the operation of the application is not affected.
Optionally, when the terminal detects that the terminal has a resource shortage and the terminal needs to clean the resource, step S102 may be executed; or, the terminal may execute the step S102 when detecting that there is a file transmission behavior in the application and a network bandwidth needs to be added for file transmission; or, the user finds that the foreground application is not smoothly operated, and triggers a resource adjusting instruction to the terminal to instruct the terminal to execute the step S102; or, after monitoring that the application has a file transmission behavior, the terminal displays to the user whether to adjust the resource for the application, and after receiving an instruction that the user determines to adjust the resource, the terminal may also execute step S102, or the terminal may execute step S102 under other conditions, where the embodiment of the present application does not specifically limit the condition for the terminal to execute step S102.
Specifically, with reference to fig. 2, the file transfer behavior detection module 224 in the terminal 200 is used to support the terminal 200 to execute the step S101 in the embodiment of the present application, and the resource cleaning module 226 or the resource allocation module 227 in the terminal 200 is used to support the terminal 200 to execute the step S102 in the embodiment of the present application.
According to the resource management method for the application, the target application is determined according to the first condition, the second condition or the third condition, so that the terminal can manage resources of the target application and other applications, resource waste is avoided, and user experience when the terminal is used for file transmission is improved.
When the terminal determines that the connection uses the HTTP protocol or the HTTPs protocol, the file transfer and the general web browsing behavior cannot be distinguished, and therefore, in the embodiment of the present application, it is further determined whether a file transfer behavior exists in the application by determining the size of the transfer file.
Optionally, the terminal determining that the size of the transmission file is at least one order of magnitude larger than the size of the web page includes steps S101a-S101 c:
s101, 101a, the terminal acquires the response message.
The response message is a response message sent by the terminal to the server, or a response message sent by the server to the terminal.
It should be noted that, when a user transmits a file through a terminal, the terminal sends a transmission request message to a server, where the request message carries an identifier of the file to be transmitted, and after receiving the request message sent by the terminal, the server sends a first response message to the terminal according to the request message sent by the terminal, where the first response message carries the file to be transmitted by the user. When a user transmits a file through a terminal, after the terminal sends a transmission request to a server, the terminal sends a second response message to the server after receiving a service transmission approval indication, wherein the second response message carries the file which the user needs to transmit.
Optionally, if the application in the terminal establishes a connection with the server through the HTTP protocol, and the terminal detects whether the running application has a file transfer behavior and needs to acquire a response message, step S101a may include S101a 1:
s101a1, the terminal acquires and parses the response message at the transport object parsing point.
If the connection with the server is established through the HTTP, the transmission object analysis point can be located between the HTTP layer and the TCP layer of the transmission control protocol layer.
Fig. 4 is a schematic diagram of parsing a response message, as shown in fig. 4, the terminal side and the server side respectively include an HTTP layer, a TCP layer, and an IP layer, wherein the IP layer of the terminal side and the IP layer of the server side communicate via a network, the terminal sets an HTTP transport object parsing point between the TCP layer (transport layer) and the HTTP layer (application layer), and acquires and parses the response message at the parsing point, thereby acquiring a size of a transport file.
The response message is analyzed between the TCP layer and the HTTP layer, the size of the transmission file can be obtained, and a basis is provided for the terminal to judge whether the application running in the background has a file transmission behavior.
Optionally, if a connection is established with the server through the HTTPS protocol, the transport object resolution point may be located between the HTTP layer and the SSL/TLS layer.
The key of the encryption protocol is only held by two communication parties, the intermediate network equipment cannot analyze the data, and the conventional protocol identification algorithm provided by the Internet Service Provider (ISP) cannot analyze the data of the encryption protocol at present.
Fig. 5 is a schematic diagram of parsing a response message, as shown in fig. 5, the terminal side and the server side respectively include an HTTP layer, an SSL/TLS layer, a TCP layer, and an IP layer, wherein the IP layer of the terminal side and the IP layer of the server side communicate with each other via a network, an HTTP transport object parsing point is set between the SSL (secure socket layer)/TLS layer (secure transport layer) and the HTTP layer (application layer) of the terminal, and the terminal can obtain and parse the response message at the parsing point, thereby obtaining the size of the transport file.
If the connection established between the application and the server adopts an HTTPS protocol, the terminal acquires and decrypts the response message between the SSL/TLS layer and the HTTP layer, so as to obtain the size of the transmission file.
S101b, the terminal determines the size of the transmission file according to the response message.
S101c, the terminal determines whether the size of the transmission file exceeds a third threshold.
Specifically, in conjunction with fig. 2, the file transfer behavior detection module 224 in the terminal 200 may be configured to support the terminal 200 to perform steps S101a, S101b, and S101bc in the embodiment of the present application.
According to the resource management method for the application, if the terminal detects that the connection established between the application running in the background and the server adopts the HTTP protocol or the HTTPS protocol and the size of the transmission file is larger than the size of the webpage by at least one order of magnitude, the terminal can determine that the file transmission behavior exists in the application, so that the resource of the application can be flexibly managed by the terminal, a file transmission task can be completed as soon as possible, and the experience of a user in file transmission by using the terminal is improved.
Optionally, if the application in the terminal establishes a connection with the server by using an HTTP protocol or an HTTPs protocol, and the terminal determines the size of the transmission file, step S101b includes S101b 1:
s101b1, the terminal acquires the size of the transmission file carried by the response message according to the first indication.
It should be noted that, when the response message carries the first indication, the response message is in the overall transmission mode.
Generally, the operation of the user on the terminal is sent to the terminal or the server in the form of a request message, and the terminal or the server sends a response message to the terminal according to the request sent by the user and returns a response to the user operation to the user according to the response message. The request message comprises a request line and a request header, and optionally also comprises a request body; the response message includes: a status line, a reply header, and optionally, a reply body. The request line starts with the request method name, followed by the resource identifier and the protocol version used by the browser. The most common request method is GET, and the GET request is used for fetching resources from a server and is a default request method. For example, when a user enters a URL or clicks a link in an address bar of a browser, a request of the user is sent to the server as a GET request.
For example, it is assumed that the request message sent by the terminal to the server is as follows:
GET/HTTP/1.1 (request line)
Host:www.google.com(request header)
Illustratively, in response to the request message, the response message sent by the server to the terminal when the request message is transmitted as a whole is as follows:
it should be noted that the "Content-Length" field in the response message in the above example is the first indication in the embodiment of the present application. And acquiring the size of the transmission file according to the first indication. If the response message carries a 'Content-Length' field, the response message is in an integral transmission mode; if an application establishes a connection with the server by adopting an HTTP protocol and the value of the Content-Length in the response message is tens of MB, the terminal can determine that the application is file transmission.
Specifically, in conjunction with fig. 2, the file transfer behavior detection module 224 in the terminal 200 may be configured to support the terminal 200 to execute step S101b1 in this embodiment.
The method comprises the steps that a connection between an application and a server is established by adopting an HTTP (hyper text transport protocol) through a terminal detection, a response message sent by the server is detected by the terminal, and when the whole transmission is carried out, the size of a transmission file is obtained according to a first indication of the response message, so that whether the application has a file transmission behavior or not can be determined according to the size of the transmission file, and a basis is provided for reasonably managing application resources by the terminal.
Optionally, if the application in the terminal establishes a connection with the server by using an HTTP protocol or an HTTPs protocol, and the terminal determines the size of the transmission file, step S101b may further include S101b 2:
s101b2, the terminal determines the size of the data block accumulation transmitted in the response message according to the second indication carried by the response message.
Wherein the second indication is used for indicating that the response message is in a block transmission mode.
In the embodiment of the application, when the server or the terminal adopts a block transmission mode of an HTTP (hyper text transport protocol), the terminal obtains the size of the transmission file by determining the cumulative size of the transmitted data blocks.
Illustratively, in response to the request message, the response message sent by the server to the terminal during block transmission is as follows:
it should be noted that "Transfer-Encoding: chunked" in the above response message is the second indication in this application. The 4 pieces of data corresponding to "23", "1A", "3" and "8" in the above-mentioned response message are "This is the data in the first chunk", "and This is the second one", "con" and "sequence", respectively, which are 4 data blocks in length (16-ary, converted to 10-ary, 35, 26, 3, 8 bytes, respectively).
Specifically, in conjunction with fig. 2, the file transfer behavior detection module 224 in the terminal 200 is used to support the terminal 200 to execute step S101b2 in the embodiment of the present application.
If the terminal detects that the application running in the background is connected with the server by adopting an HTTP protocol, the terminal detects a response message sent by the server, and if the response message indicates block transmission, the size of an accumulated block HTTP transmission object can be determined from the response message, so that a basis is provided for the terminal to judge whether the background application has a file transmission behavior.
Optionally, the terminal may automatically clean the application running in the background, and the terminal may also receive an application selected by the user to clean the background.
When the terminal automatically cleans up the applications running in the background, then step S102 may include step S102a 1:
s102a1, if the resource distributed to the foreground running application is determined to be smaller than the fourth threshold, the terminal cleans at least one background running application except the target application.
Illustratively, fig. 6 is a selection interface for whether to clean a background application according to an embodiment of the present application. Suppose that the user returns to the home page after starting the plurality of applications, the terminal detects that the first application is downloading when performing the cleaning operation, the terminal displays an interface shown as 6A in fig. 6 on the home page, and displays a selection prompt box on the terminal display screen, showing "is cleaning, is cleaning the following applications? If the user clicks the left side of the switch, the user does not agree to clean the first application, and if the user clicks the right side of the switch, the user agrees to clean the first application; if a plurality of downloaded applications exist simultaneously, a prompt box indicating whether the plurality of downloaded applications are cleared is displayed, for example, the second application is an application for downloading a movie, the third application is an application for downloading a file, the terminal may display, on an interface, prompt boxes indicating whether the first application (file transfer), the second application (file transfer), and the third application (file transfer) are cleared in 6B of fig. 6, and the user selects an operation of clearing on the interface shown in 6A or 6B of fig. 6.
It should be noted that, in the embodiment of the present application, whether the selection prompt box is displayed may be selected according to whether the application of the file transfer behavior exists in the cleaned application, when the application of the file transfer behavior exists in the application running in the background, the terminal displays the selection prompt box, when the application of the file transfer behavior does not exist in the application running in the background, the terminal directly cleans up in the background, and the terminal may not display the selection prompt box or may display the selection prompt box, which is not specifically limited in this embodiment of the present application.
For example, fig. 7 is a selection interface for whether to clean a background application according to an embodiment of the present application. Assuming that after the user starts multiple applications, the user is watching a video in a second application, a file downloading behavior exists in a first application in the background, and no file downloading behavior exists in other background applications, the terminal may display an interface shown as 7A in fig. 7 or an interface shown as 7B in fig. 7 to the user when performing a cleaning operation in the background, where a selection box in 7A in fig. 7 is located at the edge of a display screen, and a selection box cleaned in 7B in fig. 7 is located on a video interface in the display screen, and the user may trigger an operation that does not clean the first application in the interface shown as 7A or 7B in fig. 7.
According to the resource management method for the application, if it is determined that the resource allocated to the foreground running application is smaller than the fourth threshold, the terminal cleans at least one background running application except the target application, and the target application can be guaranteed not to be cleaned, so that the terminal can flexibly manage the resource of the application, failure of file transmission in the target application is avoided, flow loss of a user is reduced, and user experience is improved.
When the user triggers to clean the background application, for example, when the cleaning icon is triggered, the terminal does not need to determine whether the foreground application resource is smaller than the fourth threshold, and the terminal can directly execute the cleaning operation of the application running in the background, and then the step S102 may include steps S102a2-S102a 3:
s102a2, if the terminal detects a cleaning operation instruction triggered by a user, responding to the cleaning operation instruction, and displaying whether a first display interface of the target application is cleaned on the display interface by the terminal.
S102a3, detecting a first operation instruction triggered by a user on a first display interface, and responding to the first operation instruction, and clearing at least one background running application except the target application by the terminal.
Wherein the first operation instruction indicates that the target application is not cleaned.
Fig. 8 is a display interface of a terminal according to an embodiment of the present application, and when the terminal receives a user instruction to clean, the display interface shown in fig. 8 may be provided for the user. In fig. 8A, the user clicks the cleaning icon on the main page, and an interface as shown in fig. 7B may be displayed, displaying the first application, the second application, and the third application that are being downloaded, for the user to select cleaning.
Illustratively, when the user is watching a video, as shown in 9A in fig. 9, the user triggers a cleaning icon in the task bar, displays a selection interface as shown in 9B in fig. 9 for the user to select, or the user triggers cleaning for a period of time and then cleans the first application with downloading behavior, and displays a selection interface as shown in 9C in fig. 9 for the user to select in the notification bar of the terminal.
Specifically, with reference to fig. 2, the resource detection module 202 and the resource cleaning module 226 in the terminal 200 are used to support the terminal 200 to perform steps S102a1-S102a3 in this embodiment.
According to the resource management method for the application, if the terminal detects the cleaning operation triggered by the user, the terminal cleans at least one application running in the background except the target application, and therefore the target application can be prevented from being cleaned, the resource of the application can be flexibly managed by the terminal, file transmission failure in the target application is avoided, flow loss of the user is reduced, and user experience is improved.
Optionally, when the terminal detects an application with a file transfer behavior, the terminal may reallocate resources for the application with the file transfer behavior in order to enable file transfer to be faster or to enable a user experience of the current application to be better. Of course, the terminal may also receive a user instruction to reallocate transmission resources.
When the terminal satisfies the condition for allocation according to the resource determined by the terminal, step S102 may include step S102b 1:
s102b1, if the allocable resources of the terminal are determined to be larger than or equal to the fifth threshold, the terminal reallocates the resources of the application currently running in the terminal.
Optionally, the terminal reallocates the resource of the application currently running in the terminal on the premise of not reducing the resource of the target application or not changing the position of the current resource of the target application. The current resource information is a position or a size of occupied resources, and the terminal may add more reallocated resources to the target application in other positions of the resources, for example, add more memories to the target application from other memory blocks, which is not specifically limited in this embodiment of the present application.
It should be noted that the fifth threshold may be a different value for different resources, and an empirical value may be selected according to a usage condition of each resource, for example, the remaining amount of the network bandwidth is 50% of the threshold of the network bandwidth resource, and in practical applications, the fifth threshold may determine an empirical value according to an operation condition of the terminal and an amount of resources required by each application, and a specific value of the fifth threshold is not specifically limited in the embodiment of the present application.
According to the resource management method for the application, provided by the embodiment of the application, if the terminal determines that the allocable resource is greater than or equal to the fourth threshold, the terminal reallocates the resource of the application currently running in the terminal, so that the resource is dynamically adjusted for the application in the terminal, the resource can be added for the target application, the file transmission task is completed as soon as possible, and the user experience is improved.
Alternatively, when the user triggers an instruction to reallocate resources, step S102 may include steps S102b2-S102b 3:
s102b2, if the terminal detects a second operation instruction triggered by the user, responding to the second operation instruction, and displaying a second display interface by the terminal.
Wherein the second operation indicates to reallocate resources of the application currently running in the terminal.
S102b3, detecting a third operation instruction triggered by the user on the second display interface, and reallocating the resources of the application currently running in the terminal by the terminal.
And the second operation instruction allocates resources for the application currently running in the terminal.
It should be noted that the third operation instruction triggered by the user may allocate a resource to at least one application, and the number of applications adjusted by the third operation instruction triggered by the user is not specifically limited in the embodiment of the present application.
Specifically, in conjunction with fig. 2, the resource detection module 202 and the resource allocation module 227 in the terminal 200 are used to support the terminal 200 to perform steps S102b1-S102b3 in the embodiment of the present application.
According to the resource management method for the application, if the terminal detects the instruction of reallocating the resources triggered by the user, the terminal reallocates the resources of the application currently running in the terminal, so that the resources are dynamically adjusted for the application in the terminal, resources can be added for the target application, a file transmission task is completed as soon as possible, and user experience is improved.
When the terminal determines that the resource needs to be reallocated or the terminal receives a user-triggered instruction to reallocate resources in the terminal, the "terminal reallocates resources of an application currently running in the terminal" in the above steps S102b1 and S102b2 includes steps W1-W4:
w1, the terminal determines the first weight factor of the application currently running in the terminal according to whether the file transmission behavior of the application currently running in the terminal exists.
W2, the terminal determines the second weight factor of the application currently running in the terminal according to whether the application currently running in the terminal is a foreground application.
W3, the terminal determines the resource allocation weight of the current running application according to the first weight factor of the current running application and the second weight factor of the current running application.
W4, the terminal allocates resources for at least one current running application according to the resource allocation weight of the current running application.
It should be noted that the terminal may adjust resources for all applications, or may only add resources to an application that runs in the background and has a file transfer behavior, which is not specifically limited in this embodiment of the present application.
Specifically, in conjunction with fig. 2, the resource allocation module 227 in the terminal 200 is configured to support the terminal 200 to perform steps W1-W4 in the embodiment of the present application.
It should be noted that, in the setting interface of the terminal, the user may also manually select the allocated resource for the application executing the file transfer in the background. For example, the user can set to allow the background file to upload and download 70% of the network bandwidth. The terminal detects that the first application has a file transmission behavior, that is, 70% of network bandwidth can be reserved for the first application.
Exemplarily, taking network bandwidth allocation as an example, fig. 10 is an interface schematic diagram for allocating resources by a terminal according to an embodiment of the present application. As shown in fig. 10A, assuming that the network bandwidth occupied by the application running in the background and the application running in the foreground by default at the terminal is both 50%, the user may directly set the network bandwidth occupied by the application running in the background to be 70%, the application running in the foreground to be 30%, and the set interface is shown in fig. 10B. Of course, the network bandwidth occupied by each application may also be displayed, for example, as shown in fig. 10C, a first application occupies 50% of the network bandwidth, a second application occupies 30% of the network bandwidth, and a third application occupies 20% of the network bandwidth, and when the terminal determines that resources need to be reallocated to the applications, the management bar of the resources of each application currently running may be adjusted. Assuming that the terminal displays that the first application running in the background is an application having a file transfer behavior, the second application running in the background and having no file transfer behavior, the user may further reduce the network bandwidth of the second application, and add resources to the first application, for example, add 20% of the network bandwidth to the first application.
According to the resource management method for the applications, the first weight factor and the second weight factor of each application running in the terminal are determined, and the resource distribution weight of each application running in the terminal can be determined through the first weight factor and the second weight factor of each application, so that the resources of the target application can be managed according to the resource distribution weight of the target application.
Optionally, before step S102, the terminal may also set a priority for the application. The priorities include a cleaning priority and an allocation priority. The terminal sets the foreground application to have the lowest cleaning priority, sets the target application to have the lower cleaning priority, sets the background running non-target application to have the higher cleaning priority, and when the terminal cleans the background running application, the terminal firstly cleans the application with the higher cleaning priority.
Optionally, the terminal sets the highest allocation priority for the foreground application, sets the higher allocation priority for the target application, sets the lower allocation priority for the non-target application, and adjusts the resource of the application with the higher allocation priority first when adjusting the resource.
For example, assuming that the terminal currently runs 8 applications, where the first application and the second application are target applications, the third application is a foreground application, and the other applications are non-target applications, the terminal cleans the top 5 applications of the currently running 8 applications in order from high to low according to the cleaning priority during cleaning.
According to the resource management method for the application, the priority is set for the target application, so that when the terminal conducts resource management on the application, the application with the higher priority can be cleaned preferentially according to the priority of the application, or the application with the higher priority can be adjusted preferentially, the application cleaning with file transmission behavior in the background running application cleaning process can be avoided, and the flexibility of application resource management is improved.
Example 1: application running in foreground needs to be cleaned up due to insufficient resource of application running in background
As shown in fig. 11, it is assumed that the first application in the terminal of user 1 is P2P download software, the second application is browser software, and the third application is game software, wherein the first application can download a video file into the terminal.
When a user opens a terminal and wants to watch a certain movie and television play, the online watching effect is poor because the video server is crowded when the program is too hot, and the user decides to download the video file to the local and watch the video file. At time 1, a first application is launched on the user terminal to download a video file. Because the video file is large in size and needs a long time for downloading, a user starts a second application to surf the internet and browse the webpage at the moment 2 in order to avoid boring waiting; the user has moved interest after viewing the web page for a period of time, and at time 3 a third application is launched to begin playing the game.
Step 1, the terminal determines a target application.
(1) The file transfer behavior detection module 223 determines that the file transfer behavior of the first application exists when it detects that the first application establishes a long connection with the server through the P2P protocol, and 200MB of traffic is transferred within 1 minute on the long connection.
(2) The file transfer behavior detection module 223 detects that the second application accesses the network through the HTTP protocol, and the size of the transfer file is 60KB, and determines that the second application does not have a file transfer behavior.
Suppose that the user consumes a significant amount of memory resources during game play of the third application.
And 2, the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application.
(1) The resource detection module 225 detects a memory shortage, and the resource detection module 225 notifies the resource cleaning module 226 to clean the background application and the background service.
(2) The resource cleaning module 226 obtains the notification of the resource detection module 225, and the resource cleaning detection module 226 queries the result detected by the application transmission behavior detection module 223 to determine that the first application has a file transmission behavior and the second application does not have a file transmission behavior.
(3) The resource clean-up module 226 cleans up the second application.
Example 2: the foreground running application has sufficient resources and can add resources for the application with transmission behaviors in the background running application
As shown in fig. 12, it is assumed that the first application is mail (Email) client software and the second application is browser software, wherein the mail can be sent to the server through the first application. The user opens the first application at time T1 to send a mail piece in which the user has added a relatively large attachment, requiring a relatively long time to upload. The user launches the second application to browse the web page at time T2 in order to avoid an annoying wait. Assume that the first application occupies 50% of the network bandwidth and the second application occupies 10% of the network bandwidth.
Step 1, the terminal determines a target application.
(1) The transmission behavior detection module 224 determines that the file transmission behavior of the first application exists when detecting that the first application establishes a long connection with the server by using the SMTP protocol, and the long connection transmits 100M traffic within 1 minute.
(2) The transmission behavior detection module 223 detects that the second application accesses the network through the HTTP protocol, obtains the size of the analyzed HTTP transmission object as 100KB, and determines that the second application does not have a file transmission behavior.
And 2, the terminal adjusts the resources of the application running in the foreground and/or the application running in the background of the terminal on the premise of reserving the existing resources of the target application.
(1) The resource allocation module 227 determines a resource allocation factor for each application in the terminal.
For the first application, which is transferring files and is in the background, assume that the first weight factor of the first application is K DL1 10, the second weighting factor of the first application is K FG1 1, thenAn application has a resource allocation weight of W 1 =K DL1 ×K FG 2 =10。
For the second application, no file is transferred and in the foreground, assuming that the first weight factor of the second application is K DL2 1, the second applied second weight factor is K FG2 The resource allocation weight W of the second application is 5 2 =K DL2 ×K FG2 =5。
(2) The resource allocation module 227 allocates resources for at least one currently running application according to the resource allocation weights of the currently running applications.
Assuming that no third application in the system needs to communicate over the network, only the network bandwidth needs to be allocated between the first application and the second application.
Determining the proportion of the network bandwidth allocated by the first application according to the first resource allocation weight and the second resource allocation weight as follows: w 1 /(W 1 +W 2 )=10/(10+5)≈67%。
Determining the ratio of the network bandwidth allocated by the second application as follows according to the first resource allocation weight and the second resource allocation weight: w 2 /(W 1 +W 2 )=5/(10+5)≈33%。
The terminal increases the network bandwidth of the first application from 50% to 67%.
It should be noted that, for an application without transmission behavior, the terminal may increase the network bandwidth for the application, and may also maintain the bandwidth currently used by the application without transmission behavior, for example, the terminal may increase the network bandwidth to 33% for the second application, and may also maintain the network bandwidth of 10% for the second application.
The terminal distributes the network bandwidth according to the network bandwidth proportion obtained by calculation, so that the use experience of the foreground second application can be ensured, a user is prevented from feeling that the operation is blocked, and sufficient network bandwidth resources are provided for the background first application, so that the stable background transmission speed can be obtained, and the Email mail can be sent as soon as possible.
The above-mentioned solutions provided in the present application are mainly described from the perspective of a terminal, and it is understood that the terminal includes a hardware structure and/or a software module for performing the above-mentioned functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the terminal may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
For example, in the case of dividing each functional module by corresponding functions, fig. 13 shows a possible structural diagram of the terminal 1300 according to the above embodiment. As shown in fig. 13, the terminal 1300 includes a determining module 131 and an adjusting module 132. The determining module 131 is used for supporting the terminal 1300 to perform steps S101, S101a-S101c, S101a1, S101b1 and 101b2 in the method embodiments; the adjusting module 132 is used to support the terminal 1300 to perform the steps S102, S102a1, S102a2, S102a3, S102b1, S102b2, S102b3 and W1-W4 in the method embodiment; all relevant contents of the steps related to the method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In the case of dividing the functional modules in an integrated manner, fig. 14 shows a possible structural diagram of the terminal 1400 involved in the above-described embodiments. As shown in fig. 14, terminal 1400 includes a processing module 141. The processing module 141 is used to support the terminal 1400 to perform the steps S101-S102, S101a-S101c, S101a1, S101b1, 101b2, S102a1, S102a2, S102a3, S102b1, S102b2, S102b3 and W1-W4 of the method embodiment. All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the present application are all or partially generated upon loading and execution of computer program instructions on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or can comprise one or more data storage devices, such as a server, a data center, etc., that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
While the present application has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
Although the present application has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely illustrative of the present application as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (22)
1. A method for resource management of an application, the method comprising:
the method comprises the steps that a terminal determines a target application, wherein the target application runs in a terminal background and has a file transmission behavior;
the terminal reduces the resources of the application running in the foreground of the terminal on the premise of ensuring the resources of the process of the target application; or
And the terminal reduces the resources of the application running in the foreground and the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application.
2. The method according to claim 1, wherein the application of the file transfer behavior satisfies any one of the following conditions:
the connection established with the server comprises at least one long connection, and the flow transmitted on any one long connection in the at least one long connection exceeds a first threshold value within a first connection time length;
establishing at least one connection with a server through a standard file transfer protocol, wherein the flow transmitted on any one connection in the at least one connection exceeds a second threshold value within a second connection duration;
and establishing connection with the server through a hypertext transfer protocol (HTTP) protocol or a hypertext transfer security protocol (HTTPS) protocol, wherein the size of the transmission file exceeds a third threshold value.
3. The method according to claim 2, wherein the terminal determines that the size of the transmission file exceeds the third threshold, comprising:
the terminal acquires a response message, wherein the response message is a response message sent by the terminal to a server or a response message sent by the server to the terminal;
the terminal determines the size of the transmission file according to the response message;
the terminal determines whether the size of the transmission file exceeds the third threshold.
4. The method according to claim 3, wherein the terminal determines the size of the transmission file according to the response message, comprising:
the terminal acquires the size of the transmission file carried by the response message according to a first instruction;
or,
and the terminal determines the accumulated size of the data blocks transmitted in the response message according to a second indication carried by the response message, wherein the second indication is used for indicating that the response message is in a block transmission mode.
5. The method of claim 4, wherein the terminal obtaining the response message comprises:
the terminal acquires and analyzes the response message at a transmission object analysis point;
if the application establishes connection with the server through an HTTP protocol, the transmission object analysis point is positioned between an HTTP layer and a transmission control protocol layer TCP layer;
or,
and if the application establishes connection with the server through an HTTPS protocol, the transmission object analysis point is positioned between an HTTP layer and a secure socket layer/a secure transmission layer SSL/TLS layer.
6. The method of claim 2, wherein the standard file transfer protocol is a File Transfer Protocol (FTP) protocol, a peer-to-peer network protocol (P2P) protocol, a Simple Mail Transfer Protocol (SMTP) protocol, a post office protocol third edition (POP 3) protocol, or a mail access protocol (IMAP) protocol.
7. The method according to any one of claims 1-6, characterized in that the terminal reduces the resources of the application running in the foreground of the terminal on the premise of ensuring the resources of the process of the target application; or, the reducing, by the terminal, the resources of the application running in the foreground and the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application includes:
if the resource distributed to the application running in the foreground is determined to be smaller than a fourth threshold value, cleaning at least one application running in the background except the target application;
or,
and if the allocable resources of the terminal are determined to be larger than or equal to the fifth threshold, reallocating the resources of the application currently running in the terminal.
8. The method according to claim 7, characterized in that the terminal reduces the resources of the application running in the foreground of the terminal on the premise of ensuring the resources of the process of the target application; or, the reducing, by the terminal, the resources of the application running in the foreground and the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application further includes:
if the terminal detects a cleaning operation instruction triggered by a user, responding to the cleaning operation instruction, and displaying whether a first display interface of the target application is cleaned or not by the terminal;
detecting a first operation instruction triggered by a user on the first display interface, and in response to the first operation instruction, cleaning at least one background running application except the target application by the terminal, wherein the first operation instruction indicates that the target application is not cleaned.
9. The method according to claim 7, wherein the terminal reduces resources of the application running in the foreground of the terminal on the premise of ensuring resources of the process of the target application; or, the reducing, by the terminal, the resources of the application running in the foreground and the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application further includes:
if the terminal detects a second operation instruction triggered by a user, responding to the second operation instruction, and displaying a second display interface by the terminal, wherein the second operation instruction indicates that resources of the application currently running in the terminal are redistributed;
and detecting a third operation instruction triggered by the user on the second display interface, reallocating the resources of the application currently running in the terminal by the terminal, and indicating that the resources are allocated to the application currently running in the terminal by the third operation instruction.
10. The method according to claim 7 or 9, wherein said reallocating resources of an application currently running in the terminal comprises:
determining a first weight factor of the currently running application in the terminal according to whether a file transmission behavior exists in the currently running application;
determining a second weight factor of the currently running application in the terminal according to whether the currently running application is a foreground application;
determining a resource allocation weight of the currently running application according to a first weight factor of the currently running application and a second weight factor of the currently running application;
and allocating resources for at least one current running application according to the resource allocation weight of the current running application.
11. A terminal is characterized by comprising a determining module and an adjusting module;
the determination module is to: determining a target application; the target application is an application which runs in the background of the terminal and has a file transmission behavior;
the adjustment module is configured to: on the premise of ensuring the resources of the process of the target application, reducing the resources of the application running in the foreground of the terminal; or, the terminal reduces the resources of the application running in the foreground and the application running in the background of the terminal on the premise of ensuring the resources of the process of the target application.
12. The terminal according to claim 11, wherein the application of the file transfer behavior satisfies any one of the following conditions:
the connection established with the server comprises at least one long connection, and the flow transmitted on any one long connection in the at least one long connection exceeds a first threshold value within a first connection time length;
establishing at least one connection with a server through a standard file transfer protocol, wherein the flow transmitted on any one connection in the at least one connection exceeds a second threshold value within a second connection duration;
and establishing connection with the server through a hypertext transfer protocol (HTTP) protocol or a hypertext transfer security protocol (HTTPS) protocol, wherein the size of the transmission file exceeds a third threshold value.
13. The terminal of claim 12, wherein the determining module is specifically configured to:
acquiring a response message, wherein the response message is a response message sent by the terminal to a server or a response message sent by the server to the terminal;
determining the size of the transmission file according to the response message;
determining whether the size of the transmission file exceeds the third threshold.
14. The terminal of claim 13, wherein the determining module is specifically configured to:
acquiring the size of the transmission file carried by the response message according to a first instruction;
or,
and determining the accumulated size of the data blocks transmitted in the response message according to a second indication carried by the response message, wherein the second indication is used for indicating that the response message is in a block transmission mode.
15. The terminal of claim 14, wherein the determining module is specifically configured to:
acquiring and analyzing the response message at a transmission object analysis point;
if the application establishes connection with the server through an HTTP protocol, the transmission object analysis point is positioned between an HTTP layer and a transmission control protocol layer TCP layer;
or,
and if the application establishes connection with the server through an HTTPS protocol, the transmission object analysis point is positioned between an HTTP layer and a secure socket layer/a secure transmission layer SSL/TLS layer.
16. The terminal of claim 12, wherein the standard file transfer protocol is a file transfer protocol, FTP, protocol, peer-to-peer network protocol, P2P, simple mail transfer protocol, SMTP, post office protocol version three, POP3, or mail access protocol, IMAP.
17. The terminal according to any of claims 11 to 16, wherein the adjusting module is specifically configured to:
if the resource distributed to the application running in the foreground is determined to be smaller than a fourth threshold value, cleaning at least one application running in the background except the target application;
or,
and if the allocable resources of the terminal are determined to be larger than or equal to the fifth threshold, reallocating the resources of the application currently running in the terminal.
18. The terminal of claim 17, wherein the terminal comprises a display module; the display module is used for:
if a cleaning operation instruction triggered by a user is detected, responding to the operation instruction, and displaying whether a first display interface of the target application is cleaned or not;
detecting a first operation instruction triggered by a user on the first display interface;
the adjusting module is further configured to, after the display module detects a first operation instruction triggered by a user on the first display interface, respond to the first operation instruction to clean at least one background-running application other than the target application, where the first operation instruction indicates that the target application is not cleaned.
19. The terminal of claim 17, wherein the terminal comprises a display module; the display module is used for:
if a second operation instruction triggered by a user is detected, responding to the second operation instruction, and displaying a second display interface, wherein the second operation instruction indicates that resources of the application currently running in the terminal are redistributed;
detecting a third operation instruction triggered by the user on the second display interface;
the adjusting module is further configured to reallocate resources of the currently running application in the terminal after the display module detects a third operation instruction triggered by the user on the second display interface, where the third operation instruction indicates that resources are allocated to the currently running application in the terminal.
20. The terminal according to claim 17 or 19, wherein the adjusting module is specifically configured to:
determining a first weight factor of the currently running application in the terminal according to whether a file transmission behavior exists in the currently running application;
determining a second weight factor of the currently running application in the terminal according to whether the currently running application is a foreground application;
determining a resource allocation weight of the currently running application according to a first weight factor of the currently running application and a second weight factor of the currently running application;
and allocating resources for at least one current running application according to the resource allocation weight of the current running application.
21. A terminal, comprising: a processor, a memory, and a communication interface;
the memory is configured to store computer-executable instructions, and when the terminal runs, the processor executes the computer-executable instructions stored in the memory to cause the terminal to perform the resource management method of the application according to any one of claims 1 to 10.
22. A computer-readable storage medium, comprising computer instructions which, when run on a computer, cause the computer to perform a method of resource management of an application as claimed in any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710940872.XA CN109600409B (en) | 2017-09-30 | 2017-09-30 | Resource management method and terminal for application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710940872.XA CN109600409B (en) | 2017-09-30 | 2017-09-30 | Resource management method and terminal for application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109600409A CN109600409A (en) | 2019-04-09 |
CN109600409B true CN109600409B (en) | 2022-08-19 |
Family
ID=65956588
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710940872.XA Active CN109600409B (en) | 2017-09-30 | 2017-09-30 | Resource management method and terminal for application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109600409B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111954286B (en) * | 2020-08-06 | 2022-04-22 | 捷开通讯(深圳)有限公司 | Power adjusting method, device, storage medium and terminal |
CN114916017B (en) * | 2022-07-18 | 2022-10-04 | 荣耀终端有限公司 | Data transmission method, electronic equipment and readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101355590A (en) * | 2008-09-05 | 2009-01-28 | 深圳市迅雷网络技术有限公司 | Method, system and apparatus for prompting download |
CN105468426A (en) * | 2016-01-05 | 2016-04-06 | 珠海市魅族科技有限公司 | Application freezing method and terminal |
CN105701025A (en) * | 2015-12-31 | 2016-06-22 | 华为技术有限公司 | Memory recovery method and device |
CN106125882A (en) * | 2016-06-15 | 2016-11-16 | 深圳市万普拉斯科技有限公司 | Application program management method and electronic equipment |
CN106919428A (en) * | 2017-03-21 | 2017-07-04 | 北京奇虎科技有限公司 | Clear up method, device and the mobile terminal of mobile terminal internal memory |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7126467B2 (en) * | 2004-07-23 | 2006-10-24 | Innovalarm Corporation | Enhanced fire, safety, security, and health monitoring and alarm response method, system and device |
CN103024538A (en) * | 2012-11-12 | 2013-04-03 | 北京奇虎科技有限公司 | Memory management method and system |
CN105677477B (en) * | 2015-12-30 | 2019-10-15 | 北京金山安全软件有限公司 | Method and device for optimizing application program resources and electronic equipment |
CN105824702A (en) * | 2016-03-22 | 2016-08-03 | 乐视云计算有限公司 | Method and terminal for managing program memory footprint |
CN107168791A (en) * | 2017-04-13 | 2017-09-15 | 北京安云世纪科技有限公司 | Terminal Memory Optimize Method, device and mobile terminal under bright screen state |
-
2017
- 2017-09-30 CN CN201710940872.XA patent/CN109600409B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101355590A (en) * | 2008-09-05 | 2009-01-28 | 深圳市迅雷网络技术有限公司 | Method, system and apparatus for prompting download |
CN105701025A (en) * | 2015-12-31 | 2016-06-22 | 华为技术有限公司 | Memory recovery method and device |
CN105468426A (en) * | 2016-01-05 | 2016-04-06 | 珠海市魅族科技有限公司 | Application freezing method and terminal |
CN106125882A (en) * | 2016-06-15 | 2016-11-16 | 深圳市万普拉斯科技有限公司 | Application program management method and electronic equipment |
CN106919428A (en) * | 2017-03-21 | 2017-07-04 | 北京奇虎科技有限公司 | Clear up method, device and the mobile terminal of mobile terminal internal memory |
Also Published As
Publication number | Publication date |
---|---|
CN109600409A (en) | 2019-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3192220B1 (en) | Real-time sharing during a phone call | |
US9432314B2 (en) | Quick navigation of message conversation history | |
US12047528B2 (en) | Favorite-object display method and terminal | |
CN113360238A (en) | Message processing method and device, electronic equipment and storage medium | |
US20200084182A1 (en) | System for remotely controlling electronic device and method of operating the same | |
AU2008271011B2 (en) | Port discovery and message delivery in a portable electronic device | |
WO2022017107A1 (en) | Information processing method and apparatus, computer device and storage medium | |
US8577971B2 (en) | Email fetching system and method in a portable electronic device | |
CN112947823A (en) | Session processing method, device, equipment and storage medium | |
US10474507B2 (en) | Terminal application process management method and apparatus | |
KR20170055971A (en) | Task completion across devices using a shared work space | |
EP3103250B1 (en) | Highlighting univiewed video messages | |
CN106131394A (en) | A kind of method and device taken pictures | |
CN112751744B (en) | Method and device for controlling video playing, computing equipment and storage medium | |
CN109600409B (en) | Resource management method and terminal for application | |
WO2016049875A1 (en) | Device and method for capturing, sharing and watching video messages | |
CN116170681A (en) | Media content transmitting method, device, equipment and storage medium | |
JP6441385B2 (en) | Information input method, apparatus, program, and recording medium | |
US20150015514A1 (en) | Method and apparatus for group communications | |
CN107409327B (en) | Processing operation method and equipment | |
CN114449095B (en) | Cloud mobile phone screenshot method and device, electronic equipment and storage medium | |
WO2016049882A1 (en) | Device and method for capturing, sharing and watching video messages | |
CN115185597A (en) | Processing method, intelligent terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province Applicant after: HUAWEI DEVICE Co.,Ltd. Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province Applicant before: Huawei terminal (Dongguan) Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |