CN110913424B - Network connection control method and device, terminal and computer storage medium - Google Patents

Network connection control method and device, terminal and computer storage medium Download PDF

Info

Publication number
CN110913424B
CN110913424B CN201911115157.8A CN201911115157A CN110913424B CN 110913424 B CN110913424 B CN 110913424B CN 201911115157 A CN201911115157 A CN 201911115157A CN 110913424 B CN110913424 B CN 110913424B
Authority
CN
China
Prior art keywords
application
network connection
terminal
connection quality
quality
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
Application number
CN201911115157.8A
Other languages
Chinese (zh)
Other versions
CN110913424A (en
Inventor
马园
郭玉华
黄文�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201911115157.8A priority Critical patent/CN110913424B/en
Publication of CN110913424A publication Critical patent/CN110913424A/en
Application granted granted Critical
Publication of CN110913424B publication Critical patent/CN110913424B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/75Indicating network or usage conditions on the user display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72445User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting Internet browser applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72427User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting games or graphical animations

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application can control whether the application allows the network connection according to the quality of the network connection of the application after the application is switched from foreground display to inactive display, thereby avoiding the problem that the application consumes system resources because the quality of the network connection is not good and frequently sends data packets, and the application flexibly adjusts the network connection state of the application according to the quality of the network connection without presetting a black and white list, and improving the use experience of users. The method comprises the following steps: determining that a first event occurs when a terminal runs a first application in a foreground, wherein the first event is an event displayed on a terminal screen and not activated by a window of the first application; detecting a network connection quality of a first application; controlling whether the first application is allowed to use the network connection according to the network connection quality of the first application.

Description

Network connection control method and device, terminal and computer storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a network connection control method and apparatus, a terminal, and a computer storage medium.
Background
With the improvement of the performance of the mobile phone, the number of applications that can be installed in the mobile phone increases, and for a multitasking system, a user may open multiple applications and switch between different applications, and under such a situation, the applications in the background may consume resources of the mobile phone, for example, when the applications of the mobile phone use a network to transmit data, more power consumption of the mobile phone may be consumed, which results in a deterioration of the cruising ability of the mobile phone. Aiming at the problem of power consumption caused by background application running, some strategies are to limit background applications by adopting a black-and-white list mechanism, the applications in a black list can not run in the background or use network data, and the applications in a white list can run in the background or use network data.
Disclosure of Invention
The application can control whether the application allows the network connection according to the network connection quality of the application after the application is switched from foreground display to inactive display, thereby avoiding that the application frequently sends data packets due to poor network connection quality, consumes system resources, does not need to preset a black and white list, but flexibly adjusts the network connection state of the application according to the network connection quality, and improving the use experience of a user.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, the present application provides a network connection control method, including: determining that a first event occurs when a terminal runs a first application in a foreground, wherein the first event is an event that a window of the first application is not activated and displayed on a terminal screen, and the case that the window of the first application is not activated and displayed on the terminal screen may be: and the first application is switched off under the condition that the foreground runs, or the first application is switched to the background to run. The first application is switched to the background running, and the switching to the interface, the lock screen, the desktop of the other application, or the window of the other application is partially overlapped on the window of the first application, so that the window of the first application is in the state of being not activated and displayed, and accordingly, the triggering condition of the first event can be that, for example, the first event can be that a user slides upwards through the bottom of a touch screen of the terminal, or the user clicks a link jumping to the other application in the first application, and the like; since the window of the first application is not actively displayed on the terminal screen after the occurrence of the first event, the network connection quality of the first application is detected to control whether the first application allows the use of the network connection according to the network connection quality of the first application.
The step of controlling whether the first application allows to use the network connection according to the network connection quality of the first application may include the following two cases: (1) under the condition of poor network connection quality, forbidding the first application to use the network connection, which may specifically include controlling disconnection of the network connection established by the first application, and/or forbidding a request for newly establishing the network connection by the first application; (2) and in the case that the network connection quality reaches the preset standard, allowing the first application to use the network connection, which may specifically include keeping the network connection of the first application unchanged, and/or allowing the first application to request a new network connection.
The network connection quality of the first application is used to represent a network connection condition of the first application, and the evaluation manner of the network connection quality may be determined by the size of a parameter value, for example, one or more parameters related to the network connection quality may be detected, and the network connection quality may be determined according to whether the value of the measured parameter exceeds a threshold value.
Under the condition of poor network connection quality, the packet loss rate of a data packet is high, a large amount of data messages need to be retransmitted, and a large amount of hardware and software resources are consumed.
In one possible implementation, after controlling that the first application is not allowed to use the network connection according to the network connection quality of the first application, the method further includes: acquiring the network signal intensity of the terminal detected in a preset period; and controlling whether the network connection of the first application is recovered to be allowed to be used or not according to the network signal strength of the terminal. After the network connection quality of the first application is poor and the network connection of the first application is disconnected, if the network signal strength of the terminal is detected to be good and a preset condition is reached, the first application can be controlled to recover to allow the network connection, and if the network signal strength of the terminal is poor and the preset condition is not reached, the first application is kept not to allow the network connection.
In a possible implementation manner, the network signal strength of the terminal may be measured by the network signal quality of an application running in the terminal, and specifically, the step of obtaining the network signal strength of the terminal detected in a preset period may include: acquiring the network connection quality of the running application detected in the preset period; and determining the network connection quality of the terminal according to the network connection quality applied in the operation. The running application may be one or more applications, optionally, all running applications, or several applications may be pre-specified, and the network connection quality of the terminal is determined according to the network connection quality of the running application in the pre-specified several applications. For example, each application is assigned a corresponding weight s in advanceiAssigning a weight t to each parameteriCounting n parameters p of running applicationjBy the formula ∑ sitipijAnd (j-1 to m, i-1 to n) calculating a parameter value of the network signal strength for representing the network connection quality of the terminal, and judging whether the network connection quality of the terminal reaches a preset condition according to whether the parameter value exceeds a preset threshold value.
In a possible implementation manner, after determining that the first event occurs in a case where the terminal runs the first application in the foreground, the method further includes: determining that the terminal has a second event which causes the interface of the first application to activate and display on the screen of the terminal, for example, the second event may be that the terminal is unlocked in a screen-off state so that the first application in a foreground running state before the screen-off is activated and displayed on the screen of the terminal, the second event may also be that a user clicks a notification message of the first application in the case that another application is running in the foreground so that the first application runs in the foreground, and so on, and after the second event occurs, the first application may be controlled to allow the network connection to be used. After the second event occurs and until the first event occurs again, controlling the first application to allow the network connection to be used, and not controlling whether the first application allows the network connection to be used according to the network connection quality of the first application, embodiments may include not monitoring the network connection quality of the first application any more, or not controlling the first application not to allow the network connection to be used in the case that the network connection quality of the first application is poor, although the network connection quality of the first application is monitored.
Further, controlling the first application to allow use of a network connection includes: canceling the restriction of the network connection quality of the first application on the network connection of the first application before the occurrence of the second event. For example, if the first application has been controlled to disallow use of the network connection before the occurrence of the second event, which may be by way of establishing a network firewall to disallow use of the network connection by the first application, the network firewall's restriction of use of the network connection by the first application may need to be removed after the occurrence of the second event.
In one possible implementation manner, the controlling whether the first application is allowed to use the network connection according to the network connection quality of the first application includes: determining the network connection authority of the first application according to the network connection quality of the first application; and controlling whether the first application is allowed to use network connection or not according to the network connection authority of the first application. The method includes controlling whether a network connection of a first application is disconnected, specifically, determining whether the first application has a network connection authority, if the network connection authority of the first application is to allow the use of the network connection, maintaining a network connection state of the first application, and also allowing a request of the first application to establish a new network connection.
An alternative implementation manner of prohibiting the request of newly establishing the network connection by the first application is to establish a network firewall configured to intercept the request data sent by the first application in a case that the network connection authority of the first application is not to allow the network connection to be used. For example, the network firewall may be configured to intercept the request data sent by the first application to a modem of the terminal. For example, a network firewall may be configured between an AP side and a Modem side of a terminal, where the first application is on the AP side, and when data needs to be sent using a network connection, the request data is sent to the Modem side, and by establishing the network firewall between the AP side and the Modem side, the request data sent to the Modem side by the first application may be intercepted and processed, and the request data of the first application is rejected from being sent to the Modem side, so as to prevent the Modem side from being frequently woken up, which wastes power consumption of the terminal.
In a possible implementation manner, for any of the above implementation manners, the detecting of the network connection quality of the first application may be detecting the network connection quality of each process of the first application. One or more processes may be started by one application, and in order to obtain a more accurate statistical result, the network connection quality may be counted in accordance with the level of the process, and further, the network connection quality of the first application may be determined based on the network connection quality of each process of the first application.
Further, in order to more accurately control the network connection of the first application, after detecting the network connection quality of each process of the first application, whether the network connection of the process corresponding to the first application is disconnected may be respectively controlled according to the network connection quality of each process of the first application. That is, if the network connection quality of a process does not meet the pre-configured requirement, the process is prohibited from using the network connection, including disconnecting the network connection established by the process, and/or the process is prohibited from creating a request for network connection; if the network connection quality of a process meets the pre-configured requirements, the process is allowed to use the network connection, including maintaining the network connection established by the process unchanged, and/or allowing the process to request a new network connection.
Further, it may also be determined whether to control the network connection according to the application level or the process level according to different modes, specifically, an optional implementation is as follows: before detecting the network connection quality of the first application, determining whether the terminal is in a first mode, where the first mode is a mode in which the terminal controls network connection according to an application level, for example, the first mode may be a power saving mode (where the terminal has a lower power consumption and demands for reducing power consumption are prioritized) or a night mode (where demands for using the terminal by a user are smaller); under the condition that the terminal is in the first mode, detecting the network connection quality of the first application, and correspondingly, controlling whether the first application allows the network connection to be used or not according to the network connection quality of the first application; and under the condition that the terminal is not in the first mode, detecting the network connection quality of each process of the first application, and correspondingly, respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
In a possible implementation manner, for any of the above implementation manners, it may be further determined whether to control the network connection according to the network connection quality of the application (or each process of the application) according to whether the terminal is in the second mode, that is, the second mode is a basis for determining whether to control the network connection according to the network connection quality of the application (or each process of the application). For example, the second mode may be a power saving mode (the terminal is powered down to give priority to the demand for power consumption reduction), if the terminal is in the second mode, the network connection is controlled according to the network connection quality of the first application (or each process of the first application), and if it is determined that the terminal is not in the second mode, the limitation of the network connection by the network connection quality of the first application (or each process of the first application) is cancelled. For another example, the second mode may be a charging mode, if the terminal is in the charging mode, the power consumption of the terminal does not need to be saved, the first application may be controlled to always allow the network connection to be used, the network connection quality of the first application does not need to be limited, and if the terminal is not in the charging mode, the network connection quality of the first application needs to be limited. In this possible implementation manner, different specific implementations may be adopted according to different situations, and the embodiment of the present application is not particularly limited to this.
In one implementation manner provided above, there is an implementation manner that needs to determine whether to control the network connection according to the network connection quality of the application (or each process of the application) by whether to be in the second mode, and further select whether to control the network connection according to the application level or the process level by whether to be in the first mode. For example, the second mode is a power saving mode, the first mode is a night mode, the terminal is in the power saving mode in a state where the terminal has a power lower than 20% and is not charged, the network connection needs to be controlled according to the network connection quality of the application (or each process of the application), if the current time is after 10 pm until 7 am on the next day, the terminal is in the night mode, the network connection needs to be controlled according to the application level, and if the current time is between 7 am and 10 pm, the terminal is not in the night mode, and the network connection needs to be controlled according to the process level.
In a possible implementation manner, for any of the above implementation manners, the controlling whether the first application allows to use the network connection according to the network connection quality of the first application includes: judging whether the network connection quality of the first application is lower than a preset standard or not; and controlling the first application not to allow the network connection to be used under the condition that the network connection quality of the first application is lower than the preset standard.
In a possible implementation, for any of the above implementations, the network connection quality of an application is determined based on at least one of the following parameters of the application: the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
In a second aspect, the present application provides a network connection control apparatus, comprising: the terminal comprises a first determining module, a second determining module and a display module, wherein the first determining module is used for determining that a first event occurs when a terminal runs a first application in a foreground, and the first event is an event displayed on a terminal screen without being activated by a window of the first application; a detection module for detecting a network connection quality of the first application; and the first control module is used for controlling whether the first application allows to use the network connection or not according to the network connection quality of the first application.
In one possible implementation, the apparatus further includes: the acquisition module is used for acquiring the network signal strength of the terminal detected in a preset period after controlling that the first application does not allow to use network connection according to the network connection quality of the first application; and the second control module is used for controlling whether the network connection of the first application is recovered to be allowed to be used or not according to the network signal strength of the terminal.
In one possible implementation manner, the obtaining module includes: an obtaining unit, configured to obtain network connection quality of the running application detected in the preset period; and the first determining unit is used for determining the network connection quality of the terminal according to the network connection quality of the running application.
In one possible implementation, the apparatus further includes: the second determining module is used for determining that a second event which enables an interface of a first application to activate and be displayed on a screen of the terminal occurs on the terminal or determining that the terminal is in a charging mode after the first event occurs under the condition that the terminal runs the first application in the foreground; and the execution module is used for controlling the first application to allow the network connection.
In one possible implementation manner, the first execution module includes: an execution unit, configured to cancel a restriction of the network connection quality of the first application on the network connection of the first application before the second event occurs or the terminal is in the charging mode.
In one possible implementation, the first control module includes: a second determining unit, configured to determine a network connection permission of the first application according to the network connection quality of the first application; and the first control unit is used for controlling whether the first application allows the network connection according to the network connection authority of the first application.
In one possible implementation, the apparatus further includes: the establishing module is used for establishing a network firewall under the condition that the network connection authority of the first application is not allowed to use the network connection after the network connection authority of the first application is determined, and the network firewall is configured to intercept the request data sent by the first application.
In one possible implementation, the network firewall is configured to intercept the request data sent by the first application to a modem of the terminal.
In one possible implementation, the detection module includes: a detecting unit, configured to detect a network connection quality of each process of the first application.
In one possible implementation, the first control module includes: and the second control unit is used for respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
In one possible implementation, the apparatus further includes: the judging module is used for judging whether the terminal is in a first mode or not before detecting the network connection quality of the first application; the detection module is configured to detect network connection quality of the first application when the terminal is in the first mode, and correspondingly, the first control module is configured to control whether the first application allows network connection to be used according to the network connection quality of the first application; the detection module is further configured to detect, when the terminal is not in the first mode, network connection quality of each process of the first application, and correspondingly, the first control module is further configured to respectively control whether network connection of a process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
In one possible implementation, the apparatus further includes: and the third determining module is used for determining that the terminal is in the second mode before the first event occurs under the condition that the terminal is determined to run the first application in the foreground.
In one possible implementation, the first control module includes: the judging unit is used for judging whether the network connection quality of the first application is lower than a preset standard or not; a third control unit, configured to control the first application not to allow the network connection to be used if the network connection quality of the first application is lower than the preset standard.
In one possible implementation, the first control module includes: a third determining unit, configured to determine the network connection quality of an application according to at least one of the following parameters of the application: the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
In a third aspect, the present application provides a terminal, comprising: a communication module, one or more processors, one or more memories, and one or more computer programs; wherein the processor is coupled to both the communication module and the memory, the one or more computer programs are stored in the memory, and when the terminal runs, the processor executes the one or more computer programs stored in the memory to cause the terminal to execute any one of the network connection control methods described above.
In a fourth aspect, the present application provides a computer storage medium including computer instructions, which, when executed on a terminal, cause the terminal to perform the network connection control method according to any one of the optional implementations of the first aspect.
It can be understood that the network connection control device, the terminal and the computer storage medium provided above are all used for executing the corresponding method provided above, and therefore, the beneficial effects achieved by the network connection control device can refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Drawings
Fig. 1 is a schematic view of an application scenario of a network connection control method according to an embodiment of the present application;
fig. 2 is a first interaction diagram of a network connection control method according to an embodiment of the present disclosure;
fig. 3 is a second interaction diagram of a network connection control method according to an embodiment of the present application;
fig. 4 is a first schematic structural diagram of a terminal according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a network connection control method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a network connection control apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
Embodiments of the present embodiment will be described in detail below with reference to the accompanying drawings.
The network connection control method provided by the embodiment of the application can be applied to a terminal, and the terminal can be a mobile phone, a tablet computer and the like which can carry a multi-task operating system (a system which can run a plurality of tasks and can be switched among the plurality of tasks, such as an Android system).
As shown in fig. 1, it is a schematic diagram of a terminal architecture, which includes an application processor AP (application processor) side and a modem side, where the AP side runs on a SoC (System on Chip, or System on Chip) of the terminal, an operating System, a user interface, and an application program all belong to the AP side, and the SoC is an integrated circuit and contains the complete operating System and application program. The modem side is disposed at a Baseband processor bp (Baseband processor), and may be specifically disposed on a Baseband chip (Baseband chip) of the terminal, where the Baseband chip is used to synthesize a Baseband signal to be transmitted or decode a received Baseband signal, the Baseband chip includes a modem, and the modem side is mainly used to complete a modulation/demodulation mode required by a GSM (Global System for Mobile Communications) System. The AP side and the BP side are logically independent systems, share a battery of a terminal, and can communicate with each other by IPC (Inter-Process Communication).
As shown in fig. 1, the AP side includes a first application, a detection module, and a control module. When the first application needs to connect to a network (for example, the first application can be a client and needs to communicate with a server of the first application to request services from the server), the first application sends network request data to the modem side, and for example, the network request data can include requests and specific service data. The detection module is used for detecting the network connection quality of the first application, and the control module is used for acquiring the network connection quality of the first application from the detection module so as to control whether the first application allows the network connection to be used or not according to the network connection quality of the first application.
In this embodiment, when a first application (the first application may be an application program installed in the terminal, or may be a software module embedded in the operating system in advance, which is not specifically limited in this embodiment of the present application) on the AP side is run in the foreground, if a first event occurs, the first application is switched to a background run or the terminal is turned off, so that the first application is not activated and displayed on the screen of the terminal. The triggering of the first event may be, for example, as shown in fig. 2, the first application is an "album" application of an operating system, and when viewing a picture in the album, the first application runs in the foreground, and if the user touches and slides up to an arrow end position along an arrow start position (bottom of the terminal touch screen) with a finger, the first application is returned to the desktop, or, as shown in fig. 3, when the user runs the first application in the foreground, a jump link provided in the first application is clicked, a dialog box jumping to another application "browser" is popped up, and after the user clicks and selects "yes" on the touch screen, the user jumps to the "browser", so that the first application runs in the background, or, in the case that the user runs the first application in the foreground, the user presses an off-key briefly, so that the terminal is turned off, the first application is not actively displayed on the terminal screen, and so on, in this embodiment, all the triggering conditions of the first event cannot be listed one by one, and the description thereof is omitted. It should be noted that, switching the first application to background running or turning off the screen of the terminal may use a hook (hook) function to listen in the bottom layer of the operating system.
Under the condition that the first application is not activated and displayed on a terminal screen and the first application is not closed in a background, if the network connection quality is not good, the first application frequently loses packets and retransmits the packets, so that the modem side is repeatedly called and the network data is requested to be sent, the battery power supply is consumed, and hardware and software resources of the terminal are occupied. The detection method of the detection module is to obtain one or more parameters of the terminal related to the network connection quality, for example, as shown in fig. 1, obtain an AP side parameter and a Modem side parameter, and specifically, may obtain a round trip delay RTT, an AP side packet loss rate, an AP side retransmission rate, an AP side cache time, and the like of the AP side, and a secondary cache capacity, a Modem side error rate, a Modem side scheduling rate, a Modem side window rate, and the like of the Modem side.
The above parameters are parameters that can be detected by the operating system, and the detection module can hook the software module for detecting the relevant parameters in the operating system through the hook function to obtain the detection result provided by the software module for detecting the corresponding parameters. For example, the detection module may bury a point at the AP side, the parameter at the AP side may be detected by using a net module at the position of the point, and the detection module may obtain the parameter detected by the net module through the point; the detection module can also bury a point on the modem side to acquire the above parameters on the modem side. Optionally, the detection module may obtain the one or more parameters for the application level, or the detection module may obtain the one or more parameters for each process of the application for the process level.
After the detection module detects the network connection quality, the control module controls the connection and disconnection of the first application network connection according to the network connection quality. Optionally, the detecting module controls whether the network connection of the first application is disconnected according to the network connection quality of the first application, and may include the following two cases: (1) under the condition that the network connection quality of the first application is poor (the network connection quality of the first application does not reach the preset standard), forbidding the first application to use the network connection, wherein the specific implementation mode can comprise the steps of controlling the established network connection of the first application to be disconnected and forbidding the first application to establish a new network connection request; (2) in the case that the network connection quality meets the preset standard, the first application is allowed to use the network connection, and the specific implementation may include maintaining the network connection of the first application unchanged, and allowing the first application to request a new network connection.
The network connection established by the first application may be established through a Socket (Socket), the Socket is in a transport layer, the Socket may be regarded as an endpoint in respective communication connections when two applications perform communication, and during the communication, a segment of information to be transmitted by the first application is written into a Socket of the SoC chip, and the Socket transmits the information to a modem side of the baseband chip through a specified protocol (e.g., transmission control protocol/internet protocol TCP/IP). When the established network connection is disconnected, the established network connection may be torn down (unlinked) by a Destroy socket command, and optionally, the network connection may be a transmission control protocol TCP link.
When the network connection is forbidden, a network firewall can be arranged on the AP side and used for intercepting the network request data sent by the first application, if the network connection quality of the first application is poor and the network use permission is that the network connection is not allowed, the network firewall can establish corresponding permission control so that the request data sent by the first application cannot be sent to the modem side and frequent awakening of the modem side is avoided, and in addition, the network firewall can feed back a preconfigured result (returned data) to the first application so as to at least inform the first application that the network connection cannot be used currently. If the network connection quality of the first application reaches the preset standard, the first application allows the network connection to be used without establishing authority control on the first application at a network firewall.
The preset standard may be set according to specific situations, for example, the preset standard may be that a threshold is set for each parameter, for example, an average value of the parameters is determined according to historical statistics results, if the average value is reached, it is determined that the corresponding parameter meets the requirement, and if there are a specified number of parameters that do not meet the requirement, it is determined that the network connection quality does not meet the preset standard; alternatively, the above is only an example, and a person skilled in the art may set specific conditions of the preset standard according to different specific situations according to the above example.
Optionally, when performing network connection control on the first application, network connection control may be selected according to an application level or a process level according to power consumption priority (reducing occupation of terminal resources and prolonging a duration time) or usability priority (user experience is better). The method includes the steps that when the terminal is in a power saving mode (the electric quantity of the terminal is lower than a preset threshold) or a night mode, network connection is controlled according to an application level, specifically, whether the network connection of the first application is disconnected or not can be controlled according to the network connection quality of the first application, and the network connection quality of the first application can be determined according to the network connection quality of each process of the first application. When the terminal is not in the power saving mode or the night mode, whether the network connection of the corresponding process is disconnected or not can be controlled according to the network connection quality of each process of the first application.
It should be noted that, after the first application is not activated and displayed on the terminal screen and the first application is not closed in the background, the network connection quality of the first application may be detected in real time, for example, the detection is performed in a time period of 5s, so as to disconnect the network connection of the first application in time after the network connection quality of the first application is detected to be poor.
After the first event occurs so that the first application is not actively displayed on the terminal screen, if the second event occurs so that the first application is actively displayed on the terminal screen, the restriction of the network connection quality of the first application to the network connection of the first application may be cancelled. For example, the second event may be that the first application is switched from a background running to a foreground running, or is unlocked after being turned off, so that the first application running in the foreground before being turned off is actively displayed on the terminal screen, and the like, and after the first event occurs, the network connection quality of the first application may not be detected, or the network connection quality of the first application is monitored but is not limited according to the network connection quality. Specifically, if the first application establishes a network firewall to prohibit the network connection of the first application due to poor network connection quality after the first event occurs, after the first application is switched to the foreground operation, the network firewall can be cancelled, and the limitation on the network connection used by the first application is removed, so that the network request data sent by the first application can be sent to the modem side.
After the first application is controlled not to allow the network connection to be used, if the network signal strength of the terminal is detected to exceed a preset threshold, the first application can be controlled to allow the network connection to be used (a specific implementation mode can be that a network firewall is cancelled so as to cancel interception of network data sent by the first application). The network signal strength of the terminal may be determined by detecting some characteristic parameters (such as transmission duration, packet loss rate, etc.) of the communication between the terminal and the base station, and in another optional implementation, the network signal strength of the terminal may also be determined according to the network connection quality of other running applications in the terminal.
Optionally, it may be further determined whether to control the network connection according to the network connection quality of the application (or each process of the application) according to whether the terminal is in the second mode, that is, the second mode is a basis for determining whether to control the network connection according to the network connection quality of the application (or each process of the application). For example, the second mode may be a power saving mode (the terminal is powered down to give priority to the demand for power consumption reduction), if the terminal is in the second mode, the network connection is controlled according to the network connection quality of the first application (or each process of the first application), and if it is determined that the terminal is not in the second mode, the limitation of the network connection by the network connection quality of the first application (or each process of the first application) is cancelled. For another example, the second mode may be a charging mode, if the terminal is in the charging mode, the power consumption of the terminal does not need to be saved, the first application may be controlled to always allow the network connection to be used, the network connection quality of the first application does not need to be limited, and if the terminal is not in the charging mode, the network connection quality of the first application needs to be limited. In this possible implementation manner, different specific implementations may be adopted according to different situations, and the embodiment of the present application is not particularly limited to this.
It should be noted that, in this possible implementation, the first mode and the second mode are different modes, and it needs to be determined whether to control the network connection according to the network connection quality of the application (or each process of the application) by determining whether to be in the second mode, and further select whether to control the network connection according to the application level or the process level by determining whether to be in the first mode. For example, the second mode is a power saving mode, the first mode is a night mode, the terminal is in the power saving mode in a state where the terminal has a power lower than 20% and is not charged, the network connection needs to be controlled according to the network connection quality of the application (or each process of the application), if the current time is after 10 pm until 7 am on the next day, the terminal is in the night mode, the network connection needs to be controlled according to the application level, and if the current time is between 7 am and 10 pm, the terminal is not in the night mode, and the network connection needs to be controlled according to the process level.
The network connection control method provided in the embodiment of the present application may be executed by a network connection control module as shown in fig. 1, where the network connection control module includes the detection module and the control module. The network connection control module may be implemented in a manner of embedding a module in an operating system, that is, a system-level software module, and in another optional implementation, the network connection control module may also be implemented in an application manner, for example, an apk application installation package of an android system, and after the application installation package is installed in the terminal, the AP side includes the network connection control module.
The above embodiments may be applied to the scenario that the terminal is connected to the GSM network, and in addition, the above embodiments may also be applied to the scenario that the terminal is connected to other kinds of networks, for example, Wi-Fi connection. In the Wi-Fi connection scenario, the parameters related to the network connection quality evaluated in the above example may be replaced with the parameters related to the network connection quality of the Wi-Fi connection.
Illustratively, the terminal may be a mobile phone.
As shown in fig. 4, the mobile phone may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a camera 193, a display screen 194, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention is not to be specifically limited to a mobile phone. In other embodiments of the present application, the handset may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the cell phone. The charging management module 140 may also supply power to the mobile phone through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 may receive input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like.
The power management module 141 may be configured to monitor performance parameters such as battery capacity, battery cycle count, battery charging voltage, battery discharging voltage, battery state of health (e.g., leakage, impedance), and the like. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the mobile phone can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to a mobile phone. The mobile communication module 150 may include one or more filters, switches, power amplifiers, Low Noise Amplifiers (LNAs), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to a mobile phone, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices that integrate one or more communication processing modules. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the handset antenna 1 is coupled to the mobile communication module 150 and the handset antenna 2 is coupled to the wireless communication module 160 so that the handset can communicate with the network and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The mobile phone realizes the display function through the GPU, the display screen 194, the application processor and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the cell phone may include 1 or N display screens 194, with N being a positive integer greater than 1.
The mobile phone can realize shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. In some embodiments, the handset 100 may include 1 or N cameras, N being a positive integer greater than 1. The camera 193 may be a front camera or a rear camera.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the mobile phone selects the frequency point, the digital signal processor is used for performing fourier transform and the like on the frequency point energy.
Video codecs are used to compress or decompress digital video. The handset may support one or more video codecs. Thus, the mobile phone can play or record videos in various encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may execute the above instructions stored in the internal memory 121, so as to enable the mobile phone to execute the method for intelligently recommending contacts, as well as various functional applications and data processing, and the like, provided in some embodiments of the present application. The internal memory 121 may include a program storage area and a data storage area. Wherein, the storage program area can store an operating system; the storage area may also store one or more application programs (e.g., gallery, contacts, etc.), etc. The data storage area can store data (such as photos, contacts and the like) created during the use of the mobile phone 101 and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a nonvolatile memory, such as one or more magnetic disk storage devices, flash memory devices, Universal Flash Storage (UFS), and the like. In other embodiments, the processor 110 causes the handset to perform the methods provided in the embodiments of the present application, as well as various functional applications and data processing, by executing instructions stored in the internal memory 121, and/or instructions stored in a memory disposed in the processor.
The mobile phone can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The handset can listen to music through the speaker 170A or listen to a hands-free conversation.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the mobile phone receives a call or voice information, the receiver 170B can be close to the ear to receive voice.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The handset may be provided with one or more microphones 170C. In other embodiments, the mobile phone may be provided with two microphones 170C to achieve the noise reduction function in addition to collecting the sound signal. In other embodiments, the mobile phone may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
The headphone interface 170D is used to connect a wired headphone. The earphone interface 170D may be the USB interface 130, or may be an open mobile platform (OMTP) standard interface of 3.5mm, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like, which is not limited in this embodiment.
Of course, the mobile phone provided in the embodiment of the present application may further include one or more devices such as a key 190, a motor 191, an indicator 192, and a SIM card interface 195, which is not limited in this embodiment of the present application.
A network connection control method provided in an embodiment of the present application will be described below with reference to the accompanying drawings.
As shown in fig. 5, a network connection control method provided in an embodiment of the present application includes:
step 502, when it is monitored that the terminal runs the first application in the foreground, the first application is switched to run in the background or the screen is turned off.
The listening operation may be performed by using a hook function by embedding a point in the operating system of the terminal. The first application is switched to the background running, and the switching to the interface, the lock screen, the desktop of the other application, or the window of the other application is partially overlapped on the window of the first application, so that the window of the first application is in the state of being not activated and displayed, and accordingly, the triggering condition of the first event can be that, for example, the first event can be that a user slides upwards through the bottom of a touch screen of the terminal, or the user clicks a link jumping to the other application in the first application, and the like; since the window of the first application is not actively displayed on the terminal screen after the occurrence of the first event, the network connection quality of the first application is detected to control whether the first application allows the use of the network connection according to the network connection quality of the first application. The screen-off of the terminal can be realized by pressing a power-off key of the terminal for a short time by a user so that the screen of the terminal is turned off.
And step 504, after the above conditions are monitored, monitoring the network connection quality of the first application in real time. The network connection quality of an application is determined based on at least one of the following parameters of the application: the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
If the network connection quality is below a predetermined level, the first application is not allowed to use the network connection, step 506.
Whether the network connection quality is lower than the preset standard can be set according to specific conditions. For example, a preset range may be set for each parameter, and if more than n parameters exceed the corresponding preset ranges, it is determined that the network connection quality is poor and lower than the preset standard. The embodiment does not limit the specific evaluation manner of the network connection quality, the above-mentioned manner for evaluating the first application network connection quality is only an example, and those skilled in the art will understand that different evaluation manners and criteria may be configured for the network connection quality according to specific situations.
Step 506 may include step 5061 and step 5062:
step 5061: and establishing a network firewall to intercept the network request data sent by the first application. The network firewall can configure the network use permission of the first application, if the network use permission of the first application is permission to use network connection, the network request data sent by the first application is not intercepted, and if the network use permission of the first application is non-permission to use network connection, the network request data sent by the first application is intercepted. The network request data is data which needs to be sent to a modem side of the terminal, and the modem side can modulate the network request data of the first application to be sent to the target end through the GSM network. Under the condition that the packet loss rate is high due to poor network connection quality, the network firewall intercepts the network request data of the first application to prevent the network request data of the first application from being frequently retransmitted to the modem side, so that the number of times that a baseband chip where the modem side is located is called is reduced, occupied hardware and software resources are reduced, and the endurance time is prolonged.
Step 5062: and disconnecting the network connection established by the first application. The network connection may be established through a Socket (Socket), the Socket is in a transport layer, and the Socket may be regarded as an endpoint in respective communication connections when two applications communicate, and during communication, a piece of information to be transmitted by a first application is written into the Socket of the SoC chip, and the Socket transmits the information to a modem side of the baseband chip through a specified protocol (e.g., transmission control protocol/internet protocol TCP/IP). When the established network connection is disconnected, the established network connection may be torn down (unlinked) by a Destroy socket command, and optionally, the network connection may be a transmission control protocol TCP link.
Step 508, after the first application is not allowed to use the network connection, if it is monitored that the first application is activated and displayed on the screen of the terminal, or the terminal is in charging, or the network signal strength of the terminal is determined to be higher than a preset threshold, step 510 is executed to allow the first application to use the network connection.
Specifically, step 510 includes steps 5101 and 5102:
in step 5101, the interception operation of the network firewall on the network request data sent by the first application is canceled. If the first application needs to use a network connection, a socket connection can be newly established.
After step 504, if it is detected that the network connection quality of the first application is not lower than the preset standard, step 512 is executed to allow the first application to continue using the network connection.
If it is monitored that the first application is activated and displayed on the screen of the terminal or the terminal is charging, step 514 is executed to cancel the monitoring of the network connection quality of the first application, that is, to cancel the limitation of the network connection quality of the first application on the network connection used by the first application.
According to the embodiment of the application, after the application is switched from foreground display to inactive display, the network connection quality is detected, the network connection state of the application can be controlled according to the network connection quality, the phenomenon that a large amount of hardware and software resources are consumed due to the fact that data packets are high in packet loss rate and a large amount of data messages need to be retransmitted under the condition that the network connection quality is poor is prevented, the endurance time of a terminal can be prolonged, a black and white list does not need to be set in advance, the network connection state of the application can be flexibly adjusted according to the network connection quality, and the use experience of a user is improved.
A network connection control apparatus provided in an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
As shown in fig. 6, a network connection control apparatus provided in an embodiment of the present application includes: the device comprises a first determination module 11, a detection module 12 and a first control module 13.
The terminal comprises a first determining module, a second determining module and a display module, wherein the first determining module is used for determining that a first event occurs when the terminal runs a first application in a foreground, and the first event is an event displayed on a terminal screen when a window of the first application is not activated; a detection module, configured to detect a network connection quality of the first application, where the detection module is equivalent to the detection module in the embodiment shown in fig. 1; a first control module, configured to control whether the first application allows to use the network connection according to the network connection quality of the first application, where the first control module is equivalent to the control module in the embodiment shown in fig. 1. The network connection control apparatus provided in this embodiment may include the network connection control module in the embodiment shown in fig. 1.
In an optional embodiment, the apparatus further comprises: the acquisition module is used for acquiring the network signal strength of the terminal detected in a preset period after controlling that the first application does not allow to use network connection according to the network connection quality of the first application; and the second control module is used for controlling whether the network connection of the first application is recovered to be allowed to be used or not according to the network signal strength of the terminal.
In an optional implementation manner, the obtaining module includes: an obtaining unit, configured to obtain network connection quality of the running application detected in the preset period; and the first determining unit is used for determining the network connection quality of the terminal according to the network connection quality of the running application.
In an optional embodiment, the apparatus further comprises: the second determining module is used for determining that a second event which enables an interface of a first application to activate and be displayed on a screen of the terminal occurs on the terminal or determining that the terminal is in a charging mode after the first event occurs under the condition that the terminal runs the first application in the foreground; and the execution module is used for controlling the first application to allow the network connection.
In an optional implementation manner, the execution module includes: and the execution unit is used for canceling the limitation of the network connection quality of the first application before the second event occurs or the terminal is in the charging mode.
In an optional implementation, the first control module includes: a second determining unit, configured to determine a network connection permission of the first application according to the network connection quality of the first application; and the first control unit is used for controlling whether the first application allows the network connection according to the network connection authority of the first application.
In an optional embodiment, the apparatus further comprises: the establishing module is used for establishing a network firewall under the condition that the network connection authority of the first application is not allowed to use the network connection after the network connection authority of the first application is determined, and the network firewall is configured to intercept the request data sent by the first application.
In an alternative embodiment, the network firewall is configured to intercept the request data sent by the first application to a modem of the terminal.
In an optional embodiment, the detection module includes: a detecting unit, configured to detect a network connection quality of each process of the first application.
In an optional implementation, the first control module includes: and the second control unit is used for respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
In an optional embodiment, the apparatus further comprises: the judging module is used for judging whether the terminal is in a first mode or not before detecting the network connection quality of the first application; the detection module is configured to detect network connection quality of the first application when the terminal is in the first mode, and correspondingly, the first control module is configured to control whether the first application allows network connection to be used according to the network connection quality of the first application; the detection module is further configured to detect, when the terminal is not in the first mode, network connection quality of each process of the first application, and correspondingly, the first control module is further configured to respectively control whether network connection of a process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
In an optional embodiment, the apparatus further comprises: and the third determining module is used for determining that the terminal is in the second mode before the first event occurs under the condition that the terminal is determined to run the first application in the foreground.
In an optional implementation, the first control module includes: the judging unit is used for judging whether the network connection quality of the first application is lower than a preset standard or not; a third control unit, configured to control the first application not to allow the network connection to be used if the network connection quality of the first application is lower than the preset standard.
In an optional implementation, the first control module includes: a third determining unit, configured to determine the network connection quality of an application according to at least one of the following parameters of the application: the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
It should be noted that the network connection control apparatus provided in this embodiment may perform the steps of the network connection control method in the embodiments shown in fig. 1 and fig. 5, and therefore, parts not described in detail in this embodiment are referred to in the related description of the above embodiments, and are not described again.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
As shown in fig. 7, an embodiment of the present application discloses a terminal, including: a touch screen 901, the touch screen 901 comprising a touch sensor 906 and a display 907; one or more processors 902; a memory 903; a communication module 908; and one or more computer programs 904. The various devices described above may be connected by one or more communication buses 905. Wherein the one or more computer programs 904 are stored in the memory 903 and configured to be executed by the one or more processors 902, the one or more computer programs 904 comprising instructions that can be used to perform the steps performed by the terminal in the above embodiments.
For example, the processor 902 may specifically be the processor 110 shown in fig. 3, the memory 903 may specifically be the internal memory 121 shown in fig. 4, the display 907 may specifically be the display 194 shown in fig. 4, the communication module 908 may specifically be the mobile communication module 150 and/or the wireless communication module 160 shown in fig. 4, and the touch sensor 906 may specifically be a touch sensor in the sensor module 180 shown in fig. 4, which is not limited in this embodiment of the present invention.
An embodiment of the present application further provides a computer storage medium, which includes computer instructions, and when the computer instructions are executed on a terminal, the terminal is enabled to execute the network connection control method according to any one of the optional implementation manners in the first aspect.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (26)

1. A network connection control method, comprising:
determining that a first event occurs when a terminal runs a first application in a foreground, wherein the first event is that the first application is switched to a background to run when the terminal does not turn off a screen;
detecting a network connection quality of the first application;
controlling whether the first application is allowed to use the network connection according to the network connection quality of the first application;
prior to detecting the network connection quality of the first application, the method further comprises:
judging whether the terminal is in a first mode or not;
under the condition that the terminal is in the first mode, detecting the network connection quality of the first application, and correspondingly, controlling whether the first application allows the network connection to be used or not according to the network connection quality of the first application; under the condition that the terminal is not in the first mode, detecting the network connection quality of each process of the first application, and correspondingly, respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application;
before determining that the first event occurs in a case where the terminal runs the first application in the foreground, the method further includes: determining that the terminal is in a second mode;
the first mode and the second mode are different modes.
2. The method of claim 1, wherein after controlling the first application not to allow network connection usage according to the network connection quality of the first application, the method further comprises:
acquiring the network signal intensity of the terminal detected in a preset period;
and controlling whether the network connection of the first application is recovered to be allowed to be used or not according to the network signal strength of the terminal.
3. The method according to claim 2, wherein the obtaining the network signal strength of the terminal detected at the preset period comprises:
acquiring the network connection quality of the running application detected in the preset period;
and determining the network connection quality of the terminal according to the network connection quality applied in the operation.
4. The method of claim 1, wherein after determining that the first event occurs while the terminal is running the first application in the foreground, the method further comprises:
determining that a second event occurs on the terminal, wherein the second event causes the interface of the first application to activate and be displayed on a screen of the terminal;
controlling the first application to allow use of a network connection.
5. The method of claim 4, wherein the controlling the first application to allow use of a network connection comprises:
canceling the restriction of the network connection quality of the first application on the network connection of the first application before the occurrence of the second event.
6. The method according to any one of claims 1-5, wherein said controlling whether the first application allows using the network connection according to the network connection quality of the first application comprises:
determining the network connection authority of the first application according to the network connection quality of the first application;
and controlling whether the first application is allowed to use network connection or not according to the network connection authority of the first application.
7. The method of claim 6,
in the case that the network connection authority of the first application is not to allow the network connection to be used, the controlling whether the first application allows the network connection to be used includes: establishing a network firewall configured to intercept request data sent by the first application.
8. The method of claim 7, wherein the network firewall is configured to intercept the request data sent by the first application to a modem of the terminal.
9. The method of claim 8, wherein the detecting the network connection quality of the first application comprises: detecting a network connection quality of each process of the first application.
10. The method of claim 9, wherein the controlling whether the first application allows using the network connection according to the network connection quality of the first application comprises: and respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
11. The method of claim 1, wherein the controlling whether the first application allows using the network connection according to the network connection quality of the first application comprises:
judging whether the network connection quality of the first application is lower than a preset standard or not;
and controlling the first application not to allow the network connection to be used under the condition that the network connection quality of the first application is lower than the preset standard.
12. The method according to claim 11, wherein the network connection quality of an application is determined at least based on one of the following parameters of the application:
the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
13. A network connection control apparatus, comprising:
the terminal comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining that a first event occurs when the terminal runs a first application in a foreground, and the first event is that the first application is switched to run in the background when the terminal is not turned off;
a detection module for detecting a network connection quality of the first application;
the first control module is used for controlling whether the first application allows to use the network connection or not according to the network connection quality of the first application;
the device further comprises:
the judging module is used for judging whether the terminal is in a first mode or not before detecting the network connection quality of the first application; the detection module is configured to detect network connection quality of the first application when the terminal is in the first mode, and correspondingly, the first control module is configured to control whether the first application allows network connection to be used according to the network connection quality of the first application; the detection module is further configured to detect, when the terminal is not in the first mode, network connection quality of each process of the first application, and correspondingly, the first control module is further configured to respectively control whether network connection of a process corresponding to the first application is disconnected according to the network connection quality of each process of the first application;
the third determining module is used for determining that the terminal is in the second mode before the first event occurs under the condition that the terminal is determined to run the first application in the foreground;
the first mode and the second mode are different modes.
14. The apparatus of claim 13, further comprising:
the acquisition module is used for acquiring the network signal strength of the terminal detected in a preset period after controlling that the first application does not allow to use network connection according to the network connection quality of the first application;
and the second control module is used for controlling whether the network connection of the first application is recovered to be allowed to be used or not according to the network signal strength of the terminal.
15. The apparatus of claim 14, wherein the obtaining module comprises:
an obtaining unit, configured to obtain network connection quality of the running application detected in the preset period;
and the first determining unit is used for determining the network connection quality of the terminal according to the network connection quality of the running application.
16. The apparatus of claim 13, further comprising:
the second determining module is used for determining that a second event which enables an interface of a first application to activate and be displayed on a screen of the terminal occurs on the terminal or determining that the terminal is in a charging mode after the first event occurs under the condition that the terminal runs the first application in the foreground;
and the execution module is used for controlling the first application to allow the network connection.
17. The apparatus of claim 16, wherein the execution module comprises:
an execution unit, configured to cancel a restriction of the network connection quality of the first application on the network connection of the first application before the second event occurs or the terminal is in the charging mode.
18. The apparatus of any of claims 13-17, wherein the first control module comprises:
a second determining unit, configured to determine a network connection permission of the first application according to the network connection quality of the first application;
and the first control unit is used for controlling whether the first application allows the network connection according to the network connection authority of the first application.
19. The apparatus of claim 18, further comprising:
the establishing module is used for establishing a network firewall under the condition that the network connection authority of the first application is not allowed to use the network connection after the network connection authority of the first application is determined, and the network firewall is configured to intercept the request data sent by the first application.
20. The apparatus of claim 19, wherein the network firewall is configured to intercept the request data sent by the first application to a modem of the terminal.
21. The apparatus of claim 20, wherein the detection module comprises: a detecting unit, configured to detect a network connection quality of each process of the first application.
22. The apparatus of claim 21, wherein the first control module comprises: and the second control unit is used for respectively controlling whether the network connection of the process corresponding to the first application is disconnected according to the network connection quality of each process of the first application.
23. The apparatus of claim 13, wherein the first control module comprises:
the judging unit is used for judging whether the network connection quality of the first application is lower than a preset standard or not;
a third control unit, configured to control the first application not to allow the network connection to be used if the network connection quality of the first application is lower than the preset standard.
24. The apparatus of claim 23, wherein the first control module comprises:
a third determining unit, configured to determine the network connection quality of an application according to at least one of the following parameters of the application:
the application processor AP side backward delay RTT, the AP side packet loss rate, the AP side retransmission rate, the AP side cache time, the second level cache capacity of the Modem side of the Modem, the Modem side error rate, the Modem side scheduling rate and the Modem side window rate.
25. A terminal, characterized in that the terminal comprises:
a communication module;
one or more processors;
one or more memories;
and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, which when executed by the terminal, cause the terminal to perform the network connection control method of any of claims 1-12.
26. A computer storage medium, characterized by comprising a computer program which, when run on a terminal, causes the terminal to execute the network connection control method of any one of claims 1-12.
CN201911115157.8A 2019-11-14 2019-11-14 Network connection control method and device, terminal and computer storage medium Active CN110913424B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911115157.8A CN110913424B (en) 2019-11-14 2019-11-14 Network connection control method and device, terminal and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911115157.8A CN110913424B (en) 2019-11-14 2019-11-14 Network connection control method and device, terminal and computer storage medium

Publications (2)

Publication Number Publication Date
CN110913424A CN110913424A (en) 2020-03-24
CN110913424B true CN110913424B (en) 2022-04-22

Family

ID=69816683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911115157.8A Active CN110913424B (en) 2019-11-14 2019-11-14 Network connection control method and device, terminal and computer storage medium

Country Status (1)

Country Link
CN (1) CN110913424B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113795040B (en) * 2021-06-16 2022-10-18 荣耀终端有限公司 Channel switching method, electronic device and storage medium
CN114585054B (en) * 2022-02-23 2023-11-14 北京小米移动软件有限公司 WIFI connection control method, device and storage medium
CN116055546A (en) * 2022-07-21 2023-05-02 荣耀终端有限公司 Process management method, electronic device, storage medium, and program product
CN116744329A (en) * 2022-10-21 2023-09-12 荣耀终端有限公司 Network acceleration method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165062A1 (en) * 2015-04-14 2016-10-20 华为技术有限公司 Terminal control method, device and terminal
CN106102143A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of application processing method and device
CN106792815A (en) * 2016-12-20 2017-05-31 深圳市万普拉斯科技有限公司 Data load method and device
CN107071859A (en) * 2017-04-28 2017-08-18 北京小米移动软件有限公司 network connection processing method, device and terminal
CN107894917A (en) * 2017-11-10 2018-04-10 深圳天珑无线科技有限公司 Terminal and its method for closing background application, storage device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165062A1 (en) * 2015-04-14 2016-10-20 华为技术有限公司 Terminal control method, device and terminal
CN111290561A (en) * 2015-04-14 2020-06-16 华为技术有限公司 Terminal control method and device and terminal
CN106102143A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of application processing method and device
CN106792815A (en) * 2016-12-20 2017-05-31 深圳市万普拉斯科技有限公司 Data load method and device
CN107071859A (en) * 2017-04-28 2017-08-18 北京小米移动软件有限公司 network connection processing method, device and terminal
CN107894917A (en) * 2017-11-10 2018-04-10 深圳天珑无线科技有限公司 Terminal and its method for closing background application, storage device

Also Published As

Publication number Publication date
CN110913424A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110913424B (en) Network connection control method and device, terminal and computer storage medium
WO2020143380A1 (en) Data transmission method and electronic device
EP4236434A1 (en) Channel switching method, electronic device, and storage medium
US20220346010A1 (en) Data Sending/Receiving Method, Electronic Device, and Computer-Readable Storage Medium
CN112954819B (en) Equipment networking method, electronic equipment and system
CN114172791B (en) Channel switching method, electronic device and storage medium
CN111132234A (en) Data transmission method and corresponding terminal
WO2021169698A1 (en) Connection management method and related device
CN113993226B (en) Service processing method and device in terminal equipment supporting double cards
CN113038627B (en) File sharing method, mobile device and computer storage medium
EP4132202A1 (en) Data downloading method and apparatus, and terminal device
CN114449576A (en) Application data sending method, device and equipment
CN112291833B (en) Equipment control method, system and related device
CN113596919B (en) Data downloading method and device and terminal equipment
CN113810965B (en) Channel switching method, electronic device and storage medium
CN116709442A (en) Wireless network switching method and electronic equipment
CN112469012A (en) Bluetooth communication method and related device
CN114710812A (en) Communication method and communication device
CN114915359A (en) Method, device, electronic equipment and readable storage medium for selecting channel
CN116709432B (en) Cache queue adjusting method and electronic equipment
EP4307762A1 (en) Method for transmitting packet in wireless local area network and electronic device
CN116405960B (en) Network quality detection method and related electronic equipment
RU2811567C1 (en) Channel switching method, electronic device and data media
CN113453274B (en) Uplink data distribution method and terminal
WO2021143921A1 (en) Multipath transmission control method and control apparatus

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
GR01 Patent grant
GR01 Patent grant